java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.WormUntwisting.LatticeModel

public class LatticeModel extends Object
Supports the worm-straightening algorithms that use a 3D lattice as the basis of the straightening process.
  • Field Details

    • SampleLimit

      protected static final int SampleLimit
      See Also:
    • imageA

      protected ModelImage imageA
    • imageDims

      private WildMagic.LibFoundation.Mathematics.Vector3f imageDims
    • outputDirectory

      private String outputDirectory
    • sharedOutputDir

      private String sharedOutputDir
    • lattice

      protected VOIVector lattice
    • left

      protected VOI left
    • leftContour

      protected VOI leftContour
    • 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 Vector<Float> wormDiameters
    • extent

      protected int extent
    • rightVectors

      protected Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightVectors
    • normalVectors

      protected Vector<WildMagic.LibFoundation.Mathematics.Vector3f> normalVectors
    • upVectors

      protected Vector<WildMagic.LibFoundation.Mathematics.Vector3f> upVectors
    • curvatureNormals

      Vector<WildMagic.LibFoundation.Mathematics.Vector3f> curvatureNormals
    • curvature

      Vector<Float> curvature
    • boxBounds

      protected Vector<WildMagic.LibFoundation.Mathematics.Box3f> boxBounds
    • ellipseBounds

      protected 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:
    • minRange

      protected final float minRange
      See Also:
    • 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 Vector<VOI> neuriteData
    • voiID

      protected Short voiID
    • seamCellIDs

      private int[][] seamCellIDs
    • allSeamCellIDs

      private int[][] allSeamCellIDs
    • colorAnnotations

      private boolean colorAnnotations
    • annotationListeners

      private Vector<AnnotationListener> annotationListeners
    • curveListeners

      private Vector<CurveListener> curveListeners
    • latticeListeners

      private Vector<LatticeListener> latticeListeners
    • annotationPrefix

      private String annotationPrefix
    • paddingFactor

      private int paddingFactor
    • numEllipsePts

      private int numEllipsePts
    • latticeContours

      private VOI latticeContours
    • markerNames

      private Vector<String> markerNames
    • markerCenters

      private Vector<WildMagic.LibFoundation.Mathematics.Vector3f> markerCenters
    • markerLatticeSegments

      private Vector<Integer> markerLatticeSegments
    • markerSlices

      private Vector<Integer> markerSlices
    • annotationsStraight

      private VOI annotationsStraight
    • latticeStraight

      private VOIVector latticeStraight
    • previewMode

      private boolean previewMode
    • clipMask

      private Vector<boolean[]> clipMask
    • splineControlPtsList

      protected 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 Details

    • 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:
      lattice -
      imageA -
  • Method Details

    • checkParentDir

      public static void checkParentDir(String parentDir)
    • getImageName

      private static String getImageName(ModelImage image)
    • match

      public static boolean match(Color c1, Color c2)
    • checkName

      public static boolean checkName(String name, VOI annotationVOIs)
    • readAnnotationsCSV

      public static VOI readAnnotationsCSV(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(String fileName)
    • readLatticeCSV

      public static VOIVector readLatticeCSV(String fileName, boolean saveSeamCells)
    • saveAllVOIsTo

      public static void saveAllVOIsTo(String voiDir, ModelImage image)
      Saves all VOIs to the specified file.
      Parameters:
      voiDir -
      image -
    • saveAnnotationsAsCSV

      public static void saveAnnotationsAsCSV(String dir, String fileName, VOI annotations)
    • saveAnnotationsAsCSV

      public static void saveAnnotationsAsCSV(String dir, 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(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, 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(String name, boolean display)
    • dispose

      public void dispose()
      Deletes this LatticeModel
    • flipLattice

      public void flipLattice()
    • flipLattice

      public static void flipLattice(VOI left, VOI right)
    • 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 String getAnnotationPrefix()
    • getAnnotations

      public VOI getAnnotations()
    • getAnnotationsStraight

      public VOI getAnnotationsStraight()
    • getSplineCurves

      public Vector<String> getSplineCurves()
    • deleteSelectedCurve

      public void deleteSelectedCurve()
    • isCurveSelected

      public boolean isCurveSelected(String name)
    • setCurveName

      public void setCurveName(String oldName, String newName)
    • setCurveSelected

      public void setCurveSelected(String name, boolean selected)
    • setCurveVisible

      public void setCurveVisible(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 Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getNormalVectors()
    • getRightVectors

      public Vector<WildMagic.LibFoundation.Mathematics.Vector3f> getRightVectors()
    • getUpVectors

      public 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 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:
      pt - point along the ray with the maximum intensity value.
      startPt - 3D start point of a ray intersecting the volume.
      endPt - 3D end point of a ray intersecting the volume.
    • 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
    • retwistAnnotations

      public VOI retwistAnnotations(VOIVector lattice)
    • retwistLattice

      public VOIVector retwistLattice(VOIVector lattice)
    • saveLattice

      public void saveLattice()
      Enables the user to save the lattice to a user-selected file.
    • saveLattice

      public void saveLattice(String directory, 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(String outputDirectory)
    • saveNeuriteCurves

      public void saveNeuriteCurves()
    • untwistNeuriteCurves

      public void untwistNeuriteCurves(boolean useLatticeModel)
    • openStraightNeuriteCurves

      public static void openStraightNeuriteCurves(ModelImage image, 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(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(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()
    • setPreviewMode

      public void setPreviewMode(boolean preview, VOIVector lattice, VOI annotations)
    • 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(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 invalid input: '<'= 1 voxel.
      Parameters:
      contour -
    • loadDiameters

      protected Vector<Float> loadDiameters(String imageDir)
    • loadPositions

      protected VOIContour loadPositions(String imageDir, String name)
    • loadSamplePlanes

      protected VOI loadSamplePlanes(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, 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(String imageDir, ModelImage model, ModelImage originToStraight, int[] outputDim, String postFix)
      Saves the annotation statistics to a file.
      Parameters:
      model -
      originToStraight -
      outputDim -
      postFix -
      image -
      Returns:
    • saveDiameters

      protected void saveDiameters(Vector<Float> diameters, String imageDir)
    • saveLatticeStatistics

      protected void saveLatticeStatistics(String imageDir, float length, VOI left, VOI right, float[] leftPairs, float[] rightPairs, String postFix)
      Saves the lattice statistics to a file.
      Parameters:
      length -
      left -
      right -
      leftPairs -
      rightPairs -
      postFix -
      image -
    • savePositions

      protected void savePositions(VOIContour contour, String imageDir, String name)
    • saveSamplePlanes

      protected void saveSamplePlanes(VOI planes, 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(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(String imageName, ModelImage image, boolean saveAsTif)
    • saveImage

      public static void saveImage(ModelImage originalImage, ModelImage image, String subDir, String postScript)
    • saveLatticeStatistics

      private void saveLatticeStatistics()
    • saveContourAsCSV

      public static void saveContourAsCSV(ModelImage image, String subDir, String postScript, VOIContour contour)
    • saveBasisVectorsAsCSV

      public static void saveBasisVectorsAsCSV(ModelImage image, String subDir, String postScript, VOIContour positions, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> normals, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> rightVectors, 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, String subDir, String postScript)
    • saveTriMesh

      public static void saveTriMesh(ModelImage image, String outputDirectory, String subDir, String postScript, WildMagic.LibGraphics.SceneGraph.TriMesh mesh)
    • saveSpline

      private void saveSpline(String outputDirectory, VOI data, WildMagic.LibFoundation.Mathematics.Vector3f transformedOrigin, 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(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:
      resultExtents -
      image -
    • getPrefix

      private static String getPrefix(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(String directory, String fileName, VOIVector latticeVector)
    • saveLattice

      public static void saveLattice(String directory, String fileName, String latticeFileName, VOIVector latticeVector)
    • annotationChanged

      private static VOI annotationChanged(VOI annotationsNew, VOI annotationOld)
    • latticeChanged

      private boolean latticeChanged()
    • testLatticeMeshIntersection

      private void testLatticeMeshIntersection()
    • getInsideMeshImage

      private ModelImage getInsideMeshImage(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(BitSet surfaceMask, Vector<WildMagic.LibFoundation.Mathematics.Vector3f> seedList, BitSet visited, WildMagic.LibFoundation.Mathematics.Vector3f min, WildMagic.LibFoundation.Mathematics.Vector3f max, int dimX, int dimY, int dimZ)