Class LseSegThreshold3

java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LseSegmenter
gov.nih.mipav.model.algorithms.levelset.LseSegThreshold3

public class LseSegThreshold3 extends LseSegmenter
A segmenter for 3D images based on the PDE described in LseThreshold3.
Version:
0.1 November 7, 2006
Author:
David Eberly
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private float[]
    The blurred curvature flow image (intermediate image).
    private float[]
    The curvature flow image (intermediate image).
    private float[]
    The feature image.
    private float[]
    The gradient magnitude of the blurred curvature flow image (intermediate image).
    private int
    The scaling type of the image (default = LsePdeFilter.NONE).
    private float
    The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    private float
    The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    private float
    The border value of the image (default = Float.MAX_VALUE).
    private float
    Parameters for the threshold segmentation.
    private float
    The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    private float
    The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    private float
    The scale used for computing the blurred gradient magnitude image (default = 0).
    private float
    The time step of the PDE solver (default = 0.001).
    private float
    Parameters for the threshold segmentation.
    private float
    The x-spacing of the image.
    private float
    The y-spacing of the image.
    private float
    The z-spacing of the image.
    private int
    The number of iterations to use in the nonlinear diffusion used to create the feature image (default = 0).
    private int
    The x-bound of the image.
    private int
    The y-bound of the image.
    private int
    The z-bound of the image.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LseSegThreshold3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask)
    Create a shape-detection-based segmenter.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beginCoarse(int[] aiSeeds)
    The region-growing fast march.
    boolean
    beginDistanceTransform(float fMaxDistance)
    The signed-distance-transform fast march.
    void
    beginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep)
    The level-set evolution.
    final void
    Create the feature image using the parameters set by the four parameter-setting functions defined above.
    (package private) float[]
    Get the blurred curvature flow image.
    (package private) float[]
    Get the curvature flow image.
    (package private) float[]
    Get the feature image.
    (package private) float[]
    Get the gradient magnitude of the blurred curvature flow image.
    final void
    setDiffusionIterations(int iDIterations)
    Set the number of iterations to use in the nonlinear diffusion (curvature flow filter) applied to the input image.
    final void
    Set the scale to use in computing the blurred gradient magnitude of the curvature flow image.
    final void
    setPDEParameters(float fBorderValue, int eScaleType, float fTimeStep)
    Parameters for the feature image creation.
    final void
    setSigmoidFilter(float fAlpha, float fBeta, float fMin, float fMax)
    Set the parameters for the sigmoid function through which the blurred gradient magnitude image is processed.
    final void
    setThresholds(float fLower, float fUpper)
    The lower and upper thresholds must be set before calling beginEvolution.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_iXBound

      private int m_iXBound
      The x-bound of the image.
    • m_iYBound

      private int m_iYBound
      The y-bound of the image.
    • m_iZBound

      private int m_iZBound
      The z-bound of the image.
    • m_fXSpacing

      private float m_fXSpacing
      The x-spacing of the image.
    • m_fYSpacing

      private float m_fYSpacing
      The y-spacing of the image.
    • m_fZSpacing

      private float m_fZSpacing
      The z-spacing of the image.
    • m_fBorderValue

      private float m_fBorderValue
      The border value of the image (default = Float.MAX_VALUE).
    • m_eScaleType

      private int m_eScaleType
      The scaling type of the image (default = LsePdeFilter.NONE).
    • m_fTimeStep

      private float m_fTimeStep
      The time step of the PDE solver (default = 0.001).
    • m_iDIterations

      private int m_iDIterations
      The number of iterations to use in the nonlinear diffusion used to create the feature image (default = 0).
    • m_fScale

      private float m_fScale
      The scale used for computing the blurred gradient magnitude image (default = 0).
    • m_fAlpha

      private float m_fAlpha
      The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    • m_fBeta

      private float m_fBeta
      The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    • m_fMin

      private float m_fMin
      The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    • m_fMax

      private float m_fMax
      The default parameters used in the sigmoid function that modifies the gradient magnitude (default alpha = 1, default beta = 0, default min = 0, default max = 1).
    • m_afFeature

      private float[] m_afFeature
      The feature image.
    • m_afCurvFlow

      private float[] m_afCurvFlow
      The curvature flow image (intermediate image).
    • m_afBlurCurvFlow

      private float[] m_afBlurCurvFlow
      The blurred curvature flow image (intermediate image).
    • m_afGradMagBlurCurvFlow

      private float[] m_afGradMagBlurCurvFlow
      The gradient magnitude of the blurred curvature flow image (intermediate image).
    • m_fLower

      private float m_fLower
      Parameters for the threshold segmentation.
    • m_fUpper

      private float m_fUpper
      Parameters for the threshold segmentation.
  • Constructor Details

    • LseSegThreshold3

      public LseSegThreshold3(int iXBound, int iYBound, int iZBound, float fXSpacing, float fYSpacing, float fZSpacing, float[] afData, boolean[] abMask)
      Create a shape-detection-based segmenter.
      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.
      abMask - The image masks that determine which pixels are processed by the segmenter.
  • Method Details

    • setPDEParameters

      public final void setPDEParameters(float fBorderValue, int eScaleType, float fTimeStep)
      Parameters for the feature image creation. You may set these anytime before a sequence of fast-march iterations. The PDE filters require you to specify how to handle boundary values. If you want Dirichlet conditions (constant boundary), set BorderValue to a finite number. If you want Neumann conditions (zero-derivative boundary), set the BorderValue to Float.MAX_VALUE. If you want the original image to be scaled, choose the Type parameter appropriately. The input image is processed by a curvature-based anisotropic diffusion filter; the number of iterations is DIterations. The gradient magnitude at the specified Scale is computed for the output of the diffusion filter. The gradient magnitude is transformed to the feature image by a sigmoid function:

         feature(x) = min + (max-min)/(1 + exp(-(x-beta)/alpha))

      The inverse of the feature image values are the speeds used in the fast marching algorithm.
      Specified by:
      setPDEParameters in class LseSegmenter
      Parameters:
      fBorderValue - The border value to use when processing boundary pixels.
      eScaleType - The scaling type for the image.
      fTimeStep - The time step for the PDE solver.
    • setDiffusionIterations

      public final void setDiffusionIterations(int iDIterations)
      Set the number of iterations to use in the nonlinear diffusion (curvature flow filter) applied to the input image.
      Specified by:
      setDiffusionIterations in class LseSegmenter
      Parameters:
      iDIterations - The number of iterations.
    • setGradientMagnitudeScale

      public final void setGradientMagnitudeScale(float fScale)
      Set the scale to use in computing the blurred gradient magnitude of the curvature flow image.
      Specified by:
      setGradientMagnitudeScale in class LseSegmenter
      Parameters:
      fScale - The scale for the blurred gradient magnitude image.
    • setSigmoidFilter

      public final void setSigmoidFilter(float fAlpha, float fBeta, float fMin, float fMax)
      Set the parameters for the sigmoid function through which the blurred gradient magnitude image is processed.
      Specified by:
      setSigmoidFilter in class LseSegmenter
      Parameters:
      fAlpha - The variance of the function.
      fBeta - The center of the function.
      fMin - The minimum of the function.
      fMax - The maximum of the function.
    • createFeatureImage

      public final void createFeatureImage()
      Create the feature image using the parameters set by the four parameter-setting functions defined above. Since the quality of the segmentation depends on these parameters, createFeatureImage() allows you to experiment with the parameters before you start the segmentation.
    • getFeatureImage

      float[] getFeatureImage()
      Get the feature image. The result is relevant only after a call to computeFeatureImage or beginCoarse.
      Returns:
      The feature image.
    • getCurvFlowImage

      float[] getCurvFlowImage()
      Get the curvature flow image. The result is relevant only after a call to computeFeatureImage or beginCoarse.
      Returns:
      The curvature flow image.
    • getBlurCurvFlowImage

      float[] getBlurCurvFlowImage()
      Get the blurred curvature flow image. The result is relevant only after a call to computeFeatureImage or beginCoarse.
      Returns:
      The blurred curvature flow image.
    • getGradMagBlurCurvFlowImage

      float[] getGradMagBlurCurvFlowImage()
      Get the gradient magnitude of the blurred curvature flow image. The result is relevant only after a call to computeFeatureImage or beginCoarse.
      Returns:
      The gradient magnitude of the blurred curvature flow image.
    • beginCoarse

      public void beginCoarse(int[] aiSeeds)
      The region-growing fast march. When you call beginCoarse(), the current parameters are used (DIterations, scale, alpha, beta, min, max). You can apply the fast marching algorithm multiple times to the same image, each time starting with beginCoarse();
      Overrides:
      beginCoarse in class LseSegmenter
      Parameters:
      aiSeeds - The initial region to grow.
    • beginDistanceTransform

      public boolean beginDistanceTransform(float fMaxDistance)
      The signed-distance-transform fast march. An annulus is computed about the boundary of the coarse-level segmentation. The maximum distance from annulus points to the boundary is the input to this function (in voxel units).
      Overrides:
      beginDistanceTransform in class LseSegmenter
      Parameters:
      fMaxDistance - The maximum distance to allow when computing the signed distance transform.
      Returns:
      'true' iff more iterations are allowed
    • setThresholds

      public final void setThresholds(float fLower, float fUpper)
      The lower and upper thresholds must be set before calling beginEvolution.
      Parameters:
      fLower - The lower threshold for propagation P(x) in the PDE.
      fUpper - The upper threshold for propagation P(x) in the PDE.
    • beginEvolution

      public void beginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep)
      The level-set evolution.
      Overrides:
      beginEvolution in class LseSegmenter
      Parameters:
      fAdvectionWeight - The advection coefficient 'a' in the PDE that controls the evolution.
      fPropagationWeight - The propagation coefficient 'b' in the PDE that controls the evolution.
      fCurvatureWeight - The curvature coefficient 'c' in the PDE that controls the evolution.
      fLaplacianWeight - The Laplacian coefficient 'd' in the PDE that controls the evolution.
      fTimeStep - The time step for the PDE solver.