|
||||||||||
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
@ALDParametrizedClass public abstract class MTBSnakeEnergyCDImageBased
Interface class for snake energies that are purely image-based.
This class is used by the snake optimizer. Pure image-based energies are energies that just evaluate the energy gradient at single image positions. Examples are intensity gradient, GVFs and so on. On updating the snake optimizer target functional they usually just modify the constant vector and not the linear matrix. All energies of this type share the common property that derivatives can be calculated quite easy and straight-forward which discriminates them from more complex snake energies.
Field Summary | |
---|---|
protected int |
height
Height of the given image for the energy. |
protected double |
normalizationFactor
Normalization factor for scaling matrix entries. |
protected SnakeOptimizerSingle.EnergyNormalizationMode |
normMode
Mode of normalization. |
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. |
protected int |
width
Width of the given image for the energy. |
Fields inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable |
---|
targetEnergyRange |
Constructor Summary | |
---|---|
MTBSnakeEnergyCDImageBased()
|
Method Summary | |
---|---|
double |
calcEnergy(SnakeOptimizerSingle opt)
Calculates the energy of the current snake. |
double |
calcEnergy(SnakeOptimizerSingle opt,
int pointID)
Calculates energy at a certain snake point. |
Jama.Matrix |
getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Returns the linear matrix part of this energy for snake optimization. |
Jama.Matrix |
getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
Returns the vector part of this energy for snake optimization. |
double |
getDerivativeX_norm(double x,
double y)
Get x-derivative of external snake energy at given position on a normalizes image coordinates in range [width*scale, height*scale]. |
abstract double |
getDerivativeX(double x,
double y)
Get x-derivative of external snake energy at given position. |
double |
getDerivativeY_norm(double x,
double y)
Get y-derivative of external snake energy at given position on a normalizes image coordinates in range [width*scale, height*scale]. |
abstract double |
getDerivativeY(double x,
double y)
Get y-derivative of external snake energy at given position. |
double |
getScaleFactor()
Get scaling factor. |
double |
getValue_norm(double x,
double y)
Returns the value of the external energy at the given position on a normalizes image coordinates in range [width*scale, height*scale]. |
abstract 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. |
protected abstract void |
normalizeEnergy()
Normalize the external energy in a range [-1.0, 1.0]. |
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. |
void |
updateStatus(SnakeOptimizerSingle o)
Update internal state of energy object prior to usaging it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable |
---|
toString |
Methods inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyComputable |
---|
toString |
Field Detail |
---|
protected int width
protected int height
protected double scaleFactor
protected SnakeOptimizerSingle.EnergyNormalizationMode normMode
protected double normalizationFactor
Constructor Detail |
---|
public MTBSnakeEnergyCDImageBased()
Method Detail |
---|
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 final Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivable
getDerivative_MatrixPart
in interface MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.
public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
MTBSnakeEnergyDerivable
getDerivative_VectorPart
in interface MTBSnakeEnergyDerivable
opt
- Calling snake optimizer.
public double calcEnergy(SnakeOptimizerSingle opt)
MTBSnakeEnergyComputable
calcEnergy
in interface MTBSnakeEnergyComputable
opt
- Calling snake optimizer.
public double calcEnergy(SnakeOptimizerSingle opt, int pointID)
opt
- Snake optimizer.pointID
- Point ID where to calculate local energy.
public double getValue_norm(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of position
public double getDerivativeX_norm(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of position
public double getDerivativeY_norm(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of position
public abstract double getValue(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of position
public abstract double getDerivativeX(double x, double y)
x
- x-coordinate of pixel positiony
- y-coordinate of pixel position
public abstract double getDerivativeY(double x, double y)
x
- x-coordinate of pixel positiony
- y-coordinate of pixel position
protected abstract void normalizeEnergy()
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |