Class LseFastMarch2
- java.lang.Object
-
- gov.nih.mipav.model.algorithms.levelset.LseFastMarch
-
- gov.nih.mipav.model.algorithms.levelset.LseFastMarch2
-
public class LseFastMarch2 extends LseFastMarch
The fast-marching method for 2D images. This is based on material from J. Sethian's book, Level Set Methods and Fast Marching Methods.- Version:
- 0.1 November 7, 2006
- Author:
- David Eberly
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_iXBm1XBm1 = XBound - 1protected intm_iXBoundThe x-bound of the image, call it XBound.protected intm_iYBm1YBm1 = YBound - 1protected intm_iYBoundThe y-bound of the image, call it YBound.-
Fields inherited from class gov.nih.mipav.model.algorithms.levelset.LseFastMarch
m_afInvSpeed, m_afTime, m_akTrial, m_fMaxTime, m_fMinTime, m_iQuantity, m_kHeap
-
-
Constructor Summary
Constructors Constructor Description LseFastMarch2(int iXBound, int iYBound, float[] afSpeed, int[] aiSeeds)Create a new fast marching object for a 2D image.LseFastMarch2(int iXBound, int iYBound, float fSpeed, int[] aiSeeds)Create a new fast marching object for a 2D image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcomputeTime(int i)Compute the visitation time for an image element.int[]getBoundary()Get the indices of the boundary points of the current region.intgetXBound()Get the x-bound for the image.intgetYBound()Get the y-bound for the image.intindex(int iX, int iY)Compute the 1-dimensional index for the pixel (x,y).protected voidinitialize(int iXBound, int iYBound)Initialization of the 2D fast marching object.booleanisBoundary(int i)An image element is a boundary point when it is on the boundary of the current region.voiditerate()Run one iteration of the fast marching algorithm.-
Methods inherited from class gov.nih.mipav.model.algorithms.levelset.LseFastMarch
computeTimeExtremes, getInterior, getMaxTime, getMinTime, getQuantity, getTime, initialize, initializeSpeed, initializeSpeed, isFar, isInterior, isTrial, isValid, isZeroSpeed, setTime
-
-
-
-
Constructor Detail
-
LseFastMarch2
public LseFastMarch2(int iXBound, int iYBound, float[] afSpeed, int[] aiSeeds)Create a new fast marching object for a 2D image.- Parameters:
iXBound- The x-bound of the image.iYBound- The y-bound of the image.afSpeed- The speeds of the image elements.aiSeeds- The initial region points.
-
LseFastMarch2
public LseFastMarch2(int iXBound, int iYBound, float fSpeed, int[] aiSeeds)Create a new fast marching object for a 2D image.- Parameters:
iXBound- The x-bound of the image.iYBound- The y-bound of the image.fSpeed- The common speed of the image elements.aiSeeds- The initial region points.
-
-
Method Detail
-
getXBound
public final int getXBound()
Get the x-bound for the image.- Returns:
- The x-bound for the image.
-
getYBound
public final int getYBound()
Get the y-bound for the image.- Returns:
- The y-bound for the image.
-
index
public final int index(int iX, int iY)Compute the 1-dimensional index for the pixel (x,y).- Parameters:
iX- The x-coordinate of the pixel.iY- The y-coordinate of the pixel.- Returns:
- The 1-dimensional index for the pixel.
-
getBoundary
public int[] getBoundary()
Get the indices of the boundary points of the current region.- Specified by:
getBoundaryin classLseFastMarch- Returns:
- The array of indices of the boundary points.
-
isBoundary
public boolean isBoundary(int i)
An image element is a boundary point when it is on the boundary of the current region.- Specified by:
isBoundaryin classLseFastMarch- Parameters:
i- The index of the image element.- Returns:
- The Boolean result indicating whether or not the image element is a boundary point.
-
iterate
public void iterate()
Run one iteration of the fast marching algorithm.- Specified by:
iteratein classLseFastMarch
-
initialize
protected void initialize(int iXBound, int iYBound)Initialization of the 2D fast marching object.- 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.
-
computeTime
protected void computeTime(int i)
Compute the visitation time for an image element. In most cases, the time is a root to a quadratic equation that is derived from the finite-difference method used to propagate the region boundary using the inverse speeds.- Parameters:
i- The index of the image element.
-
-