@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCDIB_GVF2D extends MTBSnakeEnergyCDImageBased
GVFFieldCalculator2D
Modifier and Type | Field and Description |
---|---|
private double[] |
energyPotential
Potential field reconstructed from GVF.
|
(package private) MTBVectorField2D |
gvf
The resulting gradient vector flow field.
|
private MTBImage |
image |
private int |
numIterations |
height, normalizationFactor, normMode, scaleFactor, width
targetEnergyRange
Constructor and Description |
---|
MTBSnakeEnergyCDIB_GVF2D()
Default constructor.
|
MTBSnakeEnergyCDIB_GVF2D(MTBImage _image,
int _numIterations)
Constructor to create a new SnakeExternalEnergyGVF2D object.
|
Modifier and Type | Method and Description |
---|---|
double |
getDerivativeX(double x,
double y)
Get x-derivative of external snake energy at given position.
|
double |
getDerivativeY(double x,
double y)
Get y-derivative of external snake energy at given position.
|
MTBVectorField2D |
getGVF()
Get the calculated Gradient Vector Flow field.
|
double[] |
getPotential()
Get the energy potential field from this external energy.
|
double |
getValue(double x,
double y)
Returns the value of the external energy at the given position.
|
boolean |
initEnergy(SnakeOptimizerSingle o)
Init routine which is called once before the energy is actually used.
|
void |
normalizeEnergy()
Normalization of the GVF field.
!!!
|
void |
saveExtEnergy(String file)
Save the gvf field in a MATLAB like file.
|
String |
toString()
Get an identifier string for the energy object.
|
calcEnergy, calcEnergy, getDerivative_MatrixPart, getDerivative_VectorPart, getDerivativeX_norm, getDerivativeY_norm, getScaleFactor, getValue_norm, requiresCounterClockwiseContourSorting, requiresOverlapMask, setScaleFactor, updateStatus
@ALDClassParameter(label="Input Image") private MTBImage image
@ALDClassParameter(label="Number of Iterations") private int numIterations
MTBVectorField2D gvf
private double[] energyPotential
public MTBSnakeEnergyCDIB_GVF2D()
public MTBSnakeEnergyCDIB_GVF2D(MTBImage _image, int _numIterations)
image
- input image for calculating the gvf fieldnumIterations
- number of iterations used for calculating the gvf fieldpublic 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
initEnergy
in class MTBSnakeEnergyCDImageBased
o
- Calling snake optimizer.public MTBVectorField2D getGVF()
public double[] getPotential()
public double getValue(double x, double y)
In case of GVFs the external energy is given by a potential field reconstructed from the given GVF. Since the potential reconstruction yields only approximate results, the energy values should be interpreted as a more or less good approximation to the real potential.
The potential is normalized so that the minimum equals 0.
getValue
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of position.y
- y-coordinate of position.public double getDerivativeX(double x, double y)
getDerivativeX
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of pixel positiony
- y-coordinate of pixel positionpublic double getDerivativeY(double x, double y)
getDerivativeY
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of pixel positiony
- y-coordinate of pixel positionpublic void saveExtEnergy(String file)
file
- complete path to the file which should be savedpublic void normalizeEnergy()
Normalization of the GVF field. !!! ATTENTION: the GVF field is normalized in range [-1.0, 1.0] !!! Independent of the given lower or upper bound values, because the gradient can be negative.
normalizeEnergy
in class MTBSnakeEnergyCDImageBased
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
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
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.