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

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.segmentation.activecontours.energies.MTBActiveContourEnergy_CVRegionFit
      extended by de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCD_CVRegionFit
All Implemented Interfaces:
MTBActiveContourEnergy, MTBActiveContourEnergyDerivable, MTBSnakeEnergyComputable, MTBSnakeEnergyCoupled, MTBSnakeEnergyDerivable

@ALDDerivedClass
@ALDParametrizedClass
public class MTBSnakeEnergyCD_CVRegionFit
extends MTBActiveContourEnergy_CVRegionFit
implements MTBSnakeEnergyDerivable, MTBSnakeEnergyComputable, MTBSnakeEnergyCoupled

Snake energy based on Chan-Vese region fitting.

This energy models the inner and outer regions of a snake by a Gaussian model, i.e. each region is specified by a mean intensity value and deviations from this value are penalized.

The energy can also be used in joint optimization of multiple snakes. In this case the energy over all N snakes is defined as follows:

%preamble{\usepackage{amssymb}}

Paper:

Author:
moeller
See Also:
MTBActiveContourEnergy_CVRegionFit

Field Summary
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.
 
Fields inherited from class de.unihalle.informatik.MiToBo.segmentation.activecontours.energies.MTBActiveContourEnergy_CVRegionFit
areas, inImg, lambda_in, lambda_out, means, means_compl
 
Fields inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable
targetEnergyRange
 
Constructor Summary
MTBSnakeEnergyCD_CVRegionFit()
          Default constructor.
MTBSnakeEnergyCD_CVRegionFit(MTBImage im, double lin, double lout)
          Default constructor.
 
Method Summary
 double calcEnergy(SnakeOptimizerSingle opt)
          Calculates the energy of the current snake.
protected  double calcExteriorMean()
          Calculates the average intensity in the background of the segmentation.
 Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
          Updates the fitting term based on new region average values.
 Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
          Returns the vector part of this energy for snake optimization.
 double getScaleFactor()
          Get scaling factor.
 boolean initEnergy(SnakeOptimizerCoupled opt)
          Init routine which is called once before the energy is actually used.
 boolean initEnergy(SnakeOptimizerSingle opt)
          Init routine which is called once before the energy is actually used.
 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.
 String toString()
          Get an identifier string for the energy object.
 void updateStatus(SnakeOptimizerCoupled opt)
          Update internal state of energy object prior to querying derivatives and so on.
 void updateStatus(SnakeOptimizerSingle opt)
          Update internal state of energy object prior to usaging it.
 
Methods inherited from class de.unihalle.informatik.MiToBo.segmentation.activecontours.energies.MTBActiveContourEnergy_CVRegionFit
calcEnergy, calcInteriorEnergy, getDerivative, getEnergyDerivativeMaxVal, getEnergyDerivativeMinVal, getMeans, init, updateParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

normMode

protected SnakeOptimizerSingle.EnergyNormalizationMode normMode
Mode of normalization.


scaleFactor

protected transient 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.

Constructor Detail

MTBSnakeEnergyCD_CVRegionFit

public MTBSnakeEnergyCD_CVRegionFit()
Default constructor.


MTBSnakeEnergyCD_CVRegionFit

public MTBSnakeEnergyCD_CVRegionFit(MTBImage im,
                                    double lin,
                                    double lout)
Default constructor.

Parameters:
im - Image to work on.
l_in - Weighting factor for inner region fit.
l_out - Weighting factor for outer region fit.
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
ALDProcessingDAGException
Method Detail

initEnergy

public boolean initEnergy(SnakeOptimizerCoupled opt)
                   throws MTBSnakeException
Description copied from interface: MTBSnakeEnergyCoupled
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. Snake optimizers are supposed to call this routine once before they 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 MTBSnakeEnergyCoupled
Parameters:
opt - Calling snake optimizer.
Returns:
true if init was successful
Throws:
MTBSnakeException

initEnergy

public boolean initEnergy(SnakeOptimizerSingle opt)
                   throws MTBSnakeException
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 MTBSnakeEnergyComputable
Specified by:
initEnergy in interface MTBSnakeEnergyDerivable
Parameters:
opt - Calling snake optimizer.
Returns:
True if init was successful, otherwise false.
Throws:
MTBSnakeException

updateStatus

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

Specified by:
updateStatus in interface MTBSnakeEnergyCoupled

updateStatus

public void updateStatus(SnakeOptimizerSingle opt)
                  throws MTBSnakeException
Description copied from interface: MTBSnakeEnergyDerivable
Update internal state of energy object prior to usaging it.

Specified by:
updateStatus in interface MTBSnakeEnergyComputable
Specified by:
updateStatus in interface MTBSnakeEnergyDerivable
Throws:
MTBSnakeException

getDerivative_MatrixPart

public Jama.Matrix getDerivative_MatrixPart(SnakeOptimizerSingleVarCalc opt)
Updates the fitting term based on new region average values.

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.

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.

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.

getScaleFactor

public double getScaleFactor()
Get scaling factor.

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

toString

public 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 MTBActiveContourEnergy_CVRegionFit
Returns:
Identifier string.

requiresCounterClockwiseContourSorting

public boolean requiresCounterClockwiseContourSorting()
Description copied from interface: MTBSnakeEnergyDerivable
Ask energy if contour points need to sorted counter-clockwise.

Specified by:
requiresCounterClockwiseContourSorting in interface MTBSnakeEnergyComputable
Specified by:
requiresCounterClockwiseContourSorting in interface MTBSnakeEnergyCoupled
Specified by:
requiresCounterClockwiseContourSorting in interface MTBSnakeEnergyDerivable
Returns:
If true, counter-clockwise sorting is expected.

requiresOverlapMask

public boolean requiresOverlapMask()
Description copied from interface: MTBSnakeEnergyDerivable
Ask energy if an overlap mask for all snakes jointly optimized is required.

Specified by:
requiresOverlapMask in interface MTBSnakeEnergyComputable
Specified by:
requiresOverlapMask in interface MTBSnakeEnergyCoupled
Specified by:
requiresOverlapMask in interface MTBSnakeEnergyDerivable
Returns:
If true, the energy expects an overlap mask to be available.

calcExteriorMean

protected double calcExteriorMean()
Calculates the average intensity in the background of the segmentation.

The background is defined as all image positions where no snake is present.

Parameters:
overlapMask - Overlap mask of current segmentation.
Returns:
Average intensity in background.


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.