@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCD_KassCurvature extends Object implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable
The energy is based on second 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_KassCurvature_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 |
betaInitial
Weighting factor for the curvature term, should always be > 0.
|
private double[] |
betas
Vector of point-specific beta values.
|
private Double |
maxBeta
Maximal possible value of beta.
|
private double |
normalizationFactor
Normalization factor for scaling matrix entries.
|
private SnakeOptimizerSingle.EnergyNormalizationMode |
normMode
Mode of normalization.
|
private MTBSnakeEnergyCD_KassCurvature_ParamAdapt |
pUpdater
Parameter update strategy.
|
protected double |
scaleFactor
Scaling factor for image coordinates.
|
targetEnergyRange
Constructor and Description |
---|
MTBSnakeEnergyCD_KassCurvature()
Default constructor.
|
MTBSnakeEnergyCD_KassCurvature(double _beta,
MTBSnakeEnergyCD_KassCurvature_ParamAdapt _pUpd)
Constructor with dynamic parameter updater.
|
Modifier and Type | Method and Description |
---|---|
double |
calcEnergy(SnakeOptimizerSingle opt)
Calculates normalized snake energy.
|
double |
calcEnergy(SnakeOptimizerSingle opt,
int pos)
Calculates length term of snake 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 |
getInitBeta()
Get the initial beta 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 Beta") private double betaInitial
@ALDClassParameter(label="Parameter Updater") private MTBSnakeEnergyCD_KassCurvature_ParamAdapt pUpdater
private SnakeOptimizerSingle.EnergyNormalizationMode normMode
private double normalizationFactor
private Double maxBeta
private double[] betas
protected double scaleFactor
The factor is used to rescale image coordinates to the range [0,1]. Default scaling factor is 1.
public MTBSnakeEnergyCD_KassCurvature()
public MTBSnakeEnergyCD_KassCurvature(double _beta, MTBSnakeEnergyCD_KassCurvature_ParamAdapt _pUpd)
_beta
- Weighting factor for curvature term._pUpd
- Parameter update object.public void setScaleFactor(double s)
setScaleFactor
in interface MTBSnakeEnergyComputable
setScaleFactor
in interface MTBSnakeEnergyDerivable
s
- New scaling factor.public double getScaleFactor()
getScaleFactor
in interface MTBSnakeEnergyComputable
getScaleFactor
in interface MTBSnakeEnergyDerivable
public boolean initEnergy(SnakeOptimizerSingle o)
MTBSnakeEnergyDerivable
In 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 MTBSnakeEnergyComputable
initEnergy
in interface MTBSnakeEnergyDerivable
o
- Calling snake optimizer.public double getInitBeta()
public double calcEnergy(SnakeOptimizerSingle opt)
calcEnergy
in interface MTBSnakeEnergyComputable
opt
- 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 MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.private double getNormalizationFactor(SnakeOptimizerSingle opt)
public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivable
getDerivative_VectorPart
in interface MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.public String toString()
MTBSnakeEnergyDerivable
When 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 MTBSnakeEnergyComputable
toString
in interface MTBSnakeEnergyDerivable
toString
in class Object
public void updateStatus(SnakeOptimizerSingle o)
MTBSnakeEnergyDerivable
updateStatus
in interface MTBSnakeEnergyComputable
updateStatus
in interface MTBSnakeEnergyDerivable
public boolean requiresCounterClockwiseContourSorting()
MTBSnakeEnergyDerivable
requiresCounterClockwiseContourSorting
in interface MTBSnakeEnergyComputable
requiresCounterClockwiseContourSorting
in interface MTBSnakeEnergyDerivable
public boolean requiresOverlapMask()
MTBSnakeEnergyDerivable
requiresOverlapMask
in interface MTBSnakeEnergyComputable
requiresOverlapMask
in interface MTBSnakeEnergyDerivable
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.