de.unihalle.informatik.MiToBo.segmentation.snakes.energies
Class MTBSnakeEnergyCD_OverlapPenalty

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCD_OverlapPenalty
All Implemented Interfaces:
MTBActiveContourEnergyDerivable, MTBSnakeEnergyComputable, MTBSnakeEnergyDerivable

@ALDDerivedClass
@ALDParametrizedClass
public class MTBSnakeEnergyCD_OverlapPenalty
extends java.lang.Object
implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable

Snake energy to avoid overlap of multiple snakes.

Author:
moeller

Field Summary
protected  double maxEnergyVal
          Maxmimum value of energy, dependent on number of snakes and rho.
private  double rho
          Weighting factor and overlap penalty, respectively.
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 snakeNum
          Number of snakes to be optimized.
 
Fields inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable
targetEnergyRange
 
Constructor Summary
MTBSnakeEnergyCD_OverlapPenalty()
          Default constructor.
MTBSnakeEnergyCD_OverlapPenalty(double _rho, int snakes)
          Default constructor.
 
Method Summary
 double calcEnergy(SnakeOptimizerSingle opt)
          Calculates the energy of the current snake.
 Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
          Updates the region coupling energy term in matrix A.
 Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
          Returns the vector part of this energy for snake optimization.
 double getScaleFactor()
          Get scaling factor.
 boolean initEnergy(SnakeOptimizerSingleGreedy opt)
          Init routine which is called once before the energy is actually used.
 boolean initEnergy(SnakeOptimizerSingleVarCalc opt)
          Init routine which is called once before the energy is actually used.
 void setScaleFactor(double s)
          Set the scaling factor.
 java.lang.String toString()
          Get an identifier string for the energy object.
 void updateStatus(SnakeOptimizerSingleGreedy o)
          Update internal state of energy object prior to querying derivatives and so on.
 void updateStatus(SnakeOptimizerSingleVarCalc 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, wait, wait, wait
 

Field Detail

maxEnergyVal

protected transient double maxEnergyVal
Maxmimum value of energy, dependent on number of snakes and rho.


rho

@ALDClassParameter(label="Weighting Parameter")
private double rho
Weighting factor and overlap penalty, respectively.


scaleFactor

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. Default scaling factor is 1.


snakeNum

protected transient int snakeNum
Number of snakes to be optimized.

Constructor Detail

MTBSnakeEnergyCD_OverlapPenalty

public MTBSnakeEnergyCD_OverlapPenalty()
Default constructor.


MTBSnakeEnergyCD_OverlapPenalty

public MTBSnakeEnergyCD_OverlapPenalty(double _rho,
                                       int snakes)
Default constructor.

Parameters:
_rho - Overlap penalty coefficient.
Method Detail

calcEnergy

public double calcEnergy(SnakeOptimizerSingle opt)
Description copied from interface: MTBSnakeEnergyComputable
Calculates the energy of the current snake.

Specified by:
calcEnergy in interface MTBSnakeEnergyComputable
Parameters:
opt - Calling snake optimizer.
Returns:
Energy of complete snake.

getDerivative_MatrixPart

public Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Updates the region coupling energy term in matrix A.

Specified by:
getDerivative_MatrixPart in interface MTBSnakeEnergyDerivable
Parameters:
opt - Calling snake optimizer.
Returns:
Optimization matrix for this energy object.

getDerivative_VectorPart

public Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
Description copied from interface: MTBSnakeEnergyDerivable
Returns the vector part of this energy for snake optimization.

Specified by:
getDerivative_VectorPart in interface MTBSnakeEnergyDerivable
Parameters:
opt - Calling snake optimizer.
Returns:
Optimization vector for this energy object.

getScaleFactor

public double getScaleFactor()
Get scaling factor.

Specified by:
getScaleFactor in interface MTBSnakeEnergyComputable
Specified by:
getScaleFactor in interface MTBSnakeEnergyDerivable
Returns:
Scaling factor.

initEnergy

public boolean initEnergy(SnakeOptimizerSingleGreedy opt)
Description copied from interface: MTBSnakeEnergyComputable
Init routine which is called once before the energy is actually used.

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.

Specified by:
initEnergy in interface MTBSnakeEnergyComputable
Parameters:
opt - Calling snake optimizer.
Returns:
true if init was successful

initEnergy

public boolean initEnergy(SnakeOptimizerSingleVarCalc opt)
Description copied from interface: MTBSnakeEnergyDerivable
Init routine which is called once before the energy is actually used.

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.

Specified by:
initEnergy in interface MTBSnakeEnergyDerivable
Parameters:
opt - Calling snake optimizer.
Returns:
True if init was successful, otherwise false.

setScaleFactor

public void setScaleFactor(double s)
Set the scaling factor.

Specified by:
setScaleFactor in interface MTBSnakeEnergyComputable
Specified by:
setScaleFactor in interface MTBSnakeEnergyDerivable
Parameters:
s - new scaling factor.

toString

public java.lang.String toString()
Description copied from interface: MTBSnakeEnergyDerivable
Get an identifier string for the energy object.

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.

Specified by:
toString in interface MTBSnakeEnergyComputable
Specified by:
toString in interface MTBSnakeEnergyDerivable
Overrides:
toString in class java.lang.Object
Returns:
Identifier string.

updateStatus

public void updateStatus(SnakeOptimizerSingleGreedy o)
Description copied from interface: MTBSnakeEnergyComputable
Update internal state of energy object prior to querying derivatives and so on.

Specified by:
updateStatus in interface MTBSnakeEnergyComputable

updateStatus

public void updateStatus(SnakeOptimizerSingleVarCalc o)
Description copied from interface: MTBSnakeEnergyDerivable
Update internal state of energy object prior to usaging it.

Specified by:
updateStatus in interface MTBSnakeEnergyDerivable