@ALDDerivedClass @ALDAOperator(genericExecutionMode=ALL) public class SnakeOptimizerCoupled extends SnakeOptimizer
This class provides methods to segment multiple contours in an image based on parametric active contour models, i.e. snakes. Multiple snakes may be coupled in the sense that overlap will be penalized by a common energy term in the functional.
SnakeOptimizer.Snake_status
de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatus, de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorControlStatusHandle, de.unihalle.informatik.Alida.operator.ALDOperatorControllable.OperatorExecutionStatus
Modifier and Type | Field and Description |
---|---|
protected boolean[] |
activityArray
Array of active snakes, suitable for masking snakes in optimization.
|
protected int[] |
colorArray
Array containing pseudo-colors for snake visualization.
|
protected MTBImageRGB |
dispImg
Image for displaying intermediate/final results.
|
protected int[] |
iterationsPerSnake
Number of iterations done for each snake.
|
protected int[][] |
overlapMask
Mask to indicate overlap regions between snakes.
|
protected boolean |
overlapMaskRequested
Flag to indicate if overlap mask is required by at least one energy.
|
protected SnakeOptimizerSingle[] |
snakeOpters
Array of individual snake optimizers.
|
protected SnakeOptimizerSingle |
snakeOptimizer
Optimizer object for a single snake.
|
counterClockwiseSnakePointOrderRequested, energyData, excludeMask, iChannels, iHeight, inImg, initialSnakes, intermediateResults, itCounter, iWidth, outIntermediateResultsStack, outIntermediateResultsStackInterval, outIntermediateResultsStackWanted, outSnakes, outSnakesImg, sampleEnergyData, saveIntermediateResults, saveIntermediateResultsPath, showIntermediateResults, snakeNum
Constructor and Description |
---|
SnakeOptimizerCoupled()
Default constructor.
|
SnakeOptimizerCoupled(MTBImage img,
MTBPolygon2DSet initSnakes,
SnakeOptimizerSingle sopt,
boolean[] activeArray)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
SnakeOptimizerCoupled |
clone() |
protected void |
closeWindows()
Close all windows openened by this operator (for clean-up).
|
protected SnakeOptimizer.Snake_status |
doIteration()
Here the main work should be done.
|
boolean[] |
getActivityArray()
Returns current activity array.
|
int[][] |
getCurrentOverlapMask()
Get the current overlap mask.
|
MTBPolygon2DSet |
getCurrentSnakes()
Returns a copy of the set of current snakes.
|
int[] |
getIterationsPerSnake()
Returns the total number of iterations per snake.
|
MTBImage |
getWorkingImage()
Returns working image.
|
protected void |
initOptimizer()
Initializes the optimizer.
|
protected void |
plotImageToBackground()
Copies the input image as background into the output frame.
|
protected void |
plotSnakeToImage(MTBImageRGB img) |
void |
printParams()
Print current parameter settings to standard output device.
|
protected void |
saveSnake()
Save intermediate results.
|
void |
setActivityArray(boolean[] array)
Specify set of active snakes.
|
void |
setColorArray(int[] array)
Specify pseudo-colors for snake visualization.
|
protected void |
showSnake()
Display input image with current snake overlayed.
|
String |
toString() |
void |
updateOverlapMask()
Update current overlap mask for all snakes.
|
void |
validateCustom() |
disableSaveIntermediateResults, disableShowIntermediateResults, enableSaveIntermediateResults, enableShowIntermediateResults, getExcludeMask, getInitialSnakes, getInputImage, getIterationCount, getResultSnakeImage, getResultSnakes, getSnakeNumber, getStackWithIntermediateResults, operate, readResolve, setExcludeMask, setInitialSnakes, setInputImage, setIntermediateResultPath, supportsStepWiseExecution, wantStackWithIntermediateResults
addALDConfigurationEventListener, addALDControlEventListener, fireALDConfigurationEvent, fireALDControlEvent, getControlStatus, getControlStatusHandle, getExecutionStatus, handleALDConfigurationEvent, handleALDControlEvent, removeALDConfigurationEventListener, removeALDControlEventListener, setControlStatus, setNotifyRecursiveFlag
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateGeneric, writeHistory, writeHistory, writeHistory
@Parameter(label="Snake Optimizer", direction=IN, required=true, dataIOOrder=3, description="Snake optimizer for single snake segmentation.") protected SnakeOptimizerSingle snakeOptimizer
@Parameter(label="Activity array", direction=IN, required=false, description="Array of active snakes.") protected boolean[] activityArray
Note, per default all snakes are active. The size of the array on init is just randomly chosen, but a certain size is required since otherwise the GUI will initialize the array with false values.
@Parameter(label="Number of iterations per snake", direction=OUT, description="Iterations per snake.") protected transient int[] iterationsPerSnake
protected transient SnakeOptimizerSingle[] snakeOpters
protected transient int[] colorArray
protected transient boolean overlapMaskRequested
protected transient int[][] overlapMask
protected transient MTBImageRGB dispImg
public SnakeOptimizerCoupled() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public SnakeOptimizerCoupled(MTBImage img, MTBPolygon2DSet initSnakes, SnakeOptimizerSingle sopt, boolean[] activeArray) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- Image to work on.initSnakes
- Set of initial snakes.sopt
- Snake optimizer.activeArray
- Array indicating active snakes.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class SnakeOptimizer
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public SnakeOptimizerCoupled clone()
clone
in class SnakeOptimizer
public void setActivityArray(boolean[] array)
array
- Boolean array to indicate active snakes.public boolean[] getActivityArray()
public void setColorArray(int[] array)
protected void initOptimizer() throws MTBSnakeException
Here internal member variables are initialized according to the given parameters, and memory for intermediate results and debug data is allocated.
initOptimizer
in class SnakeOptimizer
MTBSnakeException
protected SnakeOptimizer.Snake_status doIteration() throws MTBException
SnakeOptimizer
doIteration
in class SnakeOptimizer
MTBException
protected void showSnake()
showSnake
in class SnakeOptimizer
protected void closeWindows()
SnakeOptimizer
closeWindows
in class SnakeOptimizer
protected void saveSnake()
SnakeOptimizer
saveSnake
in class SnakeOptimizer
public void updateOverlapMask()
public MTBImage getWorkingImage()
SnakeOptimizer
Usually this will be the input image, however, e.g. in case of image normalization being applied the normalized image will be returned.
getWorkingImage
in class SnakeOptimizer
public MTBPolygon2DSet getCurrentSnakes()
getCurrentSnakes
in class SnakeOptimizer
public int[][] getCurrentOverlapMask()
public int[] getIterationsPerSnake()
public void printParams()
SnakeOptimizer
printParams
in class SnakeOptimizer
public String toString()
toString
in class SnakeOptimizer
protected void plotImageToBackground()
protected void plotSnakeToImage(MTBImageRGB img)
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.