Class LseFastMarch2
java.lang.Object
gov.nih.mipav.model.algorithms.levelset.LseFastMarch
gov.nih.mipav.model.algorithms.levelset.LseFastMarch2
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
FieldsModifier and TypeFieldDescriptionprotected intXBm1 = XBound - 1protected intThe x-bound of the image, call it XBound.protected intYBm1 = YBound - 1protected intThe 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
ConstructorsConstructorDescriptionLseFastMarch2(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
Modifier and TypeMethodDescriptionprotected voidcomputeTime(int i) Compute the visitation time for an image element.int[]Get the indices of the boundary points of the current region.final intGet the x-bound for the image.final intGet the y-bound for the image.final 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
-
Field Details
-
m_iXBound
protected int m_iXBoundThe x-bound of the image, call it XBound. -
m_iYBound
protected int m_iYBoundThe y-bound of the image, call it YBound. -
m_iXBm1
protected int m_iXBm1XBm1 = XBound - 1 -
m_iYBm1
protected int m_iYBm1YBm1 = YBound - 1
-
-
Constructor Details
-
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 Details
-
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.
-