Class LseSegGeodesicActiveContour2
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LseSegmenter
gov.nih.mipav.model.algorithms.levelset.LseSegGeodesicActiveContour2
A segmenter for 2D images based on the PDE described in
LseGeodesicActiveContour2.
- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 float[][]The negative of the gradient of the image is used for advection.private intThe scaling type of the image (default = LsePdeFilter.NONE).private floatThe 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 floatThe 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 floatThe border value of the image (default = Float.MAX_VALUE).private floatThe 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 floatThe 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 floatThe scale used for computing the blurred gradient magnitude image (default = 0).private floatThe time step of the PDE solver (default = 0.001).private floatThe x-spacing of the image.private floatThe y-spacing of the image.private intThe number of iterations to use in the nonlinear diffusion used to create the feature image (default = 0).private intThe x-bound of the image.private intThe y-bound of the image.Fields inherited from class gov.nih.mipav.model.algorithms.levelset.LseSegmenter
m_abMask, m_abSignedDistanceMask, m_afData, m_afSignedDistance, m_aiBoundary, m_aiInterior, m_fCurrentDistance, m_fMaxDistance, m_iQuantity, m_kFastMarcher, m_kLevelSetEvolver -
Constructor Summary
ConstructorsConstructorDescriptionLseSegGeodesicActiveContour2(int iXBound, int iYBound, float fXSpacing, float fYSpacing, float[] afData, boolean[] abMask) Create a geodesic-active-contour-based segmenter. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginCoarse(int[] aiSeeds) The region-growing fast march.booleanbeginDistanceTransform(float fMaxDistance) The signed-distance-transform fast march.voidbeginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep) The level-set evolution.voidCreate 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.(package private) float[][]Get the negative of the gradient.final voidsetDiffusionIterations(int iDIterations) Set the number of iterations to use in the nonlinear diffusion (curvature flow filter) applied to the input image.final voidsetGradientMagnitudeScale(float fScale) Set the scale to use in computing the blurred gradient magnitude of the curvature flow image.final voidsetPDEParameters(float fBorderValue, int eScaleType, float fTimeStep) Parameters for the feature image creation.final voidsetSigmoidFilter(float fAlpha, float fBeta, float fMin, float fMax) Set the parameters for the sigmoid function through which the blurred gradient magnitude image is processed.Methods inherited from class gov.nih.mipav.model.algorithms.levelset.LseSegmenter
endCoarse, endDistanceTransform, endEvolution, getBoundary, getFastMarcher, getInterior, getLevelSetEvolver, getSignedDistanceImage, getSignedDistanceMask, iterateCoarse, iterateDistanceTransform, iterateEvolution
-
Field Details
-
m_iXBound
private int m_iXBoundThe x-bound of the image. -
m_iYBound
private int m_iYBoundThe y-bound of the image. -
m_fXSpacing
private float m_fXSpacingThe x-spacing of the image. -
m_fYSpacing
private float m_fYSpacingThe y-spacing of the image. -
m_fBorderValue
private float m_fBorderValueThe border value of the image (default = Float.MAX_VALUE). -
m_eScaleType
private int m_eScaleTypeThe scaling type of the image (default = LsePdeFilter.NONE). -
m_fTimeStep
private float m_fTimeStepThe time step of the PDE solver (default = 0.001). -
m_iDIterations
private int m_iDIterationsThe number of iterations to use in the nonlinear diffusion used to create the feature image (default = 0). -
m_fScale
private float m_fScaleThe scale used for computing the blurred gradient magnitude image (default = 0). -
m_fAlpha
private float m_fAlphaThe 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_fBetaThe 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_fMinThe 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_fMaxThe 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_afFeatureThe feature image. -
m_afCurvFlow
private float[] m_afCurvFlowThe curvature flow image (intermediate image). -
m_afBlurCurvFlow
private float[] m_afBlurCurvFlowThe blurred curvature flow image (intermediate image). -
m_afGradMagBlurCurvFlow
private float[] m_afGradMagBlurCurvFlowThe gradient magnitude of the blurred curvature flow image (intermediate image). -
m_akNegGradient
private float[][] m_akNegGradientThe negative of the gradient of the image is used for advection.
-
-
Constructor Details
-
LseSegGeodesicActiveContour2
public LseSegGeodesicActiveContour2(int iXBound, int iYBound, float fXSpacing, float fYSpacing, float[] afData, boolean[] abMask) Create a geodesic-active-contour-based segmenter.- 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.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:
setPDEParametersin classLseSegmenter- 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:
setDiffusionIterationsin classLseSegmenter- 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:
setGradientMagnitudeScalein classLseSegmenter- 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:
setSigmoidFilterin classLseSegmenter- 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 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.
-
getNegGradientImage
float[][] getNegGradientImage()Get the negative of the gradient. 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:
beginCoarsein classLseSegmenter- 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 pixel units).- Overrides:
beginDistanceTransformin classLseSegmenter- Parameters:
fMaxDistance- The maximum distance to allow when computing the signed distance transform.- Returns:
- 'true' iff more iterations are allowed
-
beginEvolution
public void beginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep) The level-set evolution.- Overrides:
beginEvolutionin classLseSegmenter- 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.
-