public abstract class SnakeOptimizerSingle extends SnakeOptimizer
Image contour segmentation using parametric snakes.
Modifier and Type | Class and Description |
---|---|
static class |
SnakeOptimizerSingle.EnergyNormalizationMode
Snake normalization mode.
|
static class |
SnakeOptimizerSingle.IntensityNormalizationMode
Image intensity normalization mode.
|
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 MTBImageRGB |
dispImg
Image for showing/saving intermediate results.
|
protected Boolean |
doResampling
Flag to enable/disable snake resampling.
|
protected double |
energy
Current energy of the snake.
|
protected boolean |
energyCalculationRequested
Flag for invoking energy calculations.
|
protected SnakeOptimizerSingle.IntensityNormalizationMode |
intNormMode
Mode for normalizing image intensities.
|
protected SnakeOptimizerSingle.EnergyNormalizationMode |
normMode
Mode for normalizing energies.
|
protected double |
previousEnergy
Snake energy in previous iteration (for change assessment).
|
protected MTBSnake |
previousSnake
Old snake of previous iteration (for evolution assessment).
|
protected Double |
resampleSegLength
Target length of snake segments in resampling.
|
protected double |
scaleFactor
Scale factor for snake normalization.
|
protected MTBSnake |
snake
The snake on which the algorithm works.
|
protected UserTime |
timer
Timer object for time measurements.
|
protected MTBImage |
workingImage
Image on which to actually do the segmentation.
|
counterClockwiseSnakePointOrderRequested, energyData, excludeMask, iChannels, iHeight, inImg, initialSnakes, intermediateResults, itCounter, iWidth, outIntermediateResultsStack, outIntermediateResultsStackInterval, outIntermediateResultsStackWanted, outSnakes, outSnakesImg, sampleEnergyData, saveIntermediateResults, saveIntermediateResultsPath, showIntermediateResults, snakeNum
Constructor and Description |
---|
SnakeOptimizerSingle()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeWindows()
Close all windows openened by this operator (for clean-up).
|
void |
disableEnergyCalculation()
Disable energy calculations completely.
|
Boolean |
doResampleSnake()
Returns true if snake should be resampled during optimization.
|
void |
enableEnergyCalculation()
Enable energy calculation in each iteration.
|
MTBSnake |
getCurrentSnake()
Returns a copy of the current snake.
|
MTBPolygon2DSet |
getCurrentSnakes()
Returns a set with current snake(!).
|
abstract MTBSet_ActiveContourEnergy |
getEnergySet()
Returns a reference to the set of energies.
|
double |
getEnergyValue()
Get current energy value for the snake.
|
SnakeOptimizerSingle.IntensityNormalizationMode |
getIntensityNormalizationMode()
Request mode for normalizing image intensities.
|
SnakeOptimizerSingle.EnergyNormalizationMode |
getNormalizationMode()
Returns energy normalization mode.
|
double |
getPreviousEnergyValue()
Get old energy value for the snake at last iteration.
|
MTBSnake |
getPreviousSnake()
Returns the previous snake.
|
Double |
getSegmentLength()
Returns desired segment length for resampling.
|
MTBImage |
getWorkingImage()
Returns working image.
|
protected abstract boolean |
hasEnergies()
Check if energies are given.
|
protected void |
initOptimizer()
Initializes the optimizer.
|
MTBImage |
normalizeInputImage(MTBImage inimg)
Normalizes image intensities according to normalization mode of
operator.
|
void |
printParams()
Print current parameter settings to standard output device.
|
protected Object |
readResolve()
Function for proper initialization of deserialized objects.
|
protected void |
resampleSnake()
Resamples the snake using the specified segment length.
|
protected void |
saveSnake()
Save intermediate results.
|
abstract void |
setEnergySet(MTBSet_ActiveContourEnergy eSet)
Specify set of energies.
|
void |
setNormalizationMode(SnakeOptimizerSingle.EnergyNormalizationMode m)
Set energy normalization mode.
|
protected void |
showSnake()
Display intermediate results by overlaying the input image with
the current snake result.
|
String |
toString() |
void |
validateCustom() |
clone, disableSaveIntermediateResults, disableShowIntermediateResults, doIteration, enableSaveIntermediateResults, enableShowIntermediateResults, getExcludeMask, getInitialSnakes, getInputImage, getIterationCount, getResultSnakeImage, getResultSnakes, getSnakeNumber, getStackWithIntermediateResults, operate, 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="Image intensity normalization mode", direction=IN, required=false, dataIOOrder=9, description="Normalization mode for image intensities.") protected SnakeOptimizerSingle.IntensityNormalizationMode intNormMode
@Parameter(label="Energy normalization mode", direction=IN, required=false, dataIOOrder=10, description="Normalization mode for snake/energies.") protected SnakeOptimizerSingle.EnergyNormalizationMode normMode
@Parameter(label="Resample Segment Length", mode=ADVANCED, direction=IN, required=false, dataIOOrder=12, description="Desired resampling segment length.") protected Double resampleSegLength
@Parameter(label="Do Resampling", mode=ADVANCED, direction=IN, required=false, dataIOOrder=11, description="Flag for snake resampling.") protected Boolean doResampling
protected transient MTBSnake snake
protected transient MTBImage workingImage
If image normalization is applied to the given input image, i.e. if the input image is normalized to intensities in range [0,1], this working image contains the normalized image.
protected transient MTBSnake previousSnake
protected transient boolean energyCalculationRequested
protected transient double energy
protected transient double previousEnergy
protected transient double scaleFactor
protected transient UserTime timer
protected transient MTBImageRGB dispImg
public SnakeOptimizerSingle() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected Object readResolve()
This function is called on an instance of this class being deserialized from file, prior to handing the instance over to the user. It takes care of a proper initialization of transient member variables as they are not initialized to the default values during deserialization.
readResolve
in class SnakeOptimizer
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class SnakeOptimizer
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void initOptimizer() throws MTBSnakeException
SnakeOptimizer
Needs to be implemented by any derived class. This routine is automatically called on invoking the local operate routine.
initOptimizer
in class SnakeOptimizer
MTBSnakeException
protected void showSnake()
showSnake
in class SnakeOptimizer
protected void closeWindows()
SnakeOptimizer
closeWindows
in class SnakeOptimizer
protected void saveSnake()
saveSnake
in class SnakeOptimizer
protected abstract boolean hasEnergies()
public void printParams()
SnakeOptimizer
printParams
in class SnakeOptimizer
public String toString()
toString
in class SnakeOptimizer
public abstract MTBSet_ActiveContourEnergy getEnergySet()
public abstract void setEnergySet(MTBSet_ActiveContourEnergy eSet)
eSet
- Set of energies.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()
In case of the SnakeOptimizerSingle class this set will always have exactly one element.
getCurrentSnakes
in class SnakeOptimizer
public void enableEnergyCalculation()
public void disableEnergyCalculation()
public void setNormalizationMode(SnakeOptimizerSingle.EnergyNormalizationMode m)
public SnakeOptimizerSingle.EnergyNormalizationMode getNormalizationMode()
public SnakeOptimizerSingle.IntensityNormalizationMode getIntensityNormalizationMode()
public MTBSnake getCurrentSnake()
public MTBSnake getPreviousSnake()
public double getEnergyValue()
public double getPreviousEnergyValue()
public Double getSegmentLength()
public Boolean doResampleSnake()
public MTBImage normalizeInputImage(MTBImage inimg)
inimg
- Image to be normalized.protected void resampleSnake()
Note: if snake is normalized, segment length will also be normalized! Normalization of segment length is done by resampling!
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.