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

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

@ALDDerivedClass
@ALDParametrizedClass
public class MTBSnakeEnergyCDIB_Intensity
extends MTBSnakeEnergyCDImageBased

External snake energy based on image intensities.

The energy for a snake C is defined as follows:

%preamble{\usepackage{amssymb}}
Applying this energy a snake tends to move towards dark areas in an image, i.e. moves in the opposite direction of the local intensity gradient.

Note that this energy has only a small capture range of one or two pixels, thus, your initialization is required to be very accurate already.

Author:
Danny Misiak

Field Summary
 
Fields inherited from class de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDImageBased
height, normalizationFactor, normMode, scaleFactor, width
 
Fields inherited from interface de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyDerivable
targetEnergyRange
 
Constructor Summary
MTBSnakeEnergyCDIB_Intensity()
          Default constructor.
MTBSnakeEnergyCDIB_Intensity(MTBImage _image)
          Constructor to create a new SnakeExternalEnergyIntensity object.
 
Method Summary
 Jama.Matrix getDerivative_VectorPart(SnakeOptimizerSingleVarCalc opt)
          Returns the vector part of this energy for snake optimization.
 double getDerivativeX(double x, double y)
          Get x-derivative of external snake energy at given position using central differences.
 double getDerivativeY(double x, double y)
          Get y-derivative of external snake energy at given position using central differences.
 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.
 void normalizeEnergy()
          Normalize the external energy in a range [-1.0, 1.0].
 String toString()
          Get an identifier string for the energy object.
 
Methods inherited from class de.unihalle.informatik.MiToBo.segmentation.snakes.energies.MTBSnakeEnergyCDImageBased
calcEnergy, calcEnergy, getDerivative_MatrixPart, getDerivativeX_norm, getDerivativeY_norm, getScaleFactor, getValue_norm, requiresCounterClockwiseContourSorting, requiresOverlapMask, setScaleFactor, updateStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MTBSnakeEnergyCDIB_Intensity

public MTBSnakeEnergyCDIB_Intensity()
Default constructor.


MTBSnakeEnergyCDIB_Intensity

public MTBSnakeEnergyCDIB_Intensity(MTBImage _image)
Constructor to create a new SnakeExternalEnergyIntensity object.

Parameters:
_image - input image
Method Detail

initEnergy

public boolean initEnergy(SnakeOptimizerSingle o)
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
Overrides:
initEnergy in class MTBSnakeEnergyCDImageBased
Parameters:
o - Calling snake optimizer.
Returns:
True if init was successful, otherwise false.

getValue

public double getValue(double x,
                       double y)
Returns the value of the external energy at the given position.

Specified by:
getValue in class MTBSnakeEnergyCDImageBased
Parameters:
x - x-coordinate of position
y - y-coordinate of position
Returns:
Absolute value of external energy.

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
Overrides:
getDerivative_VectorPart in class MTBSnakeEnergyCDImageBased
Parameters:
opt - Calling snake optimizer.
Returns:
Optimization vector for this energy object.

getDerivativeX

public double getDerivativeX(double x,
                             double y)
Get x-derivative of external snake energy at given position using central differences.

Specified by:
getDerivativeX in class MTBSnakeEnergyCDImageBased
Parameters:
x - x-coordinate of pixel position
y - y-coordinate of pixel position
Returns:
x-derivative value at given position.

getDerivativeY

public double getDerivativeY(double x,
                             double y)
Get y-derivative of external snake energy at given position using central differences.

Specified by:
getDerivativeY in class MTBSnakeEnergyCDImageBased
Parameters:
x - x-coordinate of pixel position
y - y-coordinate of pixel position
Returns:
y-derivative value at given position.

normalizeEnergy

public void normalizeEnergy()
Normalize the external energy in a range [-1.0, 1.0].

Specified by:
normalizeEnergy in class MTBSnakeEnergyCDImageBased

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


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