Class LseEvolve3

    • 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

      • 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 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,
                                              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:
        onPreUpdate in class LsePdeFilter3
      • onUpdate

        protected void onUpdate​(int iX,
                                int iY,
                                int iZ)
        The override of LsePdeFilter3.onUpdate. This is where ComputeFunction is called.
        Specified by:
        onUpdate in class LsePdeFilter3
        Parameters:
        iX - The x-coordinate of the voxel.
        iY - The y-coordinate of the voxel.
        iZ - The z-coordinate of the voxel.