Class VOILatticeManagerInterface
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.VOI.VOIManagerInterface
-
- gov.nih.mipav.view.renderer.WildMagic.VOI.VOILatticeManagerInterface
-
- All Implemented Interfaces:
VOIListener
,VOIVectorListener
,VOIHandlerInterface
,java.awt.event.ActionListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.util.EventListener
,javax.swing.event.MouseInputListener
public class VOILatticeManagerInterface extends VOIManagerInterface
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class gov.nih.mipav.view.renderer.WildMagic.VOI.VOIManagerInterface
VOIManagerInterface.OkColorListener
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JTextField
defaultVoxelSize
private boolean
doAnnotations
private boolean
doAutomaticLabels
private boolean
isShiftSelected
private LatticeModel
latticeModel
private boolean
mouseSelection3D
private boolean
movingPickedPoint
private javax.swing.JDialog
updateVoxelSize
static float
VoxelSize
-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.VOI.VOIManagerInterface
colorChooser, currentColor, imageStatList, listenerList, m_kCurrentVOIGroup, m_kImageA, m_kImageB, m_kParent, m_kRedoList, m_kUndoList, m_kVOIDialog, m_kVOIManagers, popup, popupPt, renderer, saveGroup, voiMenu, voiMenuBuilder
-
-
Constructor Summary
Constructors Constructor Description VOILatticeManagerInterface(VOIManagerInterfaceListener kParent, ModelImage kImageA, ModelImage kImageB, int iNViews, boolean bGPU, javax.swing.ButtonGroup kVOIGroup)
Creates a VOIManagerInterface object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
void
add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect)
void
add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect, boolean isShift)
void
addAnnotation(VOI textVOI)
Add an annotation to the latticeModel.void
addAnnotation(VOI textVOI, boolean multiSelect)
Add an annotation to the latticeModel.void
addAnnotationListener(AnnotationListener listener)
Adds an annotation listener to the latticeModel.void
addAnnotations(VOIVector annotations)
void
addCurveListener(CurveListener listener)
void
addLatticeListener(LatticeListener listener)
private void
addLeftRightMarker(VOI textVOI, boolean isShift)
void
addSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)
void
addVOI(VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished)
Add a new VOIBase.void
clear3DSelection()
void
colorAnnotations(boolean setColor)
void
deleteAnnotations()
void
deleteSelectedCurve()
void
deleteSelectedPoint()
boolean
doAutomaticLabels()
Returns the automatic labels flag.void
editAnnotations(boolean automaticLabels)
Enable editing annotations in either 3D or 2D windows with the mouse.void
editClip()
void
editLattice()
static VOIBase
findNearestAnnotation(VOI annotations, WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
void
flipLattice()
WildMagic.LibGraphics.SceneGraph.TriMesh
generateTriMesh(int stepsize)
java.lang.String
getAnnotationPrefix()
VOI
getAnnotations()
Returns list of annotations from lattice model.VOI
getAnnotationsStraight()
int
getCurrentIndex()
VOIVector
getLattice()
int
getLatticeCurveLength()
WildMagic.LibFoundation.Mathematics.Vector3f
getLatticePickedPoint()
VOIVector
getLatticeStraight()
java.util.Vector<VOIWormAnnotation>
getPickedAnnotation()
java.util.Vector<java.lang.String>
getSplineCurves()
boolean
hasSelectedPoint()
protected void
initVOIManagers(int iNViews)
boolean
is3DSelectionEnabled()
boolean
isCurveSelected(java.lang.String name)
boolean
isEditAnnotations()
boolean
isModelDisplayed()
boolean
isPreview()
boolean
isShift()
void
keyPressed(java.awt.event.KeyEvent e)
void
keyReleased(java.awt.event.KeyEvent e)
boolean
modify3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
private boolean
modifyAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f pt)
private boolean
modifyLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
void
mouseReleased(java.awt.event.MouseEvent e)
void
moveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction)
void
openAnnotations(java.lang.String directory, java.lang.String fileName)
void
openLattice(java.lang.String directory, java.lang.String fileName)
void
openNeuriteCurves(java.lang.String dir)
protected void
redoVOIs()
void
removeListeners()
VOI
retwistAnnotations(VOIVector lattice)
VOIVector
retwistLattice(VOIVector lattice)
void
saveLattice(java.lang.String directory, java.lang.String fileName)
void
saveNeuriteCurves()
boolean
select3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect, boolean isShift)
private boolean
selectAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)
private boolean
selectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isShift)
void
setAnnotationPrefix(java.lang.String s)
void
setAnnotations(VOI annotations)
void
setAnnotations(VOIVector 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 imageA, ModelImage imageB)
Set the new imageA and imageB for creating VOIs.void
setLattice(VOIVector lattice)
void
setLatticeClip(boolean clip, int position)
void
setPaddingFactor(int padding)
void
setPreviewMode(boolean preview, VOIVector lattice, VOI annotations)
void
setSharedDirectory(java.lang.String dir)
private void
setVoxelSize()
void
showLattice(boolean display)
void
showLatticeLabels(boolean display)
void
showModel(boolean display)
protected void
undoVOIs()
ModelImage
untwistAnnotations(java.lang.String dir, ModelImage image)
ModelImage[]
untwistTest(VolumeImage[] stack)
Untwists the worm image quickly for the preview mode - without saving any images or statisticsvoid
updateAnnotation(VOIText annotation)
void
updateCrossSection(boolean useSpline, boolean ellipse, float percent)
void
updateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)
void
updateManager(int index, int orientation)
void
updateSelectedPoint(java.awt.Color color)
-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.VOI.VOIManagerInterface
addedCurve, addedVOI, addVOIManager, addVOIUpdateListener, algorithmPerformed, clearUndoRedo, colorChanged, deleteSelectedVOI, deleteVOI, deleteVOIs, disposeLocal, doVOI, extractNumber, fireVOISelectionChange, fireVOISelectionChange, getActiveImage, getBufferFloat, getBufferInt, getBufferShort, getByte, getComponentImage, getPointerButton, getToolBar, getVOI_ID, getVOIManager, getVOIManagerNum, getVOIState, graph25VOI_CalcInten, isNewVoiNeeded, loadAllImageJVOIsFrom, loadAllVOIsFrom, make3DVOI, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, moveVOI, moveVOI, newVOI, newVOI, pasteVOI, propVOI, propVOIAll, quickLUT, removedCurve, removedVOI, removeVOIManager, removeVOIUpdateListener, resetLivewire, saveVOIs, selectAllVOIs, selectedVOI, setActive, setButtonColor, setCenter, setCenter, setCursor, setDefaultCursor, setEnabled, setOpacity, setPointerButton, setPresetHue, setRenderer, setSelectedVOI, setVOI_IDs, setVOIState, setVOITools, showColorDialog, showCurvatureInfo, showIntensityInfo, showStatisticsCalculator, showVOIProperties, updateDisplay, updateGraph, vectorSelected
-
-
-
-
Field Detail
-
doAnnotations
private boolean doAnnotations
-
doAutomaticLabels
private boolean doAutomaticLabels
-
mouseSelection3D
private boolean mouseSelection3D
-
VoxelSize
public static float VoxelSize
-
latticeModel
private LatticeModel latticeModel
-
defaultVoxelSize
private javax.swing.JTextField defaultVoxelSize
-
updateVoxelSize
private javax.swing.JDialog updateVoxelSize
-
movingPickedPoint
private boolean movingPickedPoint
-
isShiftSelected
private boolean isShiftSelected
-
-
Constructor Detail
-
VOILatticeManagerInterface
public VOILatticeManagerInterface(VOIManagerInterfaceListener kParent, ModelImage kImageA, ModelImage kImageB, int iNViews, boolean bGPU, javax.swing.ButtonGroup kVOIGroup)
Creates a VOIManagerInterface object.- Parameters:
kParent
- the parent frame, must be a VOIManagerInterfaceListenerkImageA
- imageAkImageB
- imageBiNViews
- number of views displayed in the parent.bGPU
- set to true if this VOIManagerInterface is part of the GPU-based Volume Renderer.kVOIGroup
- for ViewJFrameImage and ViewJFrameTriImage, so the VOI Toolbar can be part of a larger button group.
-
-
Method Detail
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Overrides:
actionPerformed
in classVOIManagerInterface
-
getAnnotationPrefix
public java.lang.String getAnnotationPrefix()
-
setAnnotationPrefix
public void setAnnotationPrefix(java.lang.String s)
-
getCurrentIndex
public int getCurrentIndex()
-
colorAnnotations
public void colorAnnotations(boolean setColor)
-
removeListeners
public void removeListeners()
-
addAnnotationListener
public void addAnnotationListener(AnnotationListener listener)
Adds an annotation listener to the latticeModel.- Parameters:
listener
-
-
addCurveListener
public void addCurveListener(CurveListener listener)
-
addLatticeListener
public void addLatticeListener(LatticeListener listener)
-
editAnnotations
public void editAnnotations(boolean automaticLabels)
Enable editing annotations in either 3D or 2D windows with the mouse.- Parameters:
automaticLabels
- if true the labels are created with numbers only (no leading 'A' for annotation).
-
isEditAnnotations
public boolean isEditAnnotations()
-
doAutomaticLabels
public boolean doAutomaticLabels()
Returns the automatic labels flag.- Returns:
-
editLattice
public void editLattice()
-
editClip
public void editClip()
-
openLattice
public void openLattice(java.lang.String directory, java.lang.String fileName)
-
saveLattice
public void saveLattice(java.lang.String directory, java.lang.String fileName)
-
openNeuriteCurves
public void openNeuriteCurves(java.lang.String dir)
-
saveNeuriteCurves
public void saveNeuriteCurves()
-
setLattice
public void setLattice(VOIVector lattice)
-
untwistTest
public ModelImage[] untwistTest(VolumeImage[] stack)
Untwists the worm image quickly for the preview mode - without saving any images or statistics- Returns:
- untwisted image.
-
untwistAnnotations
public ModelImage untwistAnnotations(java.lang.String dir, ModelImage image)
-
openAnnotations
public void openAnnotations(java.lang.String directory, java.lang.String fileName)
-
addAnnotations
public void addAnnotations(VOIVector annotations)
-
setAnnotations
public void setAnnotations(VOIVector annotations)
-
setAnnotations
public void setAnnotations(VOI annotations)
-
add3DMarker
public void add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect)
-
isShift
public boolean isShift()
-
add3DMarker
public void add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect, boolean isShift)
-
clear3DSelection
public void clear3DSelection()
-
flipLattice
public void flipLattice()
-
is3DSelectionEnabled
public boolean is3DSelectionEnabled()
-
select3DMarker
public boolean select3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect, boolean isShift)
-
modify3DMarker
public boolean modify3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
-
deleteSelectedPoint
public void deleteSelectedPoint()
-
hasSelectedPoint
public boolean hasSelectedPoint()
-
getPickedAnnotation
public java.util.Vector<VOIWormAnnotation> getPickedAnnotation()
-
moveSelectedPoint
public void moveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction)
-
updateSelectedPoint
public void updateSelectedPoint(java.awt.Color color)
-
setImage
public void setImage(ModelImage imageA, ModelImage imageB)
Set the new imageA and imageB for creating VOIs.- Parameters:
imageA
-imageB
-
-
setSharedDirectory
public void setSharedDirectory(java.lang.String dir)
-
updateManager
public void updateManager(int index, int orientation)
-
initVOIManagers
protected void initVOIManagers(int iNViews)
- Overrides:
initVOIManagers
in classVOIManagerInterface
-
redoVOIs
protected void redoVOIs()
- Overrides:
redoVOIs
in classVOIManagerInterface
-
undoVOIs
protected void undoVOIs()
- Overrides:
undoVOIs
in classVOIManagerInterface
-
deleteAnnotations
public void deleteAnnotations()
-
showModel
public void showModel(boolean display)
-
isModelDisplayed
public boolean isModelDisplayed()
-
updateCrossSection
public void updateCrossSection(boolean useSpline, boolean ellipse, float percent)
-
showLattice
public void showLattice(boolean display)
-
showLatticeLabels
public void showLatticeLabels(boolean display)
-
setLatticeClip
public void setLatticeClip(boolean clip, int position)
-
generateTriMesh
public WildMagic.LibGraphics.SceneGraph.TriMesh generateTriMesh(int stepsize)
-
setPaddingFactor
public void setPaddingFactor(int padding)
-
addSplineControlPts
public void addSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)
-
addAnnotation
public void addAnnotation(VOI textVOI, boolean multiSelect)
Add an annotation to the latticeModel.- Parameters:
textVOI
- new annotation.
-
addAnnotation
public void addAnnotation(VOI textVOI)
Add an annotation to the latticeModel.- Parameters:
textVOI
- new annotation.
-
getAnnotations
public VOI getAnnotations()
Returns list of annotations from lattice model.- Returns:
- latticeModel annotations.
-
getAnnotationsStraight
public VOI getAnnotationsStraight()
-
getSplineCurves
public java.util.Vector<java.lang.String> getSplineCurves()
-
setCurveVisible
public void setCurveVisible(java.lang.String name, boolean visible)
-
setCurveName
public void setCurveName(java.lang.String oldName, java.lang.String newName)
-
setCurveSelected
public void setCurveSelected(java.lang.String name, boolean selected)
-
isCurveSelected
public boolean isCurveSelected(java.lang.String name)
-
deleteSelectedCurve
public void deleteSelectedCurve()
-
getLatticePickedPoint
public WildMagic.LibFoundation.Mathematics.Vector3f getLatticePickedPoint()
-
getLattice
public VOIVector getLattice()
-
getLatticeCurveLength
public int getLatticeCurveLength()
-
getLatticeStraight
public VOIVector getLatticeStraight()
-
isPreview
public boolean isPreview()
-
addLeftRightMarker
private void addLeftRightMarker(VOI textVOI, boolean isShift)
-
addVOI
public void addVOI(VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished)
Description copied from class:VOIManagerInterface
Add a new VOIBase. This function should only be called from VOIManager when a new VOIBase is created with the mouse.- Overrides:
addVOI
in classVOIManagerInterface
- Parameters:
kNew
- the new VOIBase to add.bQuickLUT
- true if this is a QuickLUT VOI.bUpdate
- when true call updateDisplay() after the VOIBase is addedisFinished
- true if this VOIBase is complete, used for open contours.
-
modifyLattice
private boolean modifyLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
-
selectLattice
private boolean selectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isShift)
-
modifyAnnotations
private boolean modifyAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f pt)
-
selectAnnotations
private boolean selectAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)
-
updateAnnotation
public void updateAnnotation(VOIText annotation)
-
updateLattice
public void updateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)
-
setVoxelSize
private void setVoxelSize()
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Overrides:
mouseReleased
in classVOIManagerInterface
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
-
-