Class LseSegmenter
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LseSegmenter
- Direct Known Subclasses:
LseSegGeodesicActiveContour2,LseSegGeodesicActiveContour3,LseSegShapeDetection2,LseSegShapeDetection3,LseSegThreshold2,LseSegThreshold3
The abstract base class for segmentation via level-set evolution.
- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean[]Masks to indicate which image elements are to be processed by the segmenter.protected boolean[]The mask that indicates which image elements have been included in the signed distance transform.protected float[]The image elements.protected float[]The signed distance transform computed from the coarse-level region grown by the fast marching method.protected int[]The boundary of the segmented result from region growing.protected int[]The interior of the segmented result from region growing.protected floatThe current distance for boundary pixels in the region growing involving the signed distance transform.protected floatThe maximum allowed distance for the signed distance transform.protected intThe number of image elements.protected LseFastMarchThe fast marching object used for region growing and for signed distance transforms.protected LsePdeFilterThe level-set evolver. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLseSegmenter(int iQuantity, float[] afData, boolean[] abMask) Create a new level-set segmenter object. -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginCoarse(int[] aiSeeds) The region is grown from the input seeds.booleanbeginDistanceTransform(float fMaxDistance) An annulus is computed about the boundary of the coarse-level segmentation.voidbeginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep) Evolve the signed-distance transform in the annulus constructed previously.final voidCall endCoarse when you are finished with the region growing.final voidCall endDistanceTransform when you are finished with the distance transform construction.final voidCall endEvolution when you are finished with the level-set evolution.final int[]The set of boundary points that were identified as part of the coarse-level region growing.final LseFastMarchGet the fast marching object.final int[]The set of interior points that were identified as part of the coarse-level region growing.final LsePdeFilterGet the level-set evolver object.final float[]Get the signed distance transform.final boolean[]Get the signed distance transform mask.final voidApply a single iteration of the region-growing fast march.final booleanApply a single iteration of the annulus construction.final voidApply a single iteration of the evolution.abstract voidsetDiffusionIterations(int iDIterations) Set the number of iterations to use in the nonlinear diffusion (curvature flow filter) applied to the input image.abstract voidsetGradientMagnitudeScale(float fScale) Set the scale to use in computing the blurred gradient magnitude of the curvature flow image.abstract voidsetPDEParameters(float fBorderValue, int eScaleType, float fTimeStep) Parameters for the feature image creation.abstract 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.
-
Field Details
-
m_iQuantity
protected int m_iQuantityThe number of image elements. -
m_afData
protected float[] m_afDataThe image elements. -
m_abMask
protected boolean[] m_abMaskMasks to indicate which image elements are to be processed by the segmenter. -
m_kFastMarcher
The fast marching object used for region growing and for signed distance transforms. -
m_aiInterior
protected int[] m_aiInteriorThe interior of the segmented result from region growing. -
m_aiBoundary
protected int[] m_aiBoundaryThe boundary of the segmented result from region growing. -
m_fCurrentDistance
protected float m_fCurrentDistanceThe current distance for boundary pixels in the region growing involving the signed distance transform. -
m_fMaxDistance
protected float m_fMaxDistanceThe maximum allowed distance for the signed distance transform. This is user-specified. -
m_afSignedDistance
protected float[] m_afSignedDistanceThe signed distance transform computed from the coarse-level region grown by the fast marching method. -
m_abSignedDistanceMask
protected boolean[] m_abSignedDistanceMaskThe mask that indicates which image elements have been included in the signed distance transform. -
m_kLevelSetEvolver
The level-set evolver.
-
-
Constructor Details
-
LseSegmenter
protected LseSegmenter(int iQuantity, float[] afData, boolean[] abMask) Create a new level-set segmenter object.- Parameters:
iQuantity- The number of image elements.afData- The image elements.abMask- The masks to indicate which image elements should be processed by the segmenter.
-
-
Method Details
-
setPDEParameters
public abstract 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.- 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 abstract void setDiffusionIterations(int iDIterations) Set the number of iterations to use in the nonlinear diffusion (curvature flow filter) applied to the input image.- Parameters:
iDIterations- The number of iterations.
-
setGradientMagnitudeScale
public abstract void setGradientMagnitudeScale(float fScale) Set the scale to use in computing the blurred gradient magnitude of the curvature flow image.- Parameters:
fScale- The scale for the blurred gradient magnitude image.
-
setSigmoidFilter
public abstract 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.- 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.
-
getFastMarcher
Get the fast marching object. This object is used for the coarse-level segmentation and for the signed-distance transform.- Returns:
- The fast marching object.
-
getLevelSetEvolver
Get the level-set evolver object.- Returns:
- The evolver object.
-
beginCoarse
public void beginCoarse(int[] aiSeeds) The region is grown from the input seeds. You can apply the region growing multiple times to the same image, each time starting with beginCoarse. A derived class must implement this function and call the base-class function before it does any of its specialized work.- Parameters:
aiSeeds- The initial region to grow.
-
iterateCoarse
public final void iterateCoarse()Apply a single iteration of the region-growing fast march. -
endCoarse
public final void endCoarse()Call endCoarse when you are finished with the region growing. After this call, getInterior and getBoundary may be called to examine the coarse-level segmentation. -
getInterior
public final int[] getInterior()The set of interior points that were identified as part of the coarse-level region growing.- Returns:
- An array of interior points of the grown region.
-
getBoundary
public final int[] getBoundary()The set of boundary points that were identified as part of the coarse-level region growing.- Returns:
- An array of boundary points of the grown region.
-
beginDistanceTransform
public boolean beginDistanceTransform(float fMaxDistance) 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 image-element units). The function returns 'true' if and only if the set of boundary points from the region growing is not empty. A derived class must implement this function and call the base-class function before it does any of its specialized work.- Parameters:
fMaxDistance- The maximum distance allowed in the region growing associated with the signed distance transform.- Returns:
- 'true' iff the current region has at least one boundary point.
-
iterateDistanceTransform
public final boolean iterateDistanceTransform()Apply a single iteration of the annulus construction.- Returns:
- 'true' iff there are still iterations to perform. This is the case as long as the current distance is smaller than the maximum specified distance.
-
endDistanceTransform
public final void endDistanceTransform()Call endDistanceTransform when you are finished with the distance transform construction. After this call, getSignedDistanceImage and getSignedDistanceMask may be called to examine the annulus points and signed distances. -
getSignedDistanceImage
public final float[] getSignedDistanceImage()Get the signed distance transform. These have relevant values only after a call to EndDistanceTransform. The signed distances are set to zero for image elements that are outside the annulus (masked region).- Returns:
- The array of signed distance values.
-
getSignedDistanceMask
public final boolean[] getSignedDistanceMask()Get the signed distance transform mask. These have relevant values only after a call to EndDistanceTransform. The 'true' masks indicate image elements that are part of the computed annulus.- Returns:
- The array of signed distance transform masks.
-
beginEvolution
public void beginEvolution(float fAdvectionWeight, float fPropagationWeight, float fCurvatureWeight, float fLaplacianWeight, float fTimeStep) Evolve the signed-distance transform in the annulus constructed previously. A derived class must implement this function and call the base-class function before it does any of its specialized work.- Parameters:
fAdvectionWeight- The advection weight in the PDE governing the level-set evolution in the annulus.fPropagationWeight- The propagation weight in the PDE governing the level-set evolution in the annulus.fCurvatureWeight- The curvature weight in the PDE governing the level-set evolution in the annulus.fLaplacianWeight- The Laplacian weight in the PDE governing the level-set evolution in the annulus.fTimeStep- The time step for one iteration of the numerical PDE solver.
-
iterateEvolution
public final void iterateEvolution()Apply a single iteration of the evolution. -
endEvolution
public final void endEvolution()Call endEvolution when you are finished with the level-set evolution.
-