Package gov.nih.mipav.model.algorithms
Class AlgorithmObjectExtractor
java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmObjectExtractor
- All Implemented Interfaces:
AlgorithmInterface,ActionListener,WindowListener,Runnable,EventListener
A class for segmenting objects. The algorithm is partially based on the paper:
BET: Brain Extraction Tool
Stephen M. Smith
FMRIB Technical Report TR00SMS2
Oxford Centre for Functional Magnetic Resonance Imaging of the Brain
See the document BrainExtraction.pdf for a detailed description of the algorithm as implemented in this class. A few modifications to the original algorithm were made.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classA representation of an edge for the vertex-edge-triangle table.private classAn unordered set of 'int' stored in an array.Nested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float[]DOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!private int[]DOCUMENT ME!private float[]DOCUMENT ME!private ModelImageDOCUMENT ME!private intDOCUMENT ME!protected float[]DOCUMENT ME!protected float[]The 3D MRI image stored as a 1D array.protected float[]DOCUMENT ME!protected int[]DOCUMENT ME!protected byte[]object mask creation.protected AlgorithmObjectExtractor.UnorderedSetInt[]DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Vector3f[]DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Vector3f[]DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Vector3f[]DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Vector3f[]DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Vector3f[]DOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatupdate parameters.protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatDOCUMENT ME!protected floatThe size of a voxel, in voxel units.protected floatThe size of a voxel, in voxel units.protected floatThe size of a voxel, in voxel units.protected intDOCUMENT ME!protected intDOCUMENT ME!protected intDOCUMENT ME!protected intThe MRI image bounds and quantity of voxels.protected intDOCUMENT ME!protected intmesh data.protected intThe MRI image bounds and quantity of voxels.protected intThe MRI image bounds and quantity of voxels.protected intThe MRI image bounds and quantity of voxels.protected WildMagic.LibFoundation.Mathematics.Vector3finitial ellipsoid parameters.protected HashMap<AlgorithmObjectExtractor.Edge, Integer> DOCUMENT ME!protected WildMagic.LibFoundation.Mathematics.Matrix3fDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private floatDOCUMENT ME!private booleanDOCUMENT ME!private float[]private booleanDOCUMENT ME!private float[]DOCUMENT ME!protected WildMagic.LibGraphics.SceneGraph.TriMeshDOCUMENT ME!private float[]DOCUMENT ME!private VOIDOCUMENT ME!private float[]DOCUMENT ME!private float[]DOCUMENT ME!Fields inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
destFlag, destImage, image25D, mask, maxProgressValue, minProgressValue, multiThreadingEnabled, nthreads, progress, progressModulus, progressStep, runningInSeparateThread, separable, srcImage, threadStoppedFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionAlgorithmObjectExtractor(ModelImage srcImg, VOI voi, boolean justInit, boolean saveGVF, WildMagic.LibGraphics.SceneGraph.TriMesh triMesh, float[] uVal, float[] vVal, float[] wVal) Create an extractor for segmenting an object from an image. -
Method Summary
Modifier and TypeMethodDescriptionvoidalgorithmPerformed(AlgorithmBase algorithm) Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).private voidDOCUMENT ME!private voidCalculate GVF from 3D image buffer.protected voidCompute the average length of all the edges in the triangle mesh.protected voidLet V[i] be a vertex in the triangle mesh.protected voidCompute the vertex normals of the triangle mesh.protected voidApproximate the brain surface by an ellipsoid.voidThe segmentation function.voidfinalize()Prepares this class for destruction.protected voidfloodFill(int iX, int iY, int iZ) Identify voxels enclosed by the brain surface by using a flood fill.protected voidTessellate a unit sphere centered at the origin.final intGet the dilation size for dilating the voxelized object surface obtained by rasterizing the triangle mesh.protected final intgetIndex(int iX, int iY, int iZ) A convenience function for mapping the 3D voxel position (iX,iY,iZ) to a 1D array index.protected voidIdentify all voxels that are inside or on the mesh that represents the brain surface.protected intgetIntersectX(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iY, int iZ) Compute the point of intersection between a line (0,iY,iZ)+t(1,0,0) and the triangle defined by the three input points.protected intgetIntersectY(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iX, int iZ) Compute the point of intersection between a line (iX,0,iZ)+t(0,1,0) and the triangle defined by the three input points.protected intgetIntersectZ(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iX, int iY) Compute the point of intersection between a line (iX,iY,0)+t(0,0,1) and the triangle defined by the three input points.final byte[]Get the 3D image that represents the extracted object.final floatGet the spacing along the vertex normal rays, as described in BrainExtraction.pdf, that is part of the image term in the surface evolution.final floatSet the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final floatSet the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final floatSet the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final floatSet the stiffness of the mesh, as described in BrainExtraction.pdf, that is part of the surface normal term in the surface evolution.final floatgetTriLinear(float x, float y, float z, float[] buffer) DOCUMENT ME!voidStarts the program.protected voidsaveMesh(boolean flip) Internal support to write vertices, normals, and connectivity indices to the file.final voidsetDilationSize(int iDMax) Set the dilation size for dilating the voxelized object surface obtained by rasterizing the triangle mesh.final voidsetJustIntial(boolean flag) Indicates if surface evolution should be skipped.final voidsetRayDelta(float fRayDelta) Set the spacing along the vertex normal rays, as described in BrainExtraction.pdf, that is part of the image term in the surface evolution.final voidsetReductionX(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final voidsetReductionY(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final voidsetReductionZ(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf.final voidsetStiffness(float fStiffness) Set the stiffness of the mesh, as described in BrainExtraction.pdf, that is part of the surface normal term in the surface evolution.protected floatupdate2(int i) Compute the coefficient of the surface normal for the update of the mesh vertex V[i] in the SNormal[i] direction.protected voidupdate3(int i) Compute the coefficient of the vertex normal for the update of the mesh vertex V[i] in the VNormal[i] direction.voidThe heart of the segmentation.Methods inherited from class gov.nih.mipav.model.algorithms.AlgorithmBase
actionPerformed, addListener, addProgressChangeListener, calculateImageSize, calculatePrincipleAxis, computeElapsedTime, computeElapsedTime, convertIntoFloat, delinkProgressToAlgorithm, delinkProgressToAlgorithmMulti, displayError, errorCleanUp, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, fireProgressStateChanged, generateProgressValues, getDestImage, getElapsedTime, getMask, getMaxProgressValue, getMinProgressValue, getNumberOfThreads, getProgress, getProgressChangeListener, getProgressChangeListeners, getProgressModulus, getProgressStep, getProgressValues, getSrcImage, isCompleted, isImage25D, isMultiThreadingEnabled, isRunningInSeparateThread, isThreadStopped, linkProgressToAlgorithm, linkProgressToAlgorithm, makeProgress, notifyListeners, removeListener, removeProgressChangeListener, run, setCompleted, setImage25D, setMask, setMaxProgressValue, setMinProgressValue, setMultiThreadingEnabled, setNumberOfThreads, setProgress, setProgressModulus, setProgressStep, setProgressValues, setProgressValues, setRunningInSeparateThread, setSrcImage, setStartTime, setThreadStopped, startMethod, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
c1Factor
protected float c1FactorDOCUMENT ME! -
c3Factor
protected float c3FactorDOCUMENT ME! -
m_afCurvature
protected float[] m_afCurvatureDOCUMENT ME! -
m_afImage
protected float[] m_afImageThe 3D MRI image stored as a 1D array. The mapping from (x,y,z) to 1D is: index = x + xbound*(y + ybound*z). -
m_afLength
protected float[] m_afLengthDOCUMENT ME! -
m_aiConnect
protected int[] m_aiConnectDOCUMENT ME! -
m_aiMask
protected byte[] m_aiMaskobject mask creation. -
m_akAdjacent
DOCUMENT ME! -
m_akSNormal
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akSNormalDOCUMENT ME! -
m_akSTangent
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akSTangentDOCUMENT ME! -
m_akVertex
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akVertexDOCUMENT ME! -
m_akVMean
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akVMeanDOCUMENT ME! -
m_akVNormal
protected WildMagic.LibFoundation.Mathematics.Vector3f[] m_akVNormalDOCUMENT ME! -
m_fEParam
protected float m_fEParamDOCUMENT ME! -
m_fFParam
protected float m_fFParamDOCUMENT ME! -
m_fMeanEdgeLength
protected float m_fMeanEdgeLengthupdate parameters. -
m_fRayDelta
protected float m_fRayDeltaDOCUMENT ME! -
m_fReductionX
protected float m_fReductionXDOCUMENT ME! -
m_fReductionY
protected float m_fReductionYDOCUMENT ME! -
m_fReductionZ
protected float m_fReductionZDOCUMENT ME! -
m_fStiffness
protected float m_fStiffnessDOCUMENT ME! -
m_fXDelta
protected float m_fXDeltaThe size of a voxel, in voxel units. -
m_fYDelta
protected float m_fYDeltaThe size of a voxel, in voxel units. -
m_fZDelta
protected float m_fZDeltaThe size of a voxel, in voxel units. -
m_iDMax
protected int m_iDMaxDOCUMENT ME! -
m_iEQuantity
protected int m_iEQuantityDOCUMENT ME! -
m_iMedianIntensity
protected int m_iMedianIntensityDOCUMENT ME! -
m_iTQuantity
protected int m_iTQuantityDOCUMENT ME! -
m_iVQuantity
protected int m_iVQuantitymesh data. -
m_iXBound
protected int m_iXBoundThe MRI image bounds and quantity of voxels. -
m_iYBound
protected int m_iYBoundThe MRI image bounds and quantity of voxels. -
m_iZBound
protected int m_iZBoundThe MRI image bounds and quantity of voxels. -
m_iQuantity
protected int m_iQuantityThe MRI image bounds and quantity of voxels. -
m_kCenter
protected WildMagic.LibFoundation.Mathematics.Vector3f m_kCenterinitial ellipsoid parameters. -
m_kEMap
DOCUMENT ME! -
m_kRotate
protected WildMagic.LibFoundation.Mathematics.Matrix3f m_kRotateDOCUMENT ME! -
triMesh
protected WildMagic.LibGraphics.SceneGraph.TriMesh triMeshDOCUMENT ME! -
box
private float[] boxDOCUMENT ME! -
direction
private int[] directionDOCUMENT ME! -
gvfBuffer
private float[] gvfBufferDOCUMENT ME! -
image
DOCUMENT ME! -
iSubdivisions
private int iSubdivisionsDOCUMENT ME! -
oldUVal
private float oldUValDOCUMENT ME! -
oldVVal
private float oldVValDOCUMENT ME! -
oldWVal
private float oldWValDOCUMENT ME! -
onlyInit
private boolean onlyInitDOCUMENT ME! -
saveGVF
private boolean saveGVFDOCUMENT ME! -
startLocation
private float[] startLocationDOCUMENT ME! -
uVal
private float[] uValDOCUMENT ME! -
voi
DOCUMENT ME! -
vVal
private float[] vValDOCUMENT ME! -
wVal
private float[] wValDOCUMENT ME! -
outputBuffer
private float[] outputBuffer
-
-
Constructor Details
-
AlgorithmObjectExtractor
public AlgorithmObjectExtractor(ModelImage srcImg, VOI voi, boolean justInit, boolean saveGVF, WildMagic.LibGraphics.SceneGraph.TriMesh triMesh, float[] uVal, float[] vVal, float[] wVal) Create an extractor for segmenting an object from an image.- Parameters:
srcImg- the source image.voi- initial voi used to estimate the inital ellipsoidjustInit- if true just perform one iterationsaveGVF- if true save uvf, vvf, and wvf filestriMesh- if not null use mesh instead of voiuVal- x component of GVF fieldvVal- y component of GVF fieldwVal- z component of GVF field
-
-
Method Details
-
extractObject
public void extractObject()The segmentation function. Various parameters may be modified, if necessary, before the call. -
finalize
public void finalize()Prepares this class for destruction.- Overrides:
finalizein classAlgorithmBase
-
getDilationSize
public final int getDilationSize()Get the dilation size for dilating the voxelized object surface obtained by rasterizing the triangle mesh. The rasterization is designed so that the voxel surface has no holes, thereby allowing it to be flood-filled. But just in case numerical round-off errors cause a few holes, this parameter is exposed for public use. The default value is 0 (no dilation). If the value is D > 0, the dilation mask is a cube of size (2*D+1)x(2*D+1)x(2*D+1).- Returns:
- the current dilation size
-
getObjectMask
public final byte[] getObjectMask()Get the 3D image that represents the extracted object. The image is ternary and has the same dimensions as the input MRI. A voxel value of 0 indicates background. A voxel value of 1 indicates object surface. A voxel value of 2 indicates a voxel inside the object surface.- Returns:
- the image that represents the extracted object
-
getRayDelta
public final float getRayDelta()Get the spacing along the vertex normal rays, as described in BrainExtraction.pdf, that is part of the image term in the surface evolution. The default value is 1.0.- Returns:
- the current spacing
-
getReductionX
public final float getReductionX()Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.75.- Returns:
- the current reduction factor
-
getReductionY
public final float getReductionY()Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.75.- Returns:
- the current reduction factor
-
getReductionZ
public final float getReductionZ()Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.75.- Returns:
- the current reduction factor
-
getStiffness
public final float getStiffness()Set the stiffness of the mesh, as described in BrainExtraction.pdf, that is part of the surface normal term in the surface evolution. The default value is 0.1.- Returns:
- the current stiffness
-
getTriLinear
public final float getTriLinear(float x, float y, float z, float[] buffer) DOCUMENT ME!- Parameters:
x- DOCUMENT ME!y- DOCUMENT ME!z- DOCUMENT ME!buffer- DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
runAlgorithm
public void runAlgorithm()Starts the program.- Specified by:
runAlgorithmin classAlgorithmBase
-
setDilationSize
public final void setDilationSize(int iDMax) Set the dilation size for dilating the voxelized object surface obtained by rasterizing the triangle mesh. The rasterization is designed so that the voxel surface has no holes, thereby allowing it to be flood-filled. But just in case numerical round-off errors cause a few holes, this parameter is exposed for public use. The default value is 0 (no dilation). If the value is D > 0, the dilation mask is a cube of size (2*D+1)x(2*D+1)x(2*D+1).- Parameters:
iDMax- the new dilation size
-
setJustIntial
public final void setJustIntial(boolean flag) Indicates if surface evolution should be skipped. This is helpful when determining if the initial ellipsoid is a good estimate.- Parameters:
flag- whether the surface evolution should be skipped
-
setRayDelta
public final void setRayDelta(float fRayDelta) Set the spacing along the vertex normal rays, as described in BrainExtraction.pdf, that is part of the image term in the surface evolution. The default value is 1.0.- Parameters:
fRayDelta- the new spacing along the vertex normal rays
-
setReductionX
public final void setReductionX(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.6.- Parameters:
fReduction- the amount to reduce the axis of the ellipsoid.
-
setReductionY
public final void setReductionY(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.5.- Parameters:
fReduction- the amount to reduce the axis of the ellipsoid.
-
setReductionZ
public final void setReductionZ(float fReduction) Set the reduction factor for estimating the initial ellipsoid, as described in BrainExtraction.pdf. The default value is 0.6.- Parameters:
fReduction- the amount to reduce the axis of the ellipsoid.
-
setStiffness
public final void setStiffness(float fStiffness) Set the stiffness of the mesh, as described in BrainExtraction.pdf, that is part of the surface normal term in the surface evolution. The default value is 0.1.- Parameters:
fStiffness- the new stiffness
-
updateMesh
public void updateMesh()The heart of the segmentation. This function is responsible for the evolution of the triangle mesh that approximates the object surface. The update has a tangential component, a surface normal component, and a vertex normal component for each vertex in the mesh. The first two components control the geometry of the mesh. The last component is based on the MRI data itself. See BrainExtraction.pdf for a detailed description of the update terms. -
computeMeanEdgeLength
protected void computeMeanEdgeLength()Compute the average length of all the edges in the triangle mesh. -
computeVertexInformation
protected void computeVertexInformation()Let V[i] be a vertex in the triangle mesh. This function computes VMean[i], the average of the immediate neighbors of V[i]. Define S[i] = VMean[i] - V[i]. The function also computes a surface normal SNormal[i], the component of S[i] in the vertex normal direction. STangent[i] = S[i] - SNormal[i] is computed as an approximation to a tangent to the surface. Finally, Curvature[i] is an approximation of the surface curvature at V[i]. -
computeVertexNormals
protected void computeVertexNormals()Compute the vertex normals of the triangle mesh. Each vertex normal is the unitized average of the non-unit triangle normals for those triangles sharing the vertex. -
estimateEllipsoid
protected void estimateEllipsoid()Approximate the brain surface by an ellipsoid. The approximation is based on locating all voxels of intensity larger than a brightness threshold and that are part of the upper-half of the head. The idea is that the scalp voxels in the upper-half form lie approximately on an ellipsoidal surface.
NOTE. The assumption is that the traversal from bottom to top of head is in the y-direction of the 3D image. It does not matter if the top of the head has y-values smaller/larger than those for the bottom of the head. If this assumption is not met, the image should be permuted OR this code must be modified to attempt to recognize the orientation of the head
-
floodFill
protected void floodFill(int iX, int iY, int iZ) Identify voxels enclosed by the brain surface by using a flood fill. The flood fill is nonrecursive to avoid overflowing the program stack.- Parameters:
iX- the x-value of the seed point for the filliY- the y-value of the seed point for the filliZ- the z-value of the seed point for the fill
-
generateEllipsoidMesh
protected void generateEllipsoidMesh()Tessellate a unit sphere centered at the origin. Start with an octahedron and subdivide. The final mesh is then affinely mapped to the initial ellipsoid produced by estimateEllipsoid(). The subdivision scheme is described in BrainExtraction.pdf. -
getIndex
protected final int getIndex(int iX, int iY, int iZ) A convenience function for mapping the 3D voxel position (iX,iY,iZ) to a 1D array index. The images are stored as 1D arrays, so this function is used frequently.- Parameters:
iX- the x-value of the voxel positioniY- the y-value of the voxel positioniZ- the z-value of the voxel position- Returns:
- the 1D array index corresponding to (iX,iY,iZ)
-
getInsideVoxels
protected void getInsideVoxels()Identify all voxels that are inside or on the mesh that represents the brain surface. The surface voxels are constructed by rasterizing the triangles of the mesh in 3D. The centroid of these voxels is used as a seed point for a flood fill of the region enclosed by the surface. -
getIntersectX
protected int getIntersectX(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iY, int iZ) Compute the point of intersection between a line (0,iY,iZ)+t(1,0,0) and the triangle defined by the three input points. All calculations are in voxel coordinates and the x-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiY- the y-value of the origin of the lineiZ- the z-value of the origin of the line- Returns:
- the x-value of the intersection
-
getIntersectY
protected int getIntersectY(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iX, int iZ) Compute the point of intersection between a line (iX,0,iZ)+t(0,1,0) and the triangle defined by the three input points. All calculations are in voxel coordinates and the y-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiX- the x-value of the origin of the lineiZ- the z-value of the origin of the line- Returns:
- the y-value of the intersection
-
getIntersectZ
protected int getIntersectZ(WildMagic.LibFoundation.Mathematics.Vector3f kV0, WildMagic.LibFoundation.Mathematics.Vector3f kV1, WildMagic.LibFoundation.Mathematics.Vector3f kV2, int iX, int iY) Compute the point of intersection between a line (iX,iY,0)+t(0,0,1) and the triangle defined by the three input points. All calculations are in voxel coordinates and the z-value of the intersection point is truncated to an integer.- Parameters:
kV0- a 3D vertex of the trianglekV1- a 3D vertex of the trianglekV2- a 3D vertex of the triangleiX- the x-value of the origin of the lineiY- the y-value of the origin of the line- Returns:
- the z-value of the intersection
-
saveMesh
Internal support to write vertices, normals, and connectivity indices to the file.- Parameters:
flip- if the y axis should be inverted - true for extract, false for from another surface- Throws:
IOException- if there is an error writing to the file
-
update2
protected float update2(int i) Compute the coefficient of the surface normal for the update of the mesh vertex V[i] in the SNormal[i] direction. See BrainExtraction.pdf for a description of the update.- Parameters:
i- the index of the vertex to update- Returns:
- the coefficient of SNormal[i] for the update
-
update3
protected void update3(int i) Compute the coefficient of the vertex normal for the update of the mesh vertex V[i] in the VNormal[i] direction. See BrainExtraction.pdf for a description of the update.- Parameters:
i- the index of the vertex to update
-
calcGradMag
private void calcGradMag()DOCUMENT ME! -
calcGVF3D
private void calcGVF3D()Calculate GVF from 3D image buffer. -
algorithmPerformed
Description copied from interface:AlgorithmInterfaceCalled after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.- Specified by:
algorithmPerformedin interfaceAlgorithmInterface- Parameters:
algorithm- the algorithm which has just completed
-