@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCD_CVRegionFit extends MTBActiveContourEnergy_CVRegionFit implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable, MTBSnakeEnergyCoupled
This energy models the inner and outer regions of a snake by a Gaussian model, i.e. each region is specified by a mean intensity value and deviations from this value are penalized.
The energy can also be used in joint optimization of multiple snakes. In this case the energy over all N snakes is defined as follows:
Paper:
MTBActiveContourEnergy_CVRegionFit| Modifier and Type | Field and Description |
|---|---|
private SnakeOptimizerCoupled |
cSnakeOpt
Reference to a coupled snake optimizer.
|
private MTBSnake |
currentSnk
Current snake the energy is based on.
|
private double[] |
energyRange
Interval boundaries of adapted energy interval.
|
private boolean[][] |
excludeMask
Global exclude mask for image to be segmented.
|
private int |
iHeight
Height of working image.
|
private int |
iWidth
Width of working image.
|
protected SnakeOptimizerSingle.EnergyNormalizationMode |
normMode
Mode of normalization.
|
private int[][] |
overlapMask
Current overlap mask for joint optimization of multiple snakes.
|
protected double |
scaleFactor
Scaling factor to rescale image coordinates in range [0,1] or
several ranges to the original coordinates range like [1000, 1000]
in a image of size 1000 x 1000.
|
areas, iChannels, inImg, lambda_in, lambda_out, meanstargetEnergyRange| Constructor and Description |
|---|
MTBSnakeEnergyCD_CVRegionFit()
Default constructor.
|
MTBSnakeEnergyCD_CVRegionFit(MTBImage im,
double[] lin,
double[] lout)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
double |
calcEnergy(SnakeOptimizerSingle opt)
Calculates the energy of the current snake.
|
Jama.Matrix |
getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Updates the fitting term based on new region average values.
|
Jama.Matrix |
getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
Returns the vector part of this energy for snake optimization.
|
double |
getScaleFactor()
Get scaling factor.
|
boolean |
initEnergy(SnakeOptimizerCoupled opt)
Init routine which is called once before the energy is actually used.
|
boolean |
initEnergy(SnakeOptimizerSingle opt)
Init routine which is called once before the energy is actually used.
|
boolean |
requiresCounterClockwiseContourSorting()
Ask energy if contour points need to sorted counter-clockwise.
|
boolean |
requiresOverlapMask()
Ask energy if an overlap mask for all snakes jointly optimized is required.
|
void |
setScaleFactor(double s)
Set the scaling factor.
|
String |
toString()
Get an identifier string for the energy object.
|
void |
updateStatus(SnakeOptimizerCoupled opt)
Update internal state of energy object prior to querying
derivatives and so on.
|
void |
updateStatus(SnakeOptimizerSingle opt)
Update internal state of energy object prior to usaging it.
|
calcEnergy, calcInteriorEnergy, getDerivative, getEnergyDerivativeMaxVal, getEnergyDerivativeMinVal, getMeans, init, updateParametersprivate double[] energyRange
energyRange[0] -> left boundary energyRange[1] -> right boundary energyRange[2] -> interval width
private transient int iWidth
private transient int iHeight
protected SnakeOptimizerSingle.EnergyNormalizationMode normMode
protected transient double scaleFactor
private transient MTBSnake currentSnk
private transient boolean[][] excludeMask
private transient SnakeOptimizerCoupled cSnakeOpt
This reference is only non-null if the energy is used in conjunction with coupled snake optimization.
private int[][] overlapMask
public MTBSnakeEnergyCD_CVRegionFit()
public MTBSnakeEnergyCD_CVRegionFit(MTBImage im, double[] lin, double[] lout)
im - Image to work on.l_in - Weighting factors for inner region fit.l_out - Weighting factors for outer region fit.de.unihalle.informatik.Alida.exceptions.ALDOperatorExceptionALDProcessingDAGExceptionpublic boolean initEnergy(SnakeOptimizerCoupled opt) throws MTBSnakeException
MTBSnakeEnergyCoupledIn this routine global parameter settings can be handled or other initialization stuff be done. Snake optimizers are supposed to call this routine once before they actual use of the energy. If no stuff needs to be done in advance the routine should at least return true.
initEnergy in interface MTBSnakeEnergyCoupledopt - Calling snake optimizer.MTBSnakeExceptionpublic boolean initEnergy(SnakeOptimizerSingle opt) throws MTBSnakeException
MTBSnakeEnergyDerivableIn this routine global parameter settings can be handled or other initialization stuff be done. The SnakeOptimizer will call this routine once before the actual use of the energy. If no stuff needs to be done in advance the routine should at least return true.
initEnergy in interface MTBSnakeEnergyComputableinitEnergy in interface MTBSnakeEnergyDerivableopt - Calling snake optimizer.MTBSnakeExceptionpublic void updateStatus(SnakeOptimizerCoupled opt)
MTBSnakeEnergyCoupledupdateStatus in interface MTBSnakeEnergyCoupledpublic void updateStatus(SnakeOptimizerSingle opt) throws MTBSnakeException
MTBSnakeEnergyDerivableupdateStatus in interface MTBSnakeEnergyComputableupdateStatus in interface MTBSnakeEnergyDerivableMTBSnakeExceptionpublic Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
getDerivative_MatrixPart in interface MTBSnakeEnergyDerivableopt - Calling snake optimizer.public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivablegetDerivative_VectorPart in interface MTBSnakeEnergyDerivableopt - Calling snake optimizer.public double calcEnergy(SnakeOptimizerSingle opt)
MTBSnakeEnergyComputablecalcEnergy in interface MTBSnakeEnergyComputableopt - Calling snake optimizer.public void setScaleFactor(double s)
setScaleFactor in interface MTBSnakeEnergyComputablesetScaleFactor in interface MTBSnakeEnergyDerivables - new scaling factor.public double getScaleFactor()
getScaleFactor in interface MTBSnakeEnergyComputablegetScaleFactor in interface MTBSnakeEnergyDerivablepublic String toString()
MTBSnakeEnergyDerivableWhen meta parameters are saved to a file, configuration objects need to be converted to strings. Consequently, each snake energy should be associated with a unique and descriptive string for later reference.
toString in interface MTBSnakeEnergyComputabletoString in interface MTBSnakeEnergyDerivabletoString in class MTBActiveContourEnergy_CVRegionFitpublic boolean requiresCounterClockwiseContourSorting()
MTBSnakeEnergyDerivablerequiresCounterClockwiseContourSorting in interface MTBSnakeEnergyComputablerequiresCounterClockwiseContourSorting in interface MTBSnakeEnergyCoupledrequiresCounterClockwiseContourSorting in interface MTBSnakeEnergyDerivablepublic boolean requiresOverlapMask()
MTBSnakeEnergyDerivablerequiresOverlapMask in interface MTBSnakeEnergyComputablerequiresOverlapMask in interface MTBSnakeEnergyCoupledrequiresOverlapMask in interface MTBSnakeEnergyDerivableCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.