|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDImageBased
de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDIB_Distance
@ALDDerivedClass @ALDParametrizedClass public class MTBSnakeEnergyCDIB_Distance
Class for external energy from a distance transform (distance map / field). The distance field is stored in a two-dimensional double array, where the first dimension includes the y-coordinates of the field and the second dimension hold the x-coordinates. For the distance field the user can specify the distance metric (Euclidean, Chessboard, Cityblock) and can set the foreground of the given binary image. So the external energy is defined as: extEnergy(x,y) = distField[y][x]. !!!ATTENTION!!! If the distance map should be used as external energy, the map should be calculated on the foreground. Normal distance map is calculated in the object, so we want to set the foreground as object. That means, on a black image with white objects, the foreground for the distance map must be set to white and vice versa!
DistanceTransform
Field Summary | |
---|---|
private DistanceTransform.ForegroundColor |
colorFG
|
private double[][] |
distField
The calculated 2D vector field from the distance map. |
private DistanceTransform.DistanceMetric |
distMetric
The used distance metric for the distance map calculation. |
private MTBImageByte |
inImage
|
Fields inherited from class de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDImageBased |
---|
height, normalizationFactor, normMode, scaleFactor, width |
Fields inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable |
---|
targetEnergyRange |
Constructor Summary | |
---|---|
MTBSnakeEnergyCDIB_Distance()
|
|
MTBSnakeEnergyCDIB_Distance(MTBImageByte image,
DistanceTransform.DistanceMetric d,
DistanceTransform.ForegroundColor f)
Constructor to create a new SnakeExternalEnergyDistance object. |
Method Summary | |
---|---|
double |
getDerivativeX(double x,
double y)
Get x-derivative of the distance map at given position using central differences. |
double |
getDerivativeY(double x,
double y)
Get y-derivative of the distance map at given position using central differences. |
double |
getValue(double x,
double y)
Returns the distance value from the distance map at the given position. |
boolean |
initEnergy(SnakeOptimizerSingleVarCalc o)
Init routine which is called once before the energy is actually used. |
void |
normalizeEnergy()
Normalize the external energy in a range [0.0, 1.0]. |
java.lang.String |
toString()
Get an identifier string for the energy object. |
Methods inherited from class de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDImageBased |
---|
calcEnergy, calcEnergy, getDerivative_MatrixPart, getDerivative_VectorPart, getDerivativeX_norm, getDerivativeY_norm, getScaleFactor, getValue_norm, initEnergy, setScaleFactor, updateStatus, updateStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
@ALDClassParameter(label="Foreground Color") private DistanceTransform.ForegroundColor colorFG
private double[][] distField
@ALDClassParameter(label="Distance Metric") private DistanceTransform.DistanceMetric distMetric
@ALDClassParameter(label="Input Image") private MTBImageByte inImage
Constructor Detail |
---|
public MTBSnakeEnergyCDIB_Distance() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public MTBSnakeEnergyCDIB_Distance(MTBImageByte image, DistanceTransform.DistanceMetric d, DistanceTransform.ForegroundColor f) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
image
- the given input image to calculate the external energyd
- distance metric (euclidean, cityblock, ...)f
- foreground f the image (white or black)
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
Method Detail |
---|
public double getDerivativeX(double x, double y)
getDerivativeX
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of pixel positiony
- y-coordinate of pixel position
public double getDerivativeY(double x, double y)
getDerivativeY
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of pixel positiony
- y-coordinate of pixel position
public double getValue(double x, double y)
getValue
in class MTBSnakeEnergyCDImageBased
x
- x-coordinate of positiony
- y-coordinate of position
public boolean initEnergy(SnakeOptimizerSingleVarCalc 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 MTBSnakeEnergyDerivable
initEnergy
in class MTBSnakeEnergyCDImageBased
o
- Calling snake optimizer.
public void normalizeEnergy()
normalizeEnergy
in class MTBSnakeEnergyCDImageBased
public java.lang.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 java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |