Class LseGradientAnisotropic3
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LsePdeFilter
gov.nih.mipav.model.algorithms.levelset.LsePdeFilter3
gov.nih.mipav.model.algorithms.levelset.LseGradientAnisotropic3
This class implements the gradient anistropic curvature flow
filter for 3D images using a finite-difference-based solver for the
partial differential equation:
du/dt = divergence(exp(-0.5*|grad(u)|^2/(k^2*average(|grad(u)|^2))*grad(u))
where u(x,y,z,t) is the evolved image at time t, du/dt is the time
derivative of u, and grad(u) is the gradient of u with respect to the
spatial variables. The value k is a used-selected parameter and may be
thought of as a local curvature parameter. The notation
divergence(Q) = Q0_x + Q1_y + Q2_z, the sum of first-order derivatives of
the vector-valued function Q = (Q0,Q1).
- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatThe local curvature parameter, call it k.private float-0.5/(k^2*average(|grad(u)|^2))private float1/(k^2*average(|grad(u)|^2))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
ConstructorsConstructorDescriptionLseGradientAnisotropic3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType, float fK) Creates a new LseCurvatureFlow3 object. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCompute the average gradient magnitude squared for the current image u(x,y,t).protected voidThe function onPreUpdate was abstractly defined in the LsePdeFilter base class.protected voidonUpdate(int iX, int iY, int iZ) The per-voxel update function of the PDE solver.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_fK
private float m_fKThe local curvature parameter, call it k. -
m_fParam
private float m_fParam1/(k^2*average(|grad(u)|^2)) -
m_fMHalfParam
private float m_fMHalfParam-0.5/(k^2*average(|grad(u)|^2))
-
-
Constructor Details
-
LseGradientAnisotropic3
public LseGradientAnisotropic3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask, float fBorderValue, int eScaleType, float fK) Creates a new LseCurvatureFlow3 object.- 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 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.fK- The local curvature parameter in the exponential term of the PDE.
-
-
Method Details
-
computeParam
protected void computeParam()Compute the average gradient magnitude squared for the current image u(x,y,t). The terms p = 1/(k*k*average(|grad(u)|^2) and -0.5*p are computed once and used in the per-pixel update in the PDE solver. -
onPreUpdate
protected void onPreUpdate()The function onPreUpdate was abstractly defined in the LsePdeFilter base class. It is called before any per-pixel updates. In this class, the parameters in the exponential term of the PDE are precomputed for use by the onUpdate() function.- Overrides:
onPreUpdatein classLsePdeFilter3
-
onUpdate
protected void onUpdate(int iX, int iY, int iZ) The per-voxel update function of the PDE solver.- Specified by:
onUpdatein classLsePdeFilter3- Parameters:
iX- The x-value of the voxel to be updated.iY- The y-value of the voxel to be updated.iZ- The z-value of the voxel to be updated.
-