Class LatticeModel
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.WormUntwisting.LatticeModel
-
public class LatticeModel extends java.lang.Object
Supports the worm-straightening algorithms that use a 3D lattice as the basis of the straightening process.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
LatticeModel.AnnotationSplineControlPts
-
Field Summary
Fields Modifier and Type Field Description protected float[]
afTimeC
private int[][]
allSeamCellIDs
protected float[]
allTimes
private java.util.Vector<AnnotationListener>
annotationListeners
private java.lang.String
annotationPrefix
private VOI
annotationsStraight
protected VOI
annotationVOIs
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Box3f>
boxBounds
protected VOIContour
center
private VOI
centerLine
protected VOIContour
centerPositions
protected WildMagic.LibFoundation.Curves.NaturalSpline3
centerSpline
private java.util.Vector<boolean[]>
clipMask
private boolean
colorAnnotations
private WildMagic.LibGraphics.SceneGraph.TriMesh
currentMesh
(package private) java.util.Vector<java.lang.Float>
curvature
(package private) java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
curvatureNormals
private java.util.Vector<CurveListener>
curveListeners
protected int
DiameterBuffer
private VOI[]
displayContours
private VOI
displayContours2
protected VOI
displayInterpolatedContours
private boolean
displayLatticeLabels
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Ellipsoid3f>
ellipseBounds
private boolean
ellipseCross
protected VOIContour[]
ellipseCurves
private VOI
ellipseCurvesVOI
private float
ellipseScale
protected int
extent
protected ModelImage
imageA
private WildMagic.LibFoundation.Mathematics.Vector3f
imageDims
protected VOIVector
lattice
private VOI
latticeContours
private VOIVector
latticeGrid
private boolean
latticeInterpolationInit
private java.util.Vector<LatticeListener>
latticeListeners
private VOIWormAnnotation
latticepositionMarker
protected int[]
latticeSlices
private VOIVector
latticeStraight
protected VOI
left
protected VOI
leftContour
private VOI
leftLine
private VOI
leftMarker
protected VOIContour
leftPositions
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
markerCenters
private java.util.Vector<java.lang.Integer>
markerLatticeSegments
private java.util.Vector<java.lang.String>
markerNames
private java.util.Vector<java.lang.Integer>
markerSlices
private int
maxSplineLength
protected float
minRange
private boolean
modelDisplayed
Enables the user to visualize the simple ellipse-based model of the worm during lattice construction.private java.util.Vector<VOI>
neuriteData
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
normalVectors
private int
numEllipsePts
private int
numSurfaceSegments
private java.lang.String
outputDirectory
private int
paddingFactor
private WildMagic.LibFoundation.Mathematics.Vector3f
pickedPoint
private boolean
previewMode
protected VOI
right
protected VOI
rightContour
private VOI
rightLine
private VOI
rightMarker
protected VOIContour
rightPositions
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
rightVectors
protected static int
SampleLimit
protected VOI
samplingPlanes
private int[][]
seamCellIDs
private java.lang.String
sharedOutputDir
private VOIContour[]
showSelected
private VOI
showSelectedVOI
protected java.util.Vector<LatticeModel.AnnotationSplineControlPts>
splineControlPtsList
private boolean
splineModel
protected int[]
splineRangeIndex
protected WildMagic.LibFoundation.Mathematics.Vector3f
transformedOrigin
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
upVectors
protected java.lang.Short
voiID
protected java.util.Vector<java.lang.Float>
wormDiameters
protected WildMagic.LibFoundation.Mathematics.Vector3f
wormOrigin
-
Constructor Summary
Constructors Constructor Description LatticeModel(ModelImage image)
Creates a new LatticeModelLatticeModel(ModelImage image, VOIVector lattice)
Creats a new LatticeModel with the given input lattice.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAnnotation(VOI textVOI, boolean multiSelect)
Add an annotation to the annotation list.void
addAnnotation(VOIWormAnnotation newText, boolean multiSelect)
void
addAnnotationListener(AnnotationListener listener)
Adds an annotation listener.void
addAnnotations(VOI newAnnotations)
Called when new annotations are loaded from file, replaces current annotations.void
addCurveListener(CurveListener listener)
private boolean
addInsertionPoint(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f maxPt, boolean isSeam)
Adds a point to the lattice.void
addLatticeListener(LatticeListener listener)
void
addLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)
Adds a new left/right marker to the worm image.void
addNeurite(VOI annotionVOI, java.lang.String name)
Generates a natural spline curve to fit the input set of annotation points to model a neurite.void
addSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)
Add a curve to the list.private static VOI
annotationChanged(VOI annotationsNew, VOI annotationOld)
private static ModelImage
blur(ModelImage image, int sigma)
Returns a blurred image of the input image.static boolean
checkName(java.lang.String name, VOI annotationVOIs)
static void
checkParentDir(java.lang.String parentDir)
void
clear3DSelection()
Clears the selected VOI or Annotation point.void
clearAddLeftRightMarkers()
Enables user to start editing the lattice.private void
clearCurves(boolean clearGrid)
Resets the natural spline curves when the lattice changes.private void
colorAnnotations()
Counts the annotations and colors them based on the number of annotations.void
colorAnnotations(boolean setColor)
private boolean
containsAnnotation(VOI annotationsList, VOIWormAnnotation text)
void
deleteAnnotations()
void
deleteSelectedCurve()
void
deleteSelectedPoint(boolean doAnnotation)
Deletes the selected annotation or lattice point.void
displayAnnotation(java.lang.String name, boolean display)
void
dispose()
Deletes this LatticeModelprivate static int
fill(java.util.BitSet surfaceMask, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> seedList, java.util.BitSet visited, WildMagic.LibFoundation.Mathematics.Vector3f min, WildMagic.LibFoundation.Mathematics.Vector3f max, int dimX, int dimY, int dimZ)
private int
findPoint(VOI left, WildMagic.LibFoundation.Mathematics.Vector3f pickedPoint)
void
flipLattice()
static void
flipLattice(VOI left, VOI right)
protected boolean
generateCurves(float stepSize)
Generates the set of natural spline curves to fit the current lattice.private void
generateEllipses(int extent)
WildMagic.LibGraphics.SceneGraph.TriMesh
generateTriMesh(boolean returnMesh, boolean saveMesh)
WildMagic.LibGraphics.SceneGraph.TriMesh
generateTriMesh2(boolean returnMesh, boolean saveMesh, int stepSize)
java.lang.String
getAnnotationPrefix()
VOI
getAnnotations()
VOI
getAnnotationsStraight()
WildMagic.LibFoundation.Mathematics.Vector3f[]
getBasisVectors(int i)
VOIContour
getCenter()
WildMagic.LibFoundation.Mathematics.Vector3f
getCenter(int i)
VOIContour
getCenterControlPoints()
private boolean
getContourFile()
private static float
getCorrectionFactor(ModelImage image)
Returns the amount of correction which should be applied to the z-direction sigma (assuming that correction is requested).int
getCurrentIndex()
int
getDiameter(int i)
VOIContour[]
getEllipseCurves()
private static java.lang.String
getImageName(ModelImage image)
private ModelImage
getInsideMeshImage(java.util.BitSet surfaceMask)
private ModelImage
getInsideMeshImage(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
VOIVector
getLattice()
int
getLatticeCurveLength()
VOIVector
getLatticeStraight()
VOIContour
getLeftCurve()
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
getNormalVectors()
WildMagic.LibFoundation.Mathematics.Vector3f
getPicked()
Returns the currently selected point, either on the lattice or from the annotation list.WildMagic.LibFoundation.Mathematics.Vector3f
getPicked(WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean doAnnotation)
Finds the closest point to the input point and sets it as the currently selected lattice or annotation point.java.util.Vector<VOIWormAnnotation>
getPickedAnnotation()
VOI
getPlanes()
private static java.lang.String
getPrefix(java.lang.String name)
VOIContour
getRightCurve()
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
getRightVectors()
VOI
getSamplingPlanes(boolean scale)
java.util.Vector<java.lang.String>
getSplineCurves()
protected double
GetSquared(WildMagic.LibFoundation.Mathematics.Vector3f point, WildMagic.LibFoundation.Mathematics.Ellipsoid3f ellipsoid)
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>
getUpVectors()
boolean
hasPicked()
void
initializeInterpolation(boolean saveStats)
protected void
interpolateContour(VOIContour contour)
Interpolates the input contour so that the spacing between contour points is <= 1 voxel.void
interpolateLattice(boolean displayResult, boolean useModel, boolean untwistImage, boolean untwistMarkers)
Entry point in the lattice-based straightening algorithm.private static WildMagic.LibFoundation.Mathematics.Vector3f
inverseDiagonal(ModelImage image, int slice, int extent, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target)
boolean
isCurveSelected(java.lang.String name)
boolean
isModelDisplayed()
boolean
isPreview()
private boolean
latticeChanged()
protected java.util.Vector<java.lang.Float>
loadDiameters(java.lang.String imageDir)
protected VOIContour
loadPositions(java.lang.String imageDir, java.lang.String name)
protected VOI
loadSamplePlanes(java.lang.String imageDir)
protected WildMagic.LibFoundation.Mathematics.Ellipsoid3f
makeEllipse(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float diameterA, float diameterB, VOIContour ellipse)
Generates the 3D 1-voxel thick ellipsoids used in the intial worm model.protected void
makeEllipse2DA(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float radius, VOIContour ellipse)
protected void
makeEllipse2DA(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float radius, WildMagic.LibFoundation.Mathematics.Vector3f normal, float curvature, VOIContour ellipse, boolean ellipseCross, float scale)
private void
makeLatticeContours()
private void
makeSelectionFrame(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float diameter, VOIContour ellipse)
Generates the VOI that highlights which point (lattice or annotation) is currently selected by the user.static boolean
match(java.awt.Color c1, java.awt.Color c2)
boolean
modifyAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Enables the user to move an annotation point with the mouse.boolean
modifyLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
Enables the user to modify the lattice point with the mouse.void
modifyLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets the currently selected point (lattice or annotation).void
moveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction, boolean doAnnotation)
Enables the user to move the selected point (lattice or annotation) with the arrow keys.void
openNeuriteCurves(java.lang.String outputDirectory)
static void
openStraightNeuriteCurves(ModelImage image, java.lang.String outputDirectory)
protected WildMagic.LibFoundation.Mathematics.Vector3f
originToStraight(ModelImage model, ModelImage originToStraight, WildMagic.LibFoundation.Mathematics.Vector3f pt, java.lang.String text)
Given a point in the twisted volume, calculates and returns the corresponding point in the straightened image.static VOI
readAnnotationsCSV(java.lang.String fileName)
Read a list of annotations from a CSV file: name,x,y,z,radius (optional)static WildMagic.LibFoundation.Mathematics.Box3f[]
readContours(ModelImage image, java.lang.String subDir, java.lang.String postScript)
static VOIVector
readLatticeCSV(java.lang.String fileName)
static VOIVector
readLatticeCSV(java.lang.String fileName, boolean saveSeamCells)
private void
readMeshContoursCSV()
void
redo()
VOI operation redovoid
removeListeners()
static boolean
renameLatticeOnLoad(ModelImage image, VOIVector latticeVector)
private WildMagic.LibFoundation.Mathematics.Vector3f
retwistAnnotation(VOIWormAnnotation annotation)
VOI
retwistAnnotations(VOIVector lattice)
VOIVector
retwistLattice(VOIVector lattice)
static void
saveAllVOIsTo(java.lang.String voiDir, ModelImage image)
Saves all VOIs to the specified file.static void
saveAnnotationsAsCSV(java.lang.String dir, java.lang.String fileName, VOI annotations)
static void
saveAnnotationsAsCSV(java.lang.String dir, java.lang.String fileName, VOI annotations, boolean isCurve)
Saves the input annotations to the CSV file in the following format: name,x,y,zprotected VOI
saveAnnotationStatistics(java.lang.String imageDir, ModelImage model, ModelImage originToStraight, int[] outputDim, java.lang.String postFix)
Saves the annotation statistics to a file.static void
saveBasisVectorsAsCSV(ModelImage image, java.lang.String subDir, java.lang.String postScript, VOIContour positions, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> normals, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightVectors, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> upVectors)
static void
saveContourAsCSV(ModelImage image, java.lang.String subDir, java.lang.String postScript, VOIContour contour)
private void
saveContours(ModelImage image, WildMagic.LibFoundation.Mathematics.Box3f[] contours)
protected void
saveDiameters(java.util.Vector<java.lang.Float> diameters, java.lang.String imageDir)
static void
saveImage(ModelImage originalImage, ModelImage image, java.lang.String subDir, java.lang.String postScript)
private void
saveImage(java.lang.String imageName, ModelImage image, boolean saveAsTif)
void
saveLattice()
Enables the user to save the lattice to a user-selected file.void
saveLattice(java.lang.String directory, java.lang.String fileName)
Saves the lattice to the specified file and directory.static void
saveLattice(java.lang.String directory, java.lang.String fileName, VOIVector latticeVector)
static void
saveLattice(java.lang.String directory, java.lang.String fileName, java.lang.String latticeFileName, VOIVector latticeVector)
private void
saveLatticeStatistics()
protected void
saveLatticeStatistics(java.lang.String imageDir, float length, VOI left, VOI right, float[] leftPairs, float[] rightPairs, java.lang.String postFix)
Saves the lattice statistics to a file.private void
saveMeshContoursCSV()
void
saveNeuriteCurves()
protected void
savePositions(VOIContour contour, java.lang.String imageDir, java.lang.String name)
protected void
saveSamplePlanes(VOI planes, java.lang.String imageDir)
private void
saveSpline(java.lang.String outputDirectory, VOI data, WildMagic.LibFoundation.Mathematics.Vector3f transformedOrigin, java.lang.String postFix)
static void
saveTriMesh(ModelImage image, java.lang.String outputDirectory, java.lang.String subDir, java.lang.String postScript, WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
ModelImage
segmentLattice(ModelImage image, boolean saveContourImage, int paddingFactor, boolean segmentLattice)
void
segmentLattice(ModelImage image, ModelImage contourImageBlur)
boolean
selectAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)
boolean
selectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)
void
setAnnotationPrefix(java.lang.String s)
void
setAnnotations(VOI newAnnotations)
Called when new annotations are loaded from file, replaces current annotations.void
setCurveName(java.lang.String oldName, java.lang.String newName)
void
setCurveSelected(java.lang.String name, boolean selected)
void
setCurveVisible(java.lang.String name, boolean visible)
void
setImage(ModelImage image)
Change the underlying image for the latticeModel.void
setLattice(VOIVector newLattice)
Called when a new lattice is loaded from file, replaces the current lattice.void
setMarkers(VOI markerVOIs)
void
setPaddingFactor(int padding)
void
setPreviewMode(boolean preview, VOIVector lattice, VOI annotations)
void
setSharedDirectory(java.lang.String dir)
void
showLattice(boolean display)
Turns on/off lattice display:void
showLatticeLabels(boolean display)
void
showMarker(int i)
void
showModel(boolean display)
protected WildMagic.LibFoundation.Curves.NaturalSpline3
smoothCurve(VOIContour curve, float[] time)
Generates the Natural Spline for the lattice center-line curve.static WildMagic.LibFoundation.Curves.NaturalSpline3
smoothCurve(java.util.Vector<VOIWormAnnotation> controlPts)
protected WildMagic.LibFoundation.Mathematics.Vector3f[]
straightenFrame(ModelImage image, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f centerPos, WildMagic.LibFoundation.Mathematics.Vector3f leftPos, WildMagic.LibFoundation.Mathematics.Vector3f rightPos)
private void
testLatticeMeshIntersection()
void
undo()
VOI operation undo.private void
untwist(ModelImage image, int[] resultExtents, boolean saveTif)
Straightens the worm image based on the input lattice positions.ModelImage
untwistAnnotations(java.lang.String dir, ModelImage contourImage)
void
untwistImage(boolean mainImage)
Entry point in the lattice-based straightening algorithm.private void
untwistLattice(ModelImage image, int[] resultExtents)
Untwists the lattice and lattice interpolation curves, writing the straightened data to spreadsheet format .csv files and the straightened lattice to a VOI file.void
untwistMarkers(boolean untwistAll)
Entry point in the lattice-based straightening algorithm.private void
untwistMarkers(ModelImage image, int[] resultExtents)
void
untwistNeuriteCurves(boolean useLatticeModel)
private void
untwistSampleCount(ModelImage image, int[] resultExtents, boolean saveTif)
ModelImage[]
untwistTest(VolumeImage[] stack)
Untwists the worm image quickly for the preview mode - without saving any images or statisticsprivate ModelImage[]
untwistTest(VolumeImage[] stack, int[] resultExtents)
Untwists the worm image quickly for the preview mode - without saving any images or statistics Straightens the worm image based on the input lattice positions.void
updateAnnotation(VOIWormAnnotation annotation)
private void
updateAnnotationListeners()
Updates the list of listeners that the annotations have changed.void
updateCrossSection(boolean useSpline, boolean ellipse, float percent)
private void
updateCurveListeners()
private void
updateEllipseModel(float stepSize)
private void
updateLattice(boolean rebuild)
Updates the lattice data structures for rendering whenever the user changes the lattice.void
updateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)
private void
updateLatticeListeners()
private void
updateLinks()
Updates the lattice data structures on undo/redo.private void
updateSeamCount()
private void
updateSelected()
Updates the VOI displaying which point (lattice or annotation) is currently selected when the selection changes.void
updateSelectedPoint(java.awt.Color color)
private void
updateSplineControlPoints()
protected WildMagic.LibFoundation.Mathematics.Vector3f
writeDiagonal(ModelImage image, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target, float[] minDistance)
protected void
writeDiagonal(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)
protected void
writeDiagonalSampleCount(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)
protected void
writeDiagonalTest(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, float radiusSq)
-
-
-
Field Detail
-
SampleLimit
protected static final int SampleLimit
- See Also:
- Constant Field Values
-
imageA
protected ModelImage imageA
-
imageDims
private WildMagic.LibFoundation.Mathematics.Vector3f imageDims
-
outputDirectory
private java.lang.String outputDirectory
-
sharedOutputDir
private java.lang.String sharedOutputDir
-
lattice
protected VOIVector lattice
-
left
protected VOI left
-
leftContour
protected VOI leftContour
-
right
protected VOI right
-
rightContour
protected VOI rightContour
-
latticeGrid
private VOIVector latticeGrid
-
center
protected VOIContour center
-
latticeSlices
protected int[] latticeSlices
-
afTimeC
protected float[] afTimeC
-
allTimes
protected float[] allTimes
-
splineRangeIndex
protected int[] splineRangeIndex
-
centerSpline
protected WildMagic.LibFoundation.Curves.NaturalSpline3 centerSpline
-
centerPositions
protected VOIContour centerPositions
-
leftPositions
protected VOIContour leftPositions
-
rightPositions
protected VOIContour rightPositions
-
leftLine
private VOI leftLine
-
rightLine
private VOI rightLine
-
centerLine
private VOI centerLine
-
wormDiameters
protected java.util.Vector<java.lang.Float> wormDiameters
-
extent
protected int extent
-
rightVectors
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightVectors
-
normalVectors
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> normalVectors
-
upVectors
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> upVectors
-
curvatureNormals
java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> curvatureNormals
-
curvature
java.util.Vector<java.lang.Float> curvature
-
boxBounds
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Box3f> boxBounds
-
ellipseBounds
protected java.util.Vector<WildMagic.LibFoundation.Mathematics.Ellipsoid3f> ellipseBounds
-
latticeInterpolationInit
private boolean latticeInterpolationInit
-
samplingPlanes
protected VOI samplingPlanes
-
maxSplineLength
private int maxSplineLength
-
displayContours
private VOI[] displayContours
-
displayContours2
private VOI displayContours2
-
ellipseCurvesVOI
private VOI ellipseCurvesVOI
-
ellipseCurves
protected VOIContour[] ellipseCurves
-
displayInterpolatedContours
protected VOI displayInterpolatedContours
-
pickedPoint
private WildMagic.LibFoundation.Mathematics.Vector3f pickedPoint
-
showSelectedVOI
private VOI showSelectedVOI
-
showSelected
private VOIContour[] showSelected
-
DiameterBuffer
protected final int DiameterBuffer
- See Also:
- Constant Field Values
-
minRange
protected final float minRange
- See Also:
- Constant Field Values
-
leftMarker
private VOI leftMarker
-
rightMarker
private VOI rightMarker
-
annotationVOIs
protected VOI annotationVOIs
-
wormOrigin
protected WildMagic.LibFoundation.Mathematics.Vector3f wormOrigin
-
transformedOrigin
protected WildMagic.LibFoundation.Mathematics.Vector3f transformedOrigin
-
neuriteData
private java.util.Vector<VOI> neuriteData
-
voiID
protected java.lang.Short voiID
-
seamCellIDs
private int[][] seamCellIDs
-
allSeamCellIDs
private int[][] allSeamCellIDs
-
colorAnnotations
private boolean colorAnnotations
-
annotationListeners
private java.util.Vector<AnnotationListener> annotationListeners
-
curveListeners
private java.util.Vector<CurveListener> curveListeners
-
latticeListeners
private java.util.Vector<LatticeListener> latticeListeners
-
annotationPrefix
private java.lang.String annotationPrefix
-
paddingFactor
private int paddingFactor
-
numEllipsePts
private int numEllipsePts
-
latticeContours
private VOI latticeContours
-
markerNames
private java.util.Vector<java.lang.String> markerNames
-
markerCenters
private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> markerCenters
-
markerLatticeSegments
private java.util.Vector<java.lang.Integer> markerLatticeSegments
-
markerSlices
private java.util.Vector<java.lang.Integer> markerSlices
-
annotationsStraight
private VOI annotationsStraight
-
latticeStraight
private VOIVector latticeStraight
-
previewMode
private boolean previewMode
-
clipMask
private java.util.Vector<boolean[]> clipMask
-
splineControlPtsList
protected java.util.Vector<LatticeModel.AnnotationSplineControlPts> splineControlPtsList
-
numSurfaceSegments
private int numSurfaceSegments
-
currentMesh
private WildMagic.LibGraphics.SceneGraph.TriMesh currentMesh
-
latticepositionMarker
private VOIWormAnnotation latticepositionMarker
-
modelDisplayed
private boolean modelDisplayed
Enables the user to visualize the simple ellipse-based model of the worm during lattice construction.
-
splineModel
private boolean splineModel
-
ellipseCross
private boolean ellipseCross
-
ellipseScale
private float ellipseScale
-
displayLatticeLabels
private boolean displayLatticeLabels
-
-
Constructor Detail
-
LatticeModel
public LatticeModel(ModelImage image)
Creates a new LatticeModel- Parameters:
imageA
-
-
LatticeModel
public LatticeModel(ModelImage image, VOIVector lattice)
Creats a new LatticeModel with the given input lattice.- Parameters:
imageA
-lattice
-
-
-
Method Detail
-
checkParentDir
public static void checkParentDir(java.lang.String parentDir)
-
getImageName
private static java.lang.String getImageName(ModelImage image)
-
match
public static boolean match(java.awt.Color c1, java.awt.Color c2)
-
checkName
public static boolean checkName(java.lang.String name, VOI annotationVOIs)
-
readAnnotationsCSV
public static VOI readAnnotationsCSV(java.lang.String fileName)
Read a list of annotations from a CSV file: name,x,y,z,radius (optional)- Parameters:
fileName
-- Returns:
- VOI containing list of annotations.
-
readLatticeCSV
public static VOIVector readLatticeCSV(java.lang.String fileName)
-
readLatticeCSV
public static VOIVector readLatticeCSV(java.lang.String fileName, boolean saveSeamCells)
-
saveAllVOIsTo
public static void saveAllVOIsTo(java.lang.String voiDir, ModelImage image)
Saves all VOIs to the specified file.- Parameters:
voiDir
-image
-
-
saveAnnotationsAsCSV
public static void saveAnnotationsAsCSV(java.lang.String dir, java.lang.String fileName, VOI annotations)
-
saveAnnotationsAsCSV
public static void saveAnnotationsAsCSV(java.lang.String dir, java.lang.String fileName, VOI annotations, boolean isCurve)
Saves the input annotations to the CSV file in the following format: name,x,y,z- Parameters:
dir
-fileName
-annotations
-
-
inverseDiagonal
private static WildMagic.LibFoundation.Mathematics.Vector3f inverseDiagonal(ModelImage image, int slice, int extent, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target)
-
addAnnotation
public void addAnnotation(VOI textVOI, boolean multiSelect)
Add an annotation to the annotation list.- Parameters:
textVOI
-
-
addAnnotation
public void addAnnotation(VOIWormAnnotation newText, boolean multiSelect)
-
removeListeners
public void removeListeners()
-
addAnnotationListener
public void addAnnotationListener(AnnotationListener listener)
Adds an annotation listener. The annotation listeners are updated when the annotations change in any way.- Parameters:
listener
-
-
addSplineControlPts
public void addSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)
Add a curve to the list.- Parameters:
textVOI
-
-
addCurveListener
public void addCurveListener(CurveListener listener)
-
addLatticeListener
public void addLatticeListener(LatticeListener listener)
-
addLeftRightMarker
public void addLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)
Adds a new left/right marker to the worm image.- Parameters:
pt
-
-
addNeurite
public void addNeurite(VOI annotionVOI, java.lang.String name)
Generates a natural spline curve to fit the input set of annotation points to model a neurite.
-
clear3DSelection
public void clear3DSelection()
Clears the selected VOI or Annotation point.
-
clearAddLeftRightMarkers
public void clearAddLeftRightMarkers()
Enables user to start editing the lattice.
-
colorAnnotations
public void colorAnnotations(boolean setColor)
-
deleteAnnotations
public void deleteAnnotations()
-
deleteSelectedPoint
public void deleteSelectedPoint(boolean doAnnotation)
Deletes the selected annotation or lattice point.- Parameters:
doAnnotation
-
-
displayAnnotation
public void displayAnnotation(java.lang.String name, boolean display)
-
dispose
public void dispose()
Deletes this LatticeModel
-
flipLattice
public void flipLattice()
-
generateTriMesh
public WildMagic.LibGraphics.SceneGraph.TriMesh generateTriMesh(boolean returnMesh, boolean saveMesh)
-
generateTriMesh2
public WildMagic.LibGraphics.SceneGraph.TriMesh generateTriMesh2(boolean returnMesh, boolean saveMesh, int stepSize)
-
getAnnotationPrefix
public java.lang.String getAnnotationPrefix()
-
getAnnotations
public VOI getAnnotations()
-
getAnnotationsStraight
public VOI getAnnotationsStraight()
-
getSplineCurves
public java.util.Vector<java.lang.String> getSplineCurves()
-
deleteSelectedCurve
public void deleteSelectedCurve()
-
isCurveSelected
public boolean isCurveSelected(java.lang.String name)
-
setCurveName
public void setCurveName(java.lang.String oldName, java.lang.String newName)
-
setCurveSelected
public void setCurveSelected(java.lang.String name, boolean selected)
-
setCurveVisible
public void setCurveVisible(java.lang.String name, boolean visible)
-
getCurrentIndex
public int getCurrentIndex()
-
getLattice
public VOIVector getLattice()
-
getLatticeStraight
public VOIVector getLatticeStraight()
-
getCenter
public VOIContour getCenter()
-
getPlanes
public VOI getPlanes()
-
getEllipseCurves
public VOIContour[] getEllipseCurves()
-
getLatticeCurveLength
public int getLatticeCurveLength()
-
getCenter
public WildMagic.LibFoundation.Mathematics.Vector3f getCenter(int i)
-
showMarker
public void showMarker(int i)
-
getDiameter
public int getDiameter(int i)
-
getBasisVectors
public WildMagic.LibFoundation.Mathematics.Vector3f[] getBasisVectors(int i)
-
getLeftCurve
public VOIContour getLeftCurve()
-
getRightCurve
public VOIContour getRightCurve()
-
getCenterControlPoints
public VOIContour getCenterControlPoints()
-
getNormalVectors
public java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getNormalVectors()
-
getRightVectors
public java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getRightVectors()
-
getUpVectors
public java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getUpVectors()
-
getPicked
public WildMagic.LibFoundation.Mathematics.Vector3f getPicked()
Returns the currently selected point, either on the lattice or from the annotation list.- Returns:
-
getPicked
public WildMagic.LibFoundation.Mathematics.Vector3f getPicked(WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean doAnnotation)
Finds the closest point to the input point and sets it as the currently selected lattice or annotation point.- Parameters:
pt
-doAnnotation
-- Returns:
-
getPickedAnnotation
public java.util.Vector<VOIWormAnnotation> getPickedAnnotation()
-
getSamplingPlanes
public VOI getSamplingPlanes(boolean scale)
-
hasPicked
public boolean hasPicked()
-
initializeInterpolation
public void initializeInterpolation(boolean saveStats)
-
interpolateLattice
public void interpolateLattice(boolean displayResult, boolean useModel, boolean untwistImage, boolean untwistMarkers)
Entry point in the lattice-based straightening algorithm. At this point a lattice must be defined, outlining how the worm curves in 3D. A lattice is defined ad a VOI with two curves of equal length marking the left-hand and right-hand sides or the worm.- Parameters:
displayResult
- , when true intermediate volumes and results are displayed as well as the final straightened image.
-
modifyAnnotation
public boolean modifyAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Enables the user to move an annotation point with the mouse.- Parameters:
startPt
- 3D start point of a ray intersecting the volume.endPt
- 3D end point of a ray intersecting the volume.pt
- point along the ray with the maximum intensity value.
-
modifyLattice
public boolean modifyLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
Enables the user to modify the lattice point with the mouse.- Parameters:
startPt
- 3D start point of a ray intersecting the volume.endPt
- 3D end point of a ray intersecting the volume.pt
- point along the ray with the maximum intensity value.
-
modifyLeftRightMarker
public void modifyLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt)
Sets the currently selected point (lattice or annotation).- Parameters:
pt
-doAnnotation
-
-
moveSelectedPoint
public void moveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction, boolean doAnnotation)
Enables the user to move the selected point (lattice or annotation) with the arrow keys.- Parameters:
direction
-doAnnotation
-
-
redo
public void redo()
VOI operation redo
-
saveLattice
public void saveLattice()
Enables the user to save the lattice to a user-selected file.
-
saveLattice
public void saveLattice(java.lang.String directory, java.lang.String fileName)
Saves the lattice to the specified file and directory.- Parameters:
directory
-fileName
-
-
getContourFile
private boolean getContourFile()
-
saveMeshContoursCSV
private void saveMeshContoursCSV()
-
readMeshContoursCSV
private void readMeshContoursCSV()
-
openNeuriteCurves
public void openNeuriteCurves(java.lang.String outputDirectory)
-
saveNeuriteCurves
public void saveNeuriteCurves()
-
untwistNeuriteCurves
public void untwistNeuriteCurves(boolean useLatticeModel)
-
openStraightNeuriteCurves
public static void openStraightNeuriteCurves(ModelImage image, java.lang.String outputDirectory)
-
segmentLattice
public ModelImage segmentLattice(ModelImage image, boolean saveContourImage, int paddingFactor, boolean segmentLattice)
-
segmentLattice
public void segmentLattice(ModelImage image, ModelImage contourImageBlur)
-
selectAnnotation
public boolean selectAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)
-
selectLattice
public boolean selectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)
-
setAnnotationPrefix
public void setAnnotationPrefix(java.lang.String s)
-
setAnnotations
public void setAnnotations(VOI newAnnotations)
Called when new annotations are loaded from file, replaces current annotations.- Parameters:
newAnnotations
-
-
addAnnotations
public void addAnnotations(VOI newAnnotations)
Called when new annotations are loaded from file, replaces current annotations.- Parameters:
newAnnotations
-
-
setImage
public void setImage(ModelImage image)
Change the underlying image for the latticeModel. Update the output directories.- Parameters:
image
-
-
setSharedDirectory
public void setSharedDirectory(java.lang.String dir)
-
setLattice
public void setLattice(VOIVector newLattice)
Called when a new lattice is loaded from file, replaces the current lattice.- Parameters:
newLattice
-
-
setMarkers
public void setMarkers(VOI markerVOIs)
-
setPaddingFactor
public void setPaddingFactor(int padding)
-
isPreview
public boolean isPreview()
-
showModel
public void showModel(boolean display)
-
isModelDisplayed
public boolean isModelDisplayed()
-
updateCrossSection
public void updateCrossSection(boolean useSpline, boolean ellipse, float percent)
-
showLatticeLabels
public void showLatticeLabels(boolean display)
-
showLattice
public void showLattice(boolean display)
Turns on/off lattice display:
-
undo
public void undo()
VOI operation undo.
-
untwistImage
public void untwistImage(boolean mainImage)
Entry point in the lattice-based straightening algorithm. At this point a lattice must be defined, outlining how the worm curves in 3D. A lattice is defined ad a VOI with two curves of equal length marking the left-hand and right-hand sides or the worm.- Parameters:
displayResult
- , when true intermediate volumes and results are displayed as well as the final straightened image.
-
untwistMarkers
public void untwistMarkers(boolean untwistAll)
Entry point in the lattice-based straightening algorithm. At this point a lattice must be defined, outlining how the worm curves in 3D. A lattice is defined ad a VOI with two curves of equal length marking the left-hand and right-hand sides or the worm.- Parameters:
displayResult
- , when true intermediate volumes and results are displayed as well as the final straightened image.
-
untwistTest
public ModelImage[] untwistTest(VolumeImage[] stack)
Untwists the worm image quickly for the preview mode - without saving any images or statistics- Returns:
- untwisted image.
-
updateLattice
public void updateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)
-
updateAnnotation
public void updateAnnotation(VOIWormAnnotation annotation)
-
updateSelectedPoint
public void updateSelectedPoint(java.awt.Color color)
-
generateCurves
protected boolean generateCurves(float stepSize)
Generates the set of natural spline curves to fit the current lattice.
-
updateEllipseModel
private void updateEllipseModel(float stepSize)
-
GetSquared
protected double GetSquared(WildMagic.LibFoundation.Mathematics.Vector3f point, WildMagic.LibFoundation.Mathematics.Ellipsoid3f ellipsoid)
-
interpolateContour
protected void interpolateContour(VOIContour contour)
Interpolates the input contour so that the spacing between contour points is <= 1 voxel.- Parameters:
contour
-
-
loadDiameters
protected java.util.Vector<java.lang.Float> loadDiameters(java.lang.String imageDir)
-
loadPositions
protected VOIContour loadPositions(java.lang.String imageDir, java.lang.String name)
-
loadSamplePlanes
protected VOI loadSamplePlanes(java.lang.String imageDir)
-
makeEllipse
protected WildMagic.LibFoundation.Mathematics.Ellipsoid3f makeEllipse(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float diameterA, float diameterB, VOIContour ellipse)
Generates the 3D 1-voxel thick ellipsoids used in the intial worm model.- Parameters:
right
-up
-center
-diameterA
-diameterB
-ellipse
-- Returns:
-
makeEllipse2DA
protected void makeEllipse2DA(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float radius, VOIContour ellipse)
-
makeEllipse2DA
protected void makeEllipse2DA(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float radius, WildMagic.LibFoundation.Mathematics.Vector3f normal, float curvature, VOIContour ellipse, boolean ellipseCross, float scale)
-
originToStraight
protected WildMagic.LibFoundation.Mathematics.Vector3f originToStraight(ModelImage model, ModelImage originToStraight, WildMagic.LibFoundation.Mathematics.Vector3f pt, java.lang.String text)
Given a point in the twisted volume, calculates and returns the corresponding point in the straightened image.- Parameters:
model
-originToStraight
-pt
-text
-- Returns:
-
saveAnnotationStatistics
protected VOI saveAnnotationStatistics(java.lang.String imageDir, ModelImage model, ModelImage originToStraight, int[] outputDim, java.lang.String postFix)
Saves the annotation statistics to a file.- Parameters:
image
-model
-originToStraight
-outputDim
-postFix
-- Returns:
-
saveDiameters
protected void saveDiameters(java.util.Vector<java.lang.Float> diameters, java.lang.String imageDir)
-
saveLatticeStatistics
protected void saveLatticeStatistics(java.lang.String imageDir, float length, VOI left, VOI right, float[] leftPairs, float[] rightPairs, java.lang.String postFix)
Saves the lattice statistics to a file.- Parameters:
image
-length
-left
-right
-leftPairs
-rightPairs
-postFix
-
-
savePositions
protected void savePositions(VOIContour contour, java.lang.String imageDir, java.lang.String name)
-
saveSamplePlanes
protected void saveSamplePlanes(VOI planes, java.lang.String imageDir)
-
smoothCurve
protected WildMagic.LibFoundation.Curves.NaturalSpline3 smoothCurve(VOIContour curve, float[] time)
Generates the Natural Spline for the lattice center-line curve. Sets the time values for each point on the curve.- Parameters:
curve
-time
-- Returns:
-
smoothCurve
public static WildMagic.LibFoundation.Curves.NaturalSpline3 smoothCurve(java.util.Vector<VOIWormAnnotation> controlPts)
-
straightenFrame
protected WildMagic.LibFoundation.Mathematics.Vector3f[] straightenFrame(ModelImage image, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f centerPos, WildMagic.LibFoundation.Mathematics.Vector3f leftPos, WildMagic.LibFoundation.Mathematics.Vector3f rightPos)
-
writeDiagonal
protected WildMagic.LibFoundation.Mathematics.Vector3f writeDiagonal(ModelImage image, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target, float[] minDistance)
-
writeDiagonal
protected void writeDiagonal(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)
-
writeDiagonalSampleCount
protected void writeDiagonalSampleCount(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)
-
writeDiagonalTest
protected void writeDiagonalTest(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, float radiusSq)
-
addInsertionPoint
private boolean addInsertionPoint(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f maxPt, boolean isSeam)
Adds a point to the lattice.- Parameters:
startPt
-endPt
-maxPt
-
-
clearCurves
private void clearCurves(boolean clearGrid)
Resets the natural spline curves when the lattice changes.
-
colorAnnotations
private void colorAnnotations()
Counts the annotations and colors them based on the number of annotations. This is only used when the user is labeling seam-cells as an aid in determining if 20 pairs of seam cells have been found.
-
generateEllipses
private void generateEllipses(int extent)
-
makeSelectionFrame
private void makeSelectionFrame(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float diameter, VOIContour ellipse)
Generates the VOI that highlights which point (lattice or annotation) is currently selected by the user.- Parameters:
right
-up
-center
-diameter
-ellipse
-
-
retwistAnnotation
private WildMagic.LibFoundation.Mathematics.Vector3f retwistAnnotation(VOIWormAnnotation annotation)
-
saveImage
private void saveImage(java.lang.String imageName, ModelImage image, boolean saveAsTif)
-
saveImage
public static void saveImage(ModelImage originalImage, ModelImage image, java.lang.String subDir, java.lang.String postScript)
-
saveLatticeStatistics
private void saveLatticeStatistics()
-
saveContourAsCSV
public static void saveContourAsCSV(ModelImage image, java.lang.String subDir, java.lang.String postScript, VOIContour contour)
-
saveBasisVectorsAsCSV
public static void saveBasisVectorsAsCSV(ModelImage image, java.lang.String subDir, java.lang.String postScript, VOIContour positions, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> normals, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightVectors, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> upVectors)
-
saveContours
private void saveContours(ModelImage image, WildMagic.LibFoundation.Mathematics.Box3f[] contours)
-
readContours
public static WildMagic.LibFoundation.Mathematics.Box3f[] readContours(ModelImage image, java.lang.String subDir, java.lang.String postScript)
-
saveTriMesh
public static void saveTriMesh(ModelImage image, java.lang.String outputDirectory, java.lang.String subDir, java.lang.String postScript, WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
-
saveSpline
private void saveSpline(java.lang.String outputDirectory, VOI data, WildMagic.LibFoundation.Mathematics.Vector3f transformedOrigin, java.lang.String postFix)
-
untwist
private void untwist(ModelImage image, int[] resultExtents, boolean saveTif)
Straightens the worm image based on the input lattice positions. The image is straightened without first building a worm model. The image is segmented after clipping based on surface markers or the lattice shape.- Parameters:
image
-resultExtents
-
-
untwistSampleCount
private void untwistSampleCount(ModelImage image, int[] resultExtents, boolean saveTif)
-
untwistLattice
private void untwistLattice(ModelImage image, int[] resultExtents)
Untwists the lattice and lattice interpolation curves, writing the straightened data to spreadsheet format .csv files and the straightened lattice to a VOI file. The target slices for the lattice and curve data is generated from the distance along the curve. No segmentation or interpolation is necessary:- Parameters:
image
-resultExtents
-
-
untwistMarkers
private void untwistMarkers(ModelImage image, int[] resultExtents)
-
untwistAnnotations
public ModelImage untwistAnnotations(java.lang.String dir, ModelImage contourImage)
-
untwistTest
private ModelImage[] untwistTest(VolumeImage[] stack, int[] resultExtents)
Untwists the worm image quickly for the preview mode - without saving any images or statistics Straightens the worm image based on the input lattice positions. The image is straightened without first building a worm model. The image is segmented after clipping based on surface markers or the lattice shape.- Parameters:
image
-resultExtents
-
-
getPrefix
private static java.lang.String getPrefix(java.lang.String name)
-
containsAnnotation
private boolean containsAnnotation(VOI annotationsList, VOIWormAnnotation text)
-
updateSplineControlPoints
private void updateSplineControlPoints()
-
updateAnnotationListeners
private void updateAnnotationListeners()
Updates the list of listeners that the annotations have changed. This is how the latticeModel communicates changes to the different plugins that display lists of annotations, etc.
-
updateCurveListeners
private void updateCurveListeners()
-
updateLatticeListeners
private void updateLatticeListeners()
-
makeLatticeContours
private void makeLatticeContours()
-
updateLattice
private void updateLattice(boolean rebuild)
Updates the lattice data structures for rendering whenever the user changes the lattice.- Parameters:
rebuild
-
-
updateLinks
private void updateLinks()
Updates the lattice data structures on undo/redo.
-
updateSelected
private void updateSelected()
Updates the VOI displaying which point (lattice or annotation) is currently selected when the selection changes.
-
findPoint
private int findPoint(VOI left, WildMagic.LibFoundation.Mathematics.Vector3f pickedPoint)
-
updateSeamCount
private void updateSeamCount()
-
renameLatticeOnLoad
public static boolean renameLatticeOnLoad(ModelImage image, VOIVector latticeVector)
-
saveLattice
public static void saveLattice(java.lang.String directory, java.lang.String fileName, VOIVector latticeVector)
-
saveLattice
public static void saveLattice(java.lang.String directory, java.lang.String fileName, java.lang.String latticeFileName, VOIVector latticeVector)
-
latticeChanged
private boolean latticeChanged()
-
testLatticeMeshIntersection
private void testLatticeMeshIntersection()
-
getInsideMeshImage
private ModelImage getInsideMeshImage(java.util.BitSet surfaceMask)
-
getInsideMeshImage
private ModelImage getInsideMeshImage(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
-
blur
private static ModelImage blur(ModelImage image, int sigma)
Returns a blurred image of the input image.- Parameters:
image
-sigma
-- Returns:
-
getCorrectionFactor
private static float getCorrectionFactor(ModelImage image)
Returns the amount of correction which should be applied to the z-direction sigma (assuming that correction is requested).- Returns:
- the amount to multiply the z-sigma by to correct for resolution differences
-
fill
private static int fill(java.util.BitSet surfaceMask, java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> seedList, java.util.BitSet visited, WildMagic.LibFoundation.Mathematics.Vector3f min, WildMagic.LibFoundation.Mathematics.Vector3f max, int dimX, int dimY, int dimZ)
-
-