@ALDParametrizedClass public abstract class MTBSnakeEnergyCDImageBased extends Object implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable
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.
Modifier and Type | Field and Description |
---|---|
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.
|
targetEnergyRange
Constructor and Description |
---|
MTBSnakeEnergyCDImageBased() |
Modifier and Type | Method and Description |
---|---|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toString
toString
protected int width
protected int height
protected double scaleFactor
protected SnakeOptimizerSingle.EnergyNormalizationMode normMode
protected double normalizationFactor
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 positionpublic double getDerivativeX_norm(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of positionpublic double getDerivativeY_norm(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of positionpublic abstract double getValue(double x, double y)
x
- x-coordinate of positiony
- y-coordinate of positionpublic abstract double getDerivativeX(double x, double y)
x
- x-coordinate of pixel positiony
- y-coordinate of pixel positionpublic abstract double getDerivativeY(double x, double y)
x
- x-coordinate of pixel positiony
- y-coordinate of pixel positionprotected 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
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.