de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE
Class MTBCVFittingEnergyNonPDE

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBGenericEnergyNonPDE
      extended by de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBCVFittingEnergyNonPDE

@ALDParametrizedClass
@ALDDerivedClass
public class MTBCVFittingEnergyNonPDE
extends MTBGenericEnergyNonPDE

A class to implement the fitting term of the Chan-Vese energy for level sets using a non PDE approach to optimization. The level set function may be two or multi phase.

Author:
Stefan Posch, based on code by Markus Glass

Field Summary
 
Fields inherited from class de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBGenericEnergyNonPDE
debug, name
 
Constructor Summary
MTBCVFittingEnergyNonPDE()
          Construct an energy object for the level set function phi realizing the fitting term of the Chan-Vese energy.
MTBCVFittingEnergyNonPDE(double lambdaBg, double lambdaFg)
          Construct an energy object realizing the fitting term of the Chan-Vese energy.
MTBCVFittingEnergyNonPDE(MTBImage img, MTBLevelsetMembership phi, double lambdaBg, double lambdaFg)
          Construct an energy object with the initial level set function phi realizing the fitting term of the Chan-Vese energy to segment img.
 
Method Summary
 double deltaE(int x, int y, int z, byte newPhase, MTBLevelsetMembership phi)
          Calculate differences of energy if the pixel/voxel (x,y,z) is changed from its current phase in the level set function phi supplied from current phase to newPhase.
 double deltaE(int x, int y, int z, MTBLevelsetMembership phi)
          Calculate differences of energy if the pixel/voxel (x,y,z) changes its phase in the levelest function phi supplied as argument and assumed to be associated with this energy object.
 double E(MTBLevelsetMembership phi)
          Return the complete energy for the level set function phi.
protected  void estimateParams(MTBLevelsetMembership phi)
          Estimate internal parameters (if any) for the level set function phi assumed to be associated with this energy object.
 MTBGenericEnergyNonPDE init(MTBImage img, MTBLevelsetMembership phi)
          Initialize the energy object.
 void print(MTBLevelsetMembership phi, PrintStream out, String indent)
          Print this energy object - including the value of the energy for phi assumed to be associated with this energy object.
 String toString()
          Return an ascii representation identifying the energy and internal parameters, but not the state.
 void updateParams(int x, int y, int z, byte newPhase, MTBLevelsetMembership phi)
          Update parameters (if any) of the energy object which depend on the associated level set function.
 void updateParams(int x, int y, int z, MTBLevelsetMembership phi)
          Update parameters (if any) of the energy object which depend on the associated level set function.
 
Methods inherited from class de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBGenericEnergyNonPDE
getNewIndent, setDebug
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MTBCVFittingEnergyNonPDE

public MTBCVFittingEnergyNonPDE()
Construct an energy object for the level set function phi realizing the fitting term of the Chan-Vese energy.


MTBCVFittingEnergyNonPDE

public MTBCVFittingEnergyNonPDE(double lambdaBg,
                                double lambdaFg)
Construct an energy object realizing the fitting term of the Chan-Vese energy. The weight for the background is lambdaBg and for all for all object phases an identically lambdaFg.

Parameters:
lambdaBg - Weight for background phase
lambdaFg - Weight for foreground phase

MTBCVFittingEnergyNonPDE

public MTBCVFittingEnergyNonPDE(MTBImage img,
                                MTBLevelsetMembership phi,
                                double lambdaBg,
                                double lambdaFg)
Construct an energy object with the initial level set function phi realizing the fitting term of the Chan-Vese energy to segment img. The weight for the background is lambdaBg and for all for all object phases an identically lambdaFg.

Parameters:
img - Image to be segmented
phi - Level set function to construct the energy object for
lambdaBg - Weight for background phase
lambdaFg - Weight for foreground phase
Method Detail

init

public MTBGenericEnergyNonPDE init(MTBImage img,
                                   MTBLevelsetMembership phi)
Initialize the energy object.

NOTE: The image provided as argument to this method is only associated with the energy object, if not already set!! This rational behind this is to allow the energy to be supplied generically with the input image and while it is still possible to set an image deviating from this default.

Overrides:
init in class MTBGenericEnergyNonPDE
Parameters:
img - Image to be segmented
phi - Level set function to construct the energy object for
Returns:
The modified or a new energy if initialization was successful, otherwise null.

deltaE

public double deltaE(int x,
                     int y,
                     int z,
                     MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Calculate differences of energy if the pixel/voxel (x,y,z) changes its phase in the levelest function phi supplied as argument and assumed to be associated with this energy object.

This version makes sense only for two phase level set function. In the multi phase case any object phase is changed to the background, while a background pixel/voxel is changed to the first object phase.

Overrides:
deltaE in class MTBGenericEnergyNonPDE
phi - level set function assumed to be associated with this energy object
Returns:
difference of energy

deltaE

public double deltaE(int x,
                     int y,
                     int z,
                     byte newPhase,
                     MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Calculate differences of energy if the pixel/voxel (x,y,z) is changed from its current phase in the level set function phi supplied from current phase to newPhase.

Specified by:
deltaE in class MTBGenericEnergyNonPDE
newPhase - new phase to change the pixel/voxel to
phi - level set function assumed to be associated with this energy object
Returns:
difference of energy

E

public double E(MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Return the complete energy for the level set function phi.
Note: this may be an expensive operation.

Specified by:
E in class MTBGenericEnergyNonPDE
Parameters:
phi - level set function assumed to be associated with this energy object
Returns:
energy

updateParams

public void updateParams(int x,
                         int y,
                         int z,
                         MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Update parameters (if any) of the energy object which depend on the associated level set function.

This method is called to update the parameters if is is intended to change a pixel/voxel to the other state, assuming a two phase level set function. For a multi phase level set function flipping of phases is realized in MTBGenericEnergyNonPDE.deltaE(int, int, int, byte, de.unihalle.informatik.MiToBo.segmentation.levelset.nonPDE.MTBLevelsetMembership).

Note: The level set function phi is still in the old state and is assumed to be to updated subsequently.

Overrides:
updateParams in class MTBGenericEnergyNonPDE
phi - assumed to be associated with this energy object

updateParams

public void updateParams(int x,
                         int y,
                         int z,
                         byte newPhase,
                         MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Update parameters (if any) of the energy object which depend on the associated level set function.

This method is called to update the parameters if is is intended to change the phase of a pixel/voxel to newPhase.

Note: The level set function phi is still in the old state and is assumed to be to updated subsequently.

Overrides:
updateParams in class MTBGenericEnergyNonPDE
newPhase - new phase to change pixel/voxel to
phi - assumed to be associated with this energy object

estimateParams

protected void estimateParams(MTBLevelsetMembership phi)
Description copied from class: MTBGenericEnergyNonPDE
Estimate internal parameters (if any) for the level set function phi assumed to be associated with this energy object.

Overrides:
estimateParams in class MTBGenericEnergyNonPDE

toString

public String toString()
Description copied from class: MTBGenericEnergyNonPDE
Return an ascii representation identifying the energy and internal parameters, but not the state.

Specified by:
toString in class MTBGenericEnergyNonPDE

print

public void print(MTBLevelsetMembership phi,
                  PrintStream out,
                  String indent)
Description copied from class: MTBGenericEnergyNonPDE
Print this energy object - including the value of the energy for phi assumed to be associated with this energy object. Each line output is prefixed with the string indent. Note: this may be an expensive operation.

Overrides:
print in class MTBGenericEnergyNonPDE
Parameters:
phi - level set function assumed to be associated with this energy object
out - stream to print to
indent - indentation string


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