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.JTextFielddefaultVoxelSizeprivate booleandoAnnotationsprivate booleandoAutomaticLabelsprivate booleanisShiftSelectedprivate LatticeModellatticeModelprivate booleanmouseSelection3Dprivate booleanmovingPickedPointprivate javax.swing.JDialogupdateVoxelSizestatic floatVoxelSize-
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 voidactionPerformed(java.awt.event.ActionEvent event)voidadd3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect)voidadd3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect, boolean isShift)voidaddAnnotation(VOI textVOI)Add an annotation to the latticeModel.voidaddAnnotation(VOI textVOI, boolean multiSelect)Add an annotation to the latticeModel.voidaddAnnotationListener(AnnotationListener listener)Adds an annotation listener to the latticeModel.voidaddAnnotations(VOIVector annotations)voidaddCurveListener(CurveListener listener)voidaddLatticeListener(LatticeListener listener)private voidaddLeftRightMarker(VOI textVOI, boolean isShift)voidaddSplineControlPts(java.util.Vector<VOIWormAnnotation> controlPts)voidaddVOI(VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished)Add a new VOIBase.voidclear3DSelection()voidcolorAnnotations(boolean setColor)voiddeleteAnnotations()voiddeleteSelectedCurve()voiddeleteSelectedPoint()booleandoAutomaticLabels()Returns the automatic labels flag.voideditAnnotations(boolean automaticLabels)Enable editing annotations in either 3D or 2D windows with the mouse.voideditClip()voideditLattice()static VOIBasefindNearestAnnotation(VOI annotations, WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)voidflipLattice()WildMagic.LibGraphics.SceneGraph.TriMeshgenerateTriMesh(int stepsize)java.lang.StringgetAnnotationPrefix()VOIgetAnnotations()Returns list of annotations from lattice model.VOIgetAnnotationsStraight()intgetCurrentIndex()VOIVectorgetLattice()intgetLatticeCurveLength()WildMagic.LibFoundation.Mathematics.Vector3fgetLatticePickedPoint()VOIVectorgetLatticeStraight()java.util.Vector<VOIWormAnnotation>getPickedAnnotation()java.util.Vector<java.lang.String>getSplineCurves()booleanhasSelectedPoint()protected voidinitVOIManagers(int iNViews)booleanis3DSelectionEnabled()booleanisCurveSelected(java.lang.String name)booleanisEditAnnotations()booleanisModelDisplayed()booleanisPreview()booleanisShift()voidkeyPressed(java.awt.event.KeyEvent e)voidkeyReleased(java.awt.event.KeyEvent e)booleanmodify3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)private booleanmodifyAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f pt)private booleanmodifyLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)voidmouseReleased(java.awt.event.MouseEvent e)voidmoveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction)voidopenAnnotations(java.lang.String directory, java.lang.String fileName)voidopenLattice(java.lang.String directory, java.lang.String fileName)voidopenNeuriteCurves(java.lang.String dir)protected voidredoVOIs()voidremoveListeners()VOIretwistAnnotations(VOIVector lattice)VOIVectorretwistLattice(VOIVector lattice)voidsaveLattice(java.lang.String directory, java.lang.String fileName)voidsaveNeuriteCurves()booleanselect3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect, boolean isShift)private booleanselectAnnotations(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)private booleanselectLattice(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean isShift)voidsetAnnotationPrefix(java.lang.String s)voidsetAnnotations(VOI annotations)voidsetAnnotations(VOIVector 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 imageA, ModelImage imageB)Set the new imageA and imageB for creating VOIs.voidsetLattice(VOIVector lattice)voidsetLatticeClip(boolean clip, int position)voidsetPaddingFactor(int padding)voidsetPreviewMode(boolean preview, VOIVector lattice, VOI annotations)voidsetSharedDirectory(java.lang.String dir)private voidsetVoxelSize()voidshowLattice(boolean display)voidshowLatticeLabels(boolean display)voidshowModel(boolean display)protected voidundoVOIs()ModelImageuntwistAnnotations(java.lang.String dir, ModelImage image)ModelImage[]untwistTest(VolumeImage[] stack)Untwists the worm image quickly for the preview mode - without saving any images or statisticsvoidupdateAnnotation(VOIText annotation)voidupdateCrossSection(boolean useSpline, boolean ellipse, float percent)voidupdateLattice(boolean isLeft, VOIWormAnnotation text, VOIWormAnnotation newText)voidupdateManager(int index, int orientation)voidupdateSelectedPoint(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:
actionPerformedin interfacejava.awt.event.ActionListener- Overrides:
actionPerformedin 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:
initVOIManagersin classVOIManagerInterface
-
redoVOIs
protected void redoVOIs()
- Overrides:
redoVOIsin classVOIManagerInterface
-
undoVOIs
protected void undoVOIs()
- Overrides:
undoVOIsin 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:VOIManagerInterfaceAdd a new VOIBase. This function should only be called from VOIManager when a new VOIBase is created with the mouse.- Overrides:
addVOIin 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:
mouseReleasedin interfacejava.awt.event.MouseListener- Overrides:
mouseReleasedin classVOIManagerInterface
-
keyPressed
public void keyPressed(java.awt.event.KeyEvent e)
-
keyReleased
public void keyReleased(java.awt.event.KeyEvent e)
-
-