Class LseEvolve2
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
-
- gov.nih.mipav.model.algorithms.levelset.LsePdeFilter2
-
- gov.nih.mipav.model.algorithms.levelset.LseEvolve2
-
- Direct Known Subclasses:
LseGeodesicActiveContour2
,LseShapeDetection2
,LseThreshold2
public abstract class LseEvolve2 extends LsePdeFilter2
The abstract base class for level-set evolution of 2D images. It is based on PDEs that are solved numerically using finite-difference approximations.- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
-
Field Summary
Fields Modifier and Type Field Description protected float[][]
m_aafD2
The second-order derivatives of the current pixel.protected float[]
m_afAdvection
The advection for the current pixel.protected float[]
m_afD1
The first-order derivatives of the current pixel.protected float[]
m_afD1Bwd
Backward finite-difference approximations to the first-order derivatives of the current pixel.protected float[]
m_afD1Fwd
Forward finite-difference approximations to the first-order derivatives of the current pixel.protected float
m_fD0
The image value of the current pixel.protected float
m_fGradMagSqr
The squared magnitude of the gradient vector for the current pixel.protected LseParameters
m_kParameters
The parameters associated with level-set evolution.-
Fields inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter2
m_aabMask, m_aafDst, m_aafSrc, m_fFourthInvDxDy, m_fHalfInvDx, m_fHalfInvDy, m_fInvDx, m_fInvDxDx, m_fInvDy, m_fInvDyDy, m_fUmm, m_fUmp, m_fUmz, m_fUpm, m_fUpp, m_fUpz, m_fUzm, m_fUzp, m_fUzz, m_fXSpacing, m_fYSpacing, m_iXBound, m_iYBound
-
Fields inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
m_eScaleType, m_fBorderValue, m_fMin, m_fOffset, m_fScale, m_fTimeStep, m_iQuantity, NONE, PRESERVE_ZERO, SYMMETRIC, UNIT
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LseEvolve2(int iXBound, int iYBound, float fXSpacing, float fYSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType)
Create a new level-set evolver for 2D images.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected float[]
computeAdvection(int iX, int iY)
Override this function to implement the desired advection for your level-set evolver.protected float
computeCurvature(int iX, int iY)
Compute the product of length and curvature at the pixel (x,y).protected float
computeCurvatureSpeed(int iX, int iY)
Override this function to implement the desired curvature speed for your level-set evolver.protected float
computeFunction(int iX, int iY)
Evolution support.protected float
computeLaplacianSpeed(int iX, int iY)
Override this function to implement the desired Laplacian speed for your level-set evolver.protected float
computePropagationSpeed(int iX, int iY)
Override this function to implement the desired propagation speed for your level-set evolver.LseParameters
getParameters()
Get the current level-set evolution parameters.protected void
onPreUpdate()
The override of LsePdeFilter2.onPreUpdate.protected void
onUpdate(int iX, int iY)
The override of LsePdeFilter2.onUpdate.-
Methods inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter2
assignDirichletImageBorder, assignDirichletMaskBorder, assignNeumannImageBorder, assignNeumannMaskBorder, getMask, getU, getUx, getUxx, getUxy, getUy, getUyy, getXBound, getXSpacing, getYBound, getYSpacing, lookUp5, lookUp9, onPostUpdate, onUpdate
-
Methods inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
getBorderValue, getQuantity, getScaleType, getTimeStep, setTimeStep, update
-
-
-
-
Field Detail
-
m_kParameters
protected LseParameters m_kParameters
The parameters associated with level-set evolution.
-
m_fD0
protected float m_fD0
The image value of the current pixel.
-
m_afD1
protected float[] m_afD1
The first-order derivatives of the current pixel.
-
m_aafD2
protected float[][] m_aafD2
The second-order derivatives of the current pixel.
-
m_afD1Fwd
protected float[] m_afD1Fwd
Forward finite-difference approximations to the first-order derivatives of the current pixel.
-
m_afD1Bwd
protected float[] m_afD1Bwd
Backward finite-difference approximations to the first-order derivatives of the current pixel.
-
m_fGradMagSqr
protected float m_fGradMagSqr
The squared magnitude of the gradient vector for the current pixel.
-
m_afAdvection
protected float[] m_afAdvection
The advection for the current pixel.
-
-
Constructor Detail
-
LseEvolve2
protected LseEvolve2(int iXBound, int iYBound, float fXSpacing, float fYSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType)
Create a new level-set evolver for 2D images.- Parameters:
iXBound
- The x-bound of the image.iYBound
- The y-bound of the image.fXSpacing
- The x-spacing of the image.fYSpacing
- The y-spacing of the image.afData
- The image elements, stored in lexicographical order.abMask
- The image mask, stored in lexicographical order. A pixel value is processed by the PDE solver only when the mask value is false.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 Detail
-
getParameters
public final LseParameters getParameters()
Get the current level-set evolution parameters.- Returns:
- The current level-set evolution parameters.
-
computeFunction
protected final float computeFunction(int iX, int iY)
Evolution support. ComputeTimeStep() is called each time before ComputeFunction() is called. The function ComputeCurvature() actually computes k*L, where k is the curvature and L is the length of the gradient vector. The resulting quantity is
k*L = (Uxx*Uy*Uy - 2*Uxy*Ux*Uy + Uyy*Ux*Ux)/(Ux*Ux + Uy*Uy)
where Ux and Uy are first-order partial derivatives and Uxx, Uxy, and Uyy are second-order partial derivatives.- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The value of the right-hand side of the PDE that governs the level-set evolution.
-
computeCurvature
protected final float computeCurvature(int iX, int iY)
Compute the product of length and curvature at the pixel (x,y).- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The product of length and curvature at the pixel.
-
computeAdvection
protected float[] computeAdvection(int iX, int iY)
Override this function to implement the desired advection for your level-set evolver.- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The advection at the pixel.
-
computePropagationSpeed
protected float computePropagationSpeed(int iX, int iY)
Override this function to implement the desired propagation speed for your level-set evolver.- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The propagation speed at the pixel.
-
computeCurvatureSpeed
protected float computeCurvatureSpeed(int iX, int iY)
Override this function to implement the desired curvature speed for your level-set evolver.- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The curvature speed at the pixel.
-
computeLaplacianSpeed
protected float computeLaplacianSpeed(int iX, int iY)
Override this function to implement the desired Laplacian speed for your level-set evolver.- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.- Returns:
- The Laplacian speed at the pixel.
-
onPreUpdate
protected void onPreUpdate()
The override of LsePdeFilter2.onPreUpdate. This is where ComputeTimeStep is called.- Overrides:
onPreUpdate
in classLsePdeFilter2
-
onUpdate
protected void onUpdate(int iX, int iY)
The override of LsePdeFilter2.onUpdate. This is where ComputeFunction is called.- Specified by:
onUpdate
in classLsePdeFilter2
- Parameters:
iX
- The x-coordinate of the pixel.iY
- The y-coordinate of the pixel.
-
-