@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCD_KassLength extends Object implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable
The energy is based on first order derivatives of a snake C and is defined as follows:
 In addition, the weighting parameters can dynamically be adjusted by
 providing the energy with an update object, see
 MTBSnakeEnergyCD_KassLength_ParamAdapt.
 
Paper: Kass, Witkin and Terzopoulos, Snakes: Active Contour Models, International Journal of Computer Vision, pp. 321-331, 1988.
| Modifier and Type | Field and Description | 
|---|---|
private double | 
alphaInitial
Initial weighting factor for the length term, should be > 0. 
 | 
private double[] | 
alphas
Vector of point-specific alpha values. 
 | 
private Double | 
maxAlpha
Maximal possible value of alpha as can be provided by parameter updated. 
 | 
private double | 
normalizationFactor
Normalization factor for scaling matrix entries. 
 | 
private SnakeOptimizerSingle.EnergyNormalizationMode | 
normMode
Mode of normalization. 
 | 
private MTBSnakeEnergyCD_KassLength_ParamAdapt | 
pUpdater
Parameter update strategy. 
 | 
protected double | 
scaleFactor
Scaling factor for image coordinates. 
 | 
targetEnergyRange| Constructor and Description | 
|---|
MTBSnakeEnergyCD_KassLength()
Default constructor. 
 | 
MTBSnakeEnergyCD_KassLength(double _alpha,
                           MTBSnakeEnergyCD_KassLength_ParamAdapt _pUpd)
Constructor with dynamic parameter updater. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
double | 
calcEnergy(SnakeOptimizerSingle opt)
Calculates snake energy (non-normalized!). 
 | 
double | 
calcEnergy(SnakeOptimizerSingle opt,
          int pos)
Calculates energy at a certain position for the current snake. 
 | 
Jama.Matrix | 
getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Updates matrix A given weights for the internal energy term. 
 | 
Jama.Matrix | 
getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
Returns the vector part of this energy for snake optimization. 
 | 
double | 
getInitAlpha()
Get the initial alpha value. 
 | 
private double | 
getNormalizationFactor(SnakeOptimizerSingle opt)  | 
double | 
getScaleFactor()
Get scaling factor. 
 | 
boolean | 
initEnergy(SnakeOptimizerSingle o)
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(SnakeOptimizerSingle o)
Update internal state of energy object prior to usaging it. 
 | 
@ALDClassParameter(label="Initial Alpha") private double alphaInitial
@ALDClassParameter(label="Parameter Updater") private MTBSnakeEnergyCD_KassLength_ParamAdapt pUpdater
private SnakeOptimizerSingle.EnergyNormalizationMode normMode
private double normalizationFactor
private Double maxAlpha
private double[] alphas
protected double scaleFactor
The factor is used to scale image coordinates between the range [0,1] and the real-world image size in pixels. Default scaling factor is 1.
public MTBSnakeEnergyCD_KassLength()
public MTBSnakeEnergyCD_KassLength(double _alpha,
                                   MTBSnakeEnergyCD_KassLength_ParamAdapt _pUpd)
_alpha - Weighting factor for length term._pUpd - Parameter update object.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 boolean initEnergy(SnakeOptimizerSingle o)
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 MTBSnakeEnergyDerivableo - Calling snake optimizer.public double getInitAlpha()
public double calcEnergy(SnakeOptimizerSingle opt)
calcEnergy in interface MTBSnakeEnergyComputableopt - Calling snake optimizer.public double calcEnergy(SnakeOptimizerSingle opt, int pos)
public Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
The upper left block and the lower right block of matrix A just dependent on the weight parameters alpha and beta for the internal snake energy terms.
getDerivative_MatrixPart in interface MTBSnakeEnergyDerivableopt - Calling snake optimizer.private double getNormalizationFactor(SnakeOptimizerSingle opt)
public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivablegetDerivative_VectorPart in interface MTBSnakeEnergyDerivableopt - Calling snake optimizer.public 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 Objectpublic void updateStatus(SnakeOptimizerSingle o)
MTBSnakeEnergyDerivableupdateStatus in interface MTBSnakeEnergyComputableupdateStatus in interface MTBSnakeEnergyDerivablepublic boolean requiresCounterClockwiseContourSorting()
MTBSnakeEnergyDerivablerequiresCounterClockwiseContourSorting in interface MTBSnakeEnergyComputablerequiresCounterClockwiseContourSorting in interface MTBSnakeEnergyDerivablepublic boolean requiresOverlapMask()
MTBSnakeEnergyDerivablerequiresOverlapMask in interface MTBSnakeEnergyComputablerequiresOverlapMask in interface MTBSnakeEnergyDerivableCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.