Class LatticeModel
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.WormUntwisting.LatticeModel
-
public class LatticeModel extends java.lang.ObjectSupports 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 classLatticeModel.AnnotationSplineControlPts
-
Field Summary
Fields Modifier and Type Field Description protected float[]afTimeCprivate int[][]allSeamCellIDsprotected float[]allTimesprivate java.util.Vector<AnnotationListener>annotationListenersprivate java.lang.StringannotationPrefixprivate VOIannotationsStraightprotected VOIannotationVOIsprotected java.util.Vector<WildMagic.LibFoundation.Mathematics.Box3f>boxBoundsprotected VOIContourcenterprivate VOIcenterLineprotected VOIContourcenterPositionsprotected WildMagic.LibFoundation.Curves.NaturalSpline3centerSplineprivate java.util.Vector<boolean[]>clipMaskprivate booleancolorAnnotationsprivate WildMagic.LibGraphics.SceneGraph.TriMeshcurrentMesh(package private) java.util.Vector<java.lang.Float>curvature(package private) java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>curvatureNormalsprivate java.util.Vector<CurveListener>curveListenersprotected intDiameterBufferprivate VOI[]displayContoursprivate VOIdisplayContours2protected VOIdisplayInterpolatedContoursprivate booleandisplayLatticeLabelsprotected java.util.Vector<WildMagic.LibFoundation.Mathematics.Ellipsoid3f>ellipseBoundsprivate booleanellipseCrossprotected VOIContour[]ellipseCurvesprivate VOIellipseCurvesVOIprivate floatellipseScaleprotected intextentprotected ModelImageimageAprivate WildMagic.LibFoundation.Mathematics.Vector3fimageDimsprotected VOIVectorlatticeprivate VOIlatticeContoursprivate VOIVectorlatticeGridprivate booleanlatticeInterpolationInitprivate java.util.Vector<LatticeListener>latticeListenersprivate VOIWormAnnotationlatticepositionMarkerprotected int[]latticeSlicesprivate VOIVectorlatticeStraightprotected VOIleftprotected VOIleftContourprivate VOIleftLineprivate VOIleftMarkerprotected VOIContourleftPositionsprivate java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>markerCentersprivate java.util.Vector<java.lang.Integer>markerLatticeSegmentsprivate java.util.Vector<java.lang.String>markerNamesprivate java.util.Vector<java.lang.Integer>markerSlicesprivate intmaxSplineLengthprotected floatminRangeprivate booleanmodelDisplayedEnables the user to visualize the simple ellipse-based model of the worm during lattice construction.private java.util.Vector<VOI>neuriteDataprotected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>normalVectorsprivate intnumEllipsePtsprivate intnumSurfaceSegmentsprivate java.lang.StringoutputDirectoryprivate intpaddingFactorprivate WildMagic.LibFoundation.Mathematics.Vector3fpickedPointprivate booleanpreviewModeprotected VOIrightprotected VOIrightContourprivate VOIrightLineprivate VOIrightMarkerprotected VOIContourrightPositionsprotected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>rightVectorsprotected static intSampleLimitprotected VOIsamplingPlanesprivate int[][]seamCellIDsprivate java.lang.StringsharedOutputDirprivate VOIContour[]showSelectedprivate VOIshowSelectedVOIprotected java.util.Vector<LatticeModel.AnnotationSplineControlPts>splineControlPtsListprivate booleansplineModelprotected int[]splineRangeIndexprotected WildMagic.LibFoundation.Mathematics.Vector3ftransformedOriginprotected java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>upVectorsprotected java.lang.ShortvoiIDprotected java.util.Vector<java.lang.Float>wormDiametersprotected WildMagic.LibFoundation.Mathematics.Vector3fwormOrigin
-
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 voidaddAnnotation(VOI textVOI, boolean multiSelect)Add an annotation to the annotation list.voidaddAnnotation(VOIWormAnnotation newText, boolean multiSelect)voidaddAnnotationListener(AnnotationListener listener)Adds an annotation listener.voidaddAnnotations(VOI newAnnotations)Called when new annotations are loaded from file, replaces current annotations.voidaddCurveListener(CurveListener listener)private booleanaddInsertionPoint(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f maxPt, boolean isSeam)Adds a point to the lattice.voidaddLatticeListener(LatticeListener listener)voidaddLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)Adds a new left/right marker to the worm image.voidaddNeurite(VOI annotionVOI, java.lang.String name)Generates a natural spline curve to fit the input set of annotation points to model a neurite.voidaddSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)Add a curve to the list.private static VOIannotationChanged(VOI annotationsNew, VOI annotationOld)private static ModelImageblur(ModelImage image, int sigma)Returns a blurred image of the input image.static booleancheckName(java.lang.String name, VOI annotationVOIs)static voidcheckParentDir(java.lang.String parentDir)voidclear3DSelection()Clears the selected VOI or Annotation point.voidclearAddLeftRightMarkers()Enables user to start editing the lattice.private voidclearCurves(boolean clearGrid)Resets the natural spline curves when the lattice changes.private voidcolorAnnotations()Counts the annotations and colors them based on the number of annotations.voidcolorAnnotations(boolean setColor)private booleancontainsAnnotation(VOI annotationsList, VOIWormAnnotation text)voiddeleteAnnotations()voiddeleteSelectedCurve()voiddeleteSelectedPoint(boolean doAnnotation)Deletes the selected annotation or lattice point.voiddisplayAnnotation(java.lang.String name, boolean display)voiddispose()Deletes this LatticeModelprivate static intfill(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 intfindPoint(VOI left, WildMagic.LibFoundation.Mathematics.Vector3f pickedPoint)voidflipLattice()static voidflipLattice(VOI left, VOI right)protected booleangenerateCurves(float stepSize)Generates the set of natural spline curves to fit the current lattice.private voidgenerateEllipses(int extent)WildMagic.LibGraphics.SceneGraph.TriMeshgenerateTriMesh(boolean returnMesh, boolean saveMesh)WildMagic.LibGraphics.SceneGraph.TriMeshgenerateTriMesh2(boolean returnMesh, boolean saveMesh, int stepSize)java.lang.StringgetAnnotationPrefix()VOIgetAnnotations()VOIgetAnnotationsStraight()WildMagic.LibFoundation.Mathematics.Vector3f[]getBasisVectors(int i)VOIContourgetCenter()WildMagic.LibFoundation.Mathematics.Vector3fgetCenter(int i)VOIContourgetCenterControlPoints()private booleangetContourFile()private static floatgetCorrectionFactor(ModelImage image)Returns the amount of correction which should be applied to the z-direction sigma (assuming that correction is requested).intgetCurrentIndex()intgetDiameter(int i)VOIContour[]getEllipseCurves()private static java.lang.StringgetImageName(ModelImage image)private ModelImagegetInsideMeshImage(java.util.BitSet surfaceMask)private ModelImagegetInsideMeshImage(WildMagic.LibGraphics.SceneGraph.TriMesh mesh)VOIVectorgetLattice()intgetLatticeCurveLength()VOIVectorgetLatticeStraight()VOIContourgetLeftCurve()java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>getNormalVectors()WildMagic.LibFoundation.Mathematics.Vector3fgetPicked()Returns the currently selected point, either on the lattice or from the annotation list.WildMagic.LibFoundation.Mathematics.Vector3fgetPicked(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()VOIgetPlanes()private static java.lang.StringgetPrefix(java.lang.String name)VOIContourgetRightCurve()java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>getRightVectors()VOIgetSamplingPlanes(boolean scale)java.util.Vector<java.lang.String>getSplineCurves()protected doubleGetSquared(WildMagic.LibFoundation.Mathematics.Vector3f point, WildMagic.LibFoundation.Mathematics.Ellipsoid3f ellipsoid)java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f>getUpVectors()booleanhasPicked()voidinitializeInterpolation(boolean saveStats)protected voidinterpolateContour(VOIContour contour)Interpolates the input contour so that the spacing between contour points is <= 1 voxel.voidinterpolateLattice(boolean displayResult, boolean useModel, boolean untwistImage, boolean untwistMarkers)Entry point in the lattice-based straightening algorithm.private static WildMagic.LibFoundation.Mathematics.Vector3finverseDiagonal(ModelImage image, int slice, int extent, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target)booleanisCurveSelected(java.lang.String name)booleanisModelDisplayed()booleanisPreview()private booleanlatticeChanged()protected java.util.Vector<java.lang.Float>loadDiameters(java.lang.String imageDir)protected VOIContourloadPositions(java.lang.String imageDir, java.lang.String name)protected VOIloadSamplePlanes(java.lang.String imageDir)protected WildMagic.LibFoundation.Mathematics.Ellipsoid3fmakeEllipse(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 voidmakeEllipse2DA(WildMagic.LibFoundation.Mathematics.Vector3f right, WildMagic.LibFoundation.Mathematics.Vector3f up, WildMagic.LibFoundation.Mathematics.Vector3f center, float radius, VOIContour ellipse)protected voidmakeEllipse2DA(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 voidmakeLatticeContours()private voidmakeSelectionFrame(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 booleanmatch(java.awt.Color c1, java.awt.Color c2)booleanmodifyAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f pt)Enables the user to move an annotation point with the mouse.booleanmodifyLattice(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.voidmodifyLeftRightMarker(WildMagic.LibFoundation.Mathematics.Vector3f pt)Sets the currently selected point (lattice or annotation).voidmoveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction, boolean doAnnotation)Enables the user to move the selected point (lattice or annotation) with the arrow keys.voidopenNeuriteCurves(java.lang.String outputDirectory)static voidopenStraightNeuriteCurves(ModelImage image, java.lang.String outputDirectory)protected WildMagic.LibFoundation.Mathematics.Vector3foriginToStraight(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 VOIreadAnnotationsCSV(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 VOIVectorreadLatticeCSV(java.lang.String fileName)static VOIVectorreadLatticeCSV(java.lang.String fileName, boolean saveSeamCells)private voidreadMeshContoursCSV()voidredo()VOI operation redovoidremoveListeners()static booleanrenameLatticeOnLoad(ModelImage image, VOIVector latticeVector)private WildMagic.LibFoundation.Mathematics.Vector3fretwistAnnotation(VOIWormAnnotation annotation)VOIretwistAnnotations(VOIVector lattice)VOIVectorretwistLattice(VOIVector lattice)static voidsaveAllVOIsTo(java.lang.String voiDir, ModelImage image)Saves all VOIs to the specified file.static voidsaveAnnotationsAsCSV(java.lang.String dir, java.lang.String fileName, VOI annotations)static voidsaveAnnotationsAsCSV(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 VOIsaveAnnotationStatistics(java.lang.String imageDir, ModelImage model, ModelImage originToStraight, int[] outputDim, java.lang.String postFix)Saves the annotation statistics to a file.static voidsaveBasisVectorsAsCSV(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 voidsaveContourAsCSV(ModelImage image, java.lang.String subDir, java.lang.String postScript, VOIContour contour)private voidsaveContours(ModelImage image, WildMagic.LibFoundation.Mathematics.Box3f[] contours)protected voidsaveDiameters(java.util.Vector<java.lang.Float> diameters, java.lang.String imageDir)static voidsaveImage(ModelImage originalImage, ModelImage image, java.lang.String subDir, java.lang.String postScript)private voidsaveImage(java.lang.String imageName, ModelImage image, boolean saveAsTif)voidsaveLattice()Enables the user to save the lattice to a user-selected file.voidsaveLattice(java.lang.String directory, java.lang.String fileName)Saves the lattice to the specified file and directory.static voidsaveLattice(java.lang.String directory, java.lang.String fileName, VOIVector latticeVector)static voidsaveLattice(java.lang.String directory, java.lang.String fileName, java.lang.String latticeFileName, VOIVector latticeVector)private voidsaveLatticeStatistics()protected voidsaveLatticeStatistics(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 voidsaveMeshContoursCSV()voidsaveNeuriteCurves()protected voidsavePositions(VOIContour contour, java.lang.String imageDir, java.lang.String name)protected voidsaveSamplePlanes(VOI planes, java.lang.String imageDir)private voidsaveSpline(java.lang.String outputDirectory, VOI data, WildMagic.LibFoundation.Mathematics.Vector3f transformedOrigin, java.lang.String postFix)static voidsaveTriMesh(ModelImage image, java.lang.String outputDirectory, java.lang.String subDir, java.lang.String postScript, WildMagic.LibGraphics.SceneGraph.TriMesh mesh)ModelImagesegmentLattice(ModelImage image, boolean saveContourImage, int paddingFactor, boolean segmentLattice)voidsegmentLattice(ModelImage image, ModelImage contourImageBlur)booleanselectAnnotation(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)booleanselectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isSeam)voidsetAnnotationPrefix(java.lang.String s)voidsetAnnotations(VOI newAnnotations)Called when new annotations are loaded from file, replaces current annotations.voidsetCurveName(java.lang.String oldName, java.lang.String newName)voidsetCurveSelected(java.lang.String name, boolean selected)voidsetCurveVisible(java.lang.String name, boolean visible)voidsetImage(ModelImage image)Change the underlying image for the latticeModel.voidsetLattice(VOIVector newLattice)Called when a new lattice is loaded from file, replaces the current lattice.voidsetMarkers(VOI markerVOIs)voidsetPaddingFactor(int padding)voidsetPreviewMode(boolean preview, VOIVector lattice, VOI annotations)voidsetSharedDirectory(java.lang.String dir)voidshowLattice(boolean display)Turns on/off lattice display:voidshowLatticeLabels(boolean display)voidshowMarker(int i)voidshowModel(boolean display)protected WildMagic.LibFoundation.Curves.NaturalSpline3smoothCurve(VOIContour curve, float[] time)Generates the Natural Spline for the lattice center-line curve.static WildMagic.LibFoundation.Curves.NaturalSpline3smoothCurve(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 voidtestLatticeMeshIntersection()voidundo()VOI operation undo.private voiduntwist(ModelImage image, int[] resultExtents, boolean saveTif)Straightens the worm image based on the input lattice positions.ModelImageuntwistAnnotations(java.lang.String dir, ModelImage contourImage)voiduntwistImage(boolean mainImage)Entry point in the lattice-based straightening algorithm.private voiduntwistLattice(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.voiduntwistMarkers(boolean untwistAll)Entry point in the lattice-based straightening algorithm.private voiduntwistMarkers(ModelImage image, int[] resultExtents)voiduntwistNeuriteCurves(boolean useLatticeModel)private voiduntwistSampleCount(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.voidupdateAnnotation(VOIWormAnnotation annotation)private voidupdateAnnotationListeners()Updates the list of listeners that the annotations have changed.voidupdateCrossSection(boolean useSpline, boolean ellipse, float percent)private voidupdateCurveListeners()private voidupdateEllipseModel(float stepSize)private voidupdateLattice(boolean rebuild)Updates the lattice data structures for rendering whenever the user changes the lattice.voidupdateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)private voidupdateLatticeListeners()private voidupdateLinks()Updates the lattice data structures on undo/redo.private voidupdateSeamCount()private voidupdateSelected()Updates the VOI displaying which point (lattice or annotation) is currently selected when the selection changes.voidupdateSelectedPoint(java.awt.Color color)private voidupdateSplineControlPoints()protected WildMagic.LibFoundation.Mathematics.Vector3fwriteDiagonal(ModelImage image, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts, WildMagic.LibFoundation.Mathematics.Vector3f target, float[] minDistance)protected voidwriteDiagonal(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)protected voidwriteDiagonalSampleCount(ModelImage image, ModelImage result, int tSlice, int slice, int[] extents, WildMagic.LibFoundation.Mathematics.Vector3f[] verts)protected voidwriteDiagonalTest(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)
-
-