Class LseEvolve2

    • 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 class LsePdeFilter2
      • onUpdate

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