Class LsePdeFilter
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
- Direct Known Subclasses:
LsePdeFilter2,LsePdeFilter3
The abstract base class for finite-difference-based solvers for partial
differential equations. This system exists to support level-set evolution
for image segmentation.
- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe type of image scaling used during filter construction.protected floatWhen set to Float.MAX_VALUE, Neumann conditions are in use (zero-valued derivatives on the image border).protected floatThe minimum image value.protected floatThe offset used in scaling the image data.protected floatThe scale factor used in scaling the image data.protected floatThe time step for the PDE solver.protected intThe number of image elements.static final intScale type: no scaling.static final intScale type: max > -min: d' = d/max in [min/max,1] max invalid input: '<' -min: d' = -d/min in [-1,-max/min]static final intScale type: d' = -1 + 2*(d-min)/(max-min) in [-1,1]static final intScale type: d' = (d-min)/(max-min) in [0,1] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLsePdeFilter(int iQuantity, float[] afData, float fBorderValue, int eScaleType) Creates a new PDE filter object. -
Method Summary
Modifier and TypeMethodDescriptionfinal floatGet the image border value.final intGet the number of image elements.final intGet the type of image scaling.final floatGet the time step for the PDE solver.protected abstract voidAn abstract function that allows derived classes to implement any desired behavior after the PDE solver applies its update function.protected abstract voidAn abstract function that allows derived classes to implement any desired behavior before the PDE solver applies its update function.protected abstract voidonUpdate()An abstract function for the update function of the PDE solver.final voidsetTimeStep(float fTimeStep) Set the time step for the PDE solver.voidupdate()The entry point to updating the PDE solver.
-
Field Details
-
NONE
public static final int NONEScale type: no scaling.- See Also:
-
UNIT
public static final int UNITScale type: d' = (d-min)/(max-min) in [0,1]- See Also:
-
SYMMETRIC
public static final int SYMMETRICScale type: d' = -1 + 2*(d-min)/(max-min) in [-1,1]- See Also:
-
PRESERVE_ZERO
public static final int PRESERVE_ZEROScale type: max > -min: d' = d/max in [min/max,1] max invalid input: '<' -min: d' = -d/min in [-1,-max/min]- See Also:
-
m_iQuantity
protected int m_iQuantityThe number of image elements. -
m_fBorderValue
protected float m_fBorderValueWhen set to Float.MAX_VALUE, Neumann conditions are in use (zero-valued derivatives on the image border). Dirichlet conditions are used, otherwise (image is constant on the border). -
m_eScaleType
protected int m_eScaleTypeThe type of image scaling used during filter construction. -
m_fMin
protected float m_fMinThe minimum image value. -
m_fOffset
protected float m_fOffsetThe offset used in scaling the image data. -
m_fScale
protected float m_fScaleThe scale factor used in scaling the image data. -
m_fTimeStep
protected float m_fTimeStepThe time step for the PDE solver. The stability of an algorithm depends on the magnitude of the time step but the magnitude itself depends on the algorithm.
-
-
Constructor Details
-
LsePdeFilter
protected LsePdeFilter(int iQuantity, float[] afData, float fBorderValue, int eScaleType) Creates a new PDE filter object.- Parameters:
iQuantity- The number of image elements.afData- The image elements, stored in lexicographical order.fBorderValue- Specifies how to handle the image value. When set to Float.MAX_VALUE, Neumann conditions are in use, in which case zero-valued derivatives are assumed on the image border. Otherwise, Dirichlet conditions are used, in which case the image is assumed to be constant on the border with value specified by fBorderValue.eScaleType- The type of scaling to apply to the input image. The choices are NONE, UNIT, SYMMETRIC, or PRESERVE_ZERO.
-
-
Method Details
-
getQuantity
public final int getQuantity()Get the number of image elements.- Returns:
- The number of image elements.
-
getBorderValue
public final float getBorderValue()Get the image border value.- Returns:
- The image border value.
-
getScaleType
public final int getScaleType()Get the type of image scaling.- Returns:
- The type of image scaling.
-
setTimeStep
public final void setTimeStep(float fTimeStep) Set the time step for the PDE solver.- Parameters:
fTimeStep- The time step for the PDE solver. It must be a positive number. Its maximum-allowed size depends on the specific algorithm.
-
getTimeStep
public final float getTimeStep()Get the time step for the PDE solver.- Returns:
- The time step for the PDE solver.
-
update
public void update()The entry point to updating the PDE solver. This function calls OnPreUpdate, OnUpdate, and OnPostUpdate, in that order. -
onPreUpdate
protected abstract void onPreUpdate()An abstract function that allows derived classes to implement any desired behavior before the PDE solver applies its update function. The derived classes for 2D and 3D implement this to recompute the boundary values when Neumann conditions are used. If derived classes built on top of the 2D or 3D classes implement this also, they must call the base-class OnPreUpdate first. -
onUpdate
protected abstract void onUpdate()An abstract function for the update function of the PDE solver. The derived classes for 2D and 3D implement this to iterate over the image elements, updating an element only if it is not masked out. -
onPostUpdate
protected abstract void onPostUpdate()An abstract function that allows derived classes to implement any desired behavior after the PDE solver applies its update function. The derived classes for 2D and 3D implement this to swap the buffers for the next pass. If derived classes built on top of the 2D or 3D classes implement this also, they must call the base-class OnPostUpdate last.
-