Class LseEvolve3
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
gov.nih.mipav.model.algorithms.levelset.LsePdeFilter3
gov.nih.mipav.model.algorithms.levelset.LseEvolve3
- Direct Known Subclasses:
LseGeodesicActiveContour3,LseShapeDetection3,LseThreshold3
The abstract base class for level-set evolution of 3D 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
FieldsModifier and TypeFieldDescriptionprotected float[][]The second-order derivatives of the current pixel.protected float[]The advection for the current pixel.protected float[]The first-order derivatives of the current pixel.protected float[]Backward finite-difference approximations to the first-order derivatives of the current pixel.protected float[]Forward finite-difference approximations to the first-order derivatives of the current pixel.protected floatThe image value of the current pixel.protected floatThe squared magnitude of the gradient vector for the current pixel.protected LseParametersThe parameters associated with level-set evolution.Fields inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter3
m_aaabMask, m_aaafDst, m_aaafSrc, m_fFourthInvDxDy, m_fFourthInvDxDz, m_fFourthInvDyDz, m_fHalfInvDx, m_fHalfInvDy, m_fHalfInvDz, m_fInvDx, m_fInvDxDx, m_fInvDy, m_fInvDyDy, m_fInvDz, m_fInvDzDz, m_fUmmm, m_fUmmp, m_fUmmz, m_fUmpm, m_fUmpp, m_fUmpz, m_fUmzm, m_fUmzp, m_fUmzz, m_fUpmm, m_fUpmp, m_fUpmz, m_fUppm, m_fUppp, m_fUppz, m_fUpzm, m_fUpzp, m_fUpzz, m_fUzmm, m_fUzmp, m_fUzmz, m_fUzpm, m_fUzpp, m_fUzpz, m_fUzzm, m_fUzzp, m_fUzzz, m_fXSpacing, m_fYSpacing, m_fZSpacing, m_iXBound, m_iYBound, m_iZBoundFields 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
ConstructorsModifierConstructorDescriptionprotectedLseEvolve3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType) Create a new level-set evolver for 3D images. -
Method Summary
Modifier and TypeMethodDescriptionprotected float[]computeAdvection(int iX, int iY, int iZ) Override this function to implement the desired advection for your level-set evolver.protected final floatcomputeCurvature(int iX, int iY, int iZ) Compute the product of length and mean curvature at the voxel (x,y,z).protected floatcomputeCurvatureSpeed(int iX, int iY, int iZ) Override this function to implement the desired curvature speed for your level-set evolver.protected final floatcomputeFunction(int iX, int iY, int iZ) Evolution support.protected floatcomputeLaplacianSpeed(int iX, int iY, int iZ) Override this function to implement the desired Laplacian speed for your level-set evolver.protected floatcomputePropagationSpeed(int iX, int iY, int iZ) Override this function to implement the desired propagation speed for your level-set evolver.final LseParametersGet the current level-set evolution parameters.protected voidThe override of LsePdeFilter3.onPreUpdate.protected voidonUpdate(int iX, int iY, int iZ) The override of LsePdeFilter3.onUpdate.Methods inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter3
assignDirichletImageBorder, assignDirichletMaskBorder, assignNeumannImageBorder, assignNeumannMaskBorder, getMask, getU, getUx, getUxx, getUxy, getUxz, getUy, getUyy, getUyz, getUz, getUzz, getXBound, getXSpacing, getYBound, getYSpacing, getZBound, getZSpacing, lookUp27, lookUp7, onPostUpdate, onUpdateMethods inherited from class gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
getBorderValue, getQuantity, getScaleType, getTimeStep, setTimeStep, update
-
Field Details
-
m_kParameters
The parameters associated with level-set evolution. -
m_fD0
protected float m_fD0The image value of the current pixel. -
m_afD1
protected float[] m_afD1The first-order derivatives of the current pixel. -
m_aafD2
protected float[][] m_aafD2The second-order derivatives of the current pixel. -
m_afD1Fwd
protected float[] m_afD1FwdForward finite-difference approximations to the first-order derivatives of the current pixel. -
m_afD1Bwd
protected float[] m_afD1BwdBackward finite-difference approximations to the first-order derivatives of the current pixel. -
m_fGradMagSqr
protected float m_fGradMagSqrThe squared magnitude of the gradient vector for the current pixel. -
m_afAdvection
protected float[] m_afAdvectionThe advection for the current pixel.
-
-
Constructor Details
-
LseEvolve3
protected LseEvolve3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType) Create a new level-set evolver for 3D images.- Parameters:
iXBound- The x-bound of the image.iYBound- The y-bound of the image.iZBound- The z-bound of the image.fXSpacing- The x-spacing of the image.fYSpacing- The y-spacing of the image.fZSpacing- The z-spacing of the image.afData- The image elements, stored in lexicographical order.abMask- The image mask, stored in lexicographical order. A voxel 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 Details
-
getParameters
Get the current level-set evolution parameters.- Returns:
- The current level-set evolution parameters.
-
computeFunction
protected final float computeFunction(int iX, int iY, int iZ) Evolution support. ComputeTimeStep() is called each time before ComputeFunction() is called. The function ComputeCurvature() actually computes k*L, where k is the mean curvature and L is the length of the gradient vector. The resulting quantity is
k*L = (Uxx*(Uy*Uy+Uz*Uz) + Uyy*(Ux*Ux+Uz*Uz) + Uzz*(Ux*Ux+Uy*Uy) - 2*(Uxy*Ux*Uy + Uxz*Ux*Uz + Uyz*Uy*Uz))/(Ux*Ux+Uy*Uy+Uz*Uz)
where Ux, Uy, and Uz are first-order partial derivatives and Uxx, Uxy, Uxz, Uyy, Uyz, and Uzz are second-order partial derivatives.- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- 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, int iZ) Compute the product of length and mean curvature at the voxel (x,y,z).- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- Returns:
- The product of length and curvature at the voxel.
-
computeAdvection
protected float[] computeAdvection(int iX, int iY, int iZ) Override this function to implement the desired advection for your level-set evolver.- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- Returns:
- The advection at the voxel.
-
computePropagationSpeed
protected float computePropagationSpeed(int iX, int iY, int iZ) Override this function to implement the desired propagation speed for your level-set evolver.- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- Returns:
- The propagation speed at the voxel.
-
computeCurvatureSpeed
protected float computeCurvatureSpeed(int iX, int iY, int iZ) Override this function to implement the desired curvature speed for your level-set evolver.- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- Returns:
- The curvature speed at the voxel.
-
computeLaplacianSpeed
protected float computeLaplacianSpeed(int iX, int iY, int iZ) Override this function to implement the desired Laplacian speed for your level-set evolver.- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.- Returns:
- The Laplacian speed at the voxel.
-
onPreUpdate
protected void onPreUpdate()The override of LsePdeFilter3.onPreUpdate. This is where ComputeTimeStep is called.- Overrides:
onPreUpdatein classLsePdeFilter3
-
onUpdate
protected void onUpdate(int iX, int iY, int iZ) The override of LsePdeFilter3.onUpdate. This is where ComputeFunction is called.- Specified by:
onUpdatein classLsePdeFilter3- Parameters:
iX- The x-coordinate of the voxel.iY- The y-coordinate of the voxel.iZ- The z-coordinate of the voxel.
-