Class VOIManagerInterface
java.lang.Object
gov.nih.mipav.view.renderer.WildMagic.VOI.VOIManagerInterface
- All Implemented Interfaces:
VOIListener,VOIVectorListener,VOIHandlerInterface,ActionListener,MouseListener,MouseMotionListener,EventListener,MouseInputListener
- Direct Known Subclasses:
VOILatticeManagerInterface
public class VOIManagerInterface
extends Object
implements ActionListener, VOIHandlerInterface, VOIListener, VOIVectorListener
VOIManagerInterface manages all the VOI user-interaction for classes that display the ModelImage.
ViewJFrameImage, ViewJFrameTriImage, ViewJFrameRegistration, ViewJFrameRegistrationTool, and
the VolumeTriPlanarInterface class for the GPU-based volume renderer.
This class further divides the VOI user-interaction into actions that occur within a single canvas and actions
that are shared across canvases. All user-interaction that occurs within a single canvas, for example
direct user-manipulation of a single VOI contour, adding points, moving points, etc. are managed by the
VOIManager class. The ViewJFrameTriImage has three canvases when displaying a single ModelImage. Each
canvas is tied to a separate VOIManager class, which handles all the direct user-manipulation of the VOIs
it displays. The VOIManagerInterface class contains the three VOIManagers and handles the communication
between the VOIManager and the VOI, the ModelImage containing the VOI, and the class displaying the ModelImage.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classPick up the selected color and call method to change the color. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ViewJColorChooserReference to the color chooser.protected ColorRestores the VOI color button after QuickLUT.protected JDialogVOIStatisticsStatistics dialog VOI->Statistics generator...protected EventListenerListcreated to handle VOI updates.private WildMagic.LibFoundation.Mathematics.Vector3f[]Bounding box for a group of selected VOIs for group-move.private booleanprivate booleanSet to true if this VOIManagerInterface is used for the GPU-based Volume Rendererprivate floatOpacity for setting the JDialogOpacityControls, used for VOI opacity.private intThe index of the current active VOIManager.private intList of active VOIBase for a moving several selected VOIs.protected VOIThe current active VOIprotected ModelImageReference to imageAprivate ObjectSingle-level undo/redo for image masks, re-do-imageA:private ObjectSingle-level undo/redo for image masks, undo-imageA:protected ModelImageReference to imageBprivate ObjectSingle-level undo/redo for image masks, re-do-imageB:private ObjectSingle-level undo/redo for image masks, undo-imageB:protected VOIManagerInterfaceListenerReference to the parent frame.private JToggleButtonThe Default pointer button is set from outside this class if the default pointer button is not part of the VOI toolbar, or if the VOI toolbar is not displayed.List of re-do commandsprotected Vector<VOISaveState> Saved VOI states for re-do.private ModelImageList of undo commandsprotected Vector<VOISaveState> Saved VOI states for undo.protected JDialogVOIStatsVOI Properties dialog -- from the popup menu or drop-down menu.private JDialogVOIHausdorffDistanceprivate JDialogVOILogicalOperationsprotected Vector<VOIManager> List of VOIManagers, one per canvas displayed.private JToolBarReference to the VOI toolbar.protected ViewJPopupVOIPopup Menu for VOIs (non-point).protected ViewJPopupPtPopup Menu for VOIPoints.private floatprotected VolumeTriPlanarRenderBaseprotected VOIRestores the current VOI after QuickLUT.private ViewToolBarBuilderThe toolbar builder that constructs the VOI toolbar -- it stores the VOI color button.protected JMenuprotected ViewMenuBuilderprivate intVOI ID used to set the VOI color button on a call to newVOI() -
Constructor Summary
ConstructorsConstructorDescriptionVOIManagerInterface(VOIManagerInterfaceListener kParent, ModelImage kImageA, ModelImage kImageB, int iNViews, boolean bGPU, ButtonGroup kVOIGroup) Creates a VOIManagerInterface object. -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) voidaddedCurve(VOIEvent added) handles an VOIEvent as a selection change.voidaddedVOI(VOIVectorEvent newVOIselection) handles an VOIEvent as a selection change.private voidaddVOI(ModelImage kImage, VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished) voidAdd a new VOIBase.addVOIManager(ModelImage kImageA, ModelImage kImageB, Component kComponent, ScreenCoordinateListener kContext, int iOrientation) voidAdds a UpdateVOISelectionListener.private voidIncrements the VOI uid for internal tracking, used during both creation and loading of a new VOIvoidprivate voidchangeVOIOrder(boolean doContour, int direction) private booleanprivate voidclearList(Vector<VOISaveState> list, int limit) voidvoidprivate intcopy()private voidcreateMask(ModelImage kActive, boolean bInside) private voidcreateMask(String command) private intcut()private voidprivate voidvoiddeleteSelectedVOI(boolean contoursOnly) Delete the selected VOI.voidDeletes the input VOIBase from the VOI.private voidvoidDelete all VOIs.voiddisposeLocal(boolean flag) Dispose of the implementing class.voidPerforms the VOI Action Command.private voidevolveBoundary2D(String command) private voidextractNumber(String str) private voidfindCompatibleType(ModelImage kImage, VOIBase kNew, boolean isFinished) voidCommunicates a selection change to all UpdateVOISelectionListeners.voidfireVOISelectionChange(VOI voi, VOIBase curve) Communicates a selection change to all UpdateVOISelectionListeners.Returns the current active image.private intfinal floatgetBufferFloat(byte[] buffer, int index, boolean bigEndian) Converts byte data to float data.final intgetBufferInt(byte[] buffer, int index, boolean bigEndian) Converts byte data to int data.final shortgetBufferShort(byte[] buffer, int index, boolean bigEndian) Converts byte data to short data.final shortgetByte(byte[] buffer, int index) Returns the Component displaying the current active image.private JFramegetFrame()Returns the pointer button, used by VOIManager to determine if the pointer button is active.private intgetSegment(float[] array, float[] seg, int index) private intgetSlice()Returns the VOIToolbar.intgetVOIManager(int i) Returns the VOIManager at the given position.intReturns the number of VOIManagers controlled by this VOIHandler.protected VOISaveStatevoidgraph25VOI_CalcInten(boolean totalIntensity, boolean useThreshold, float threshold) Generates and displays a 1D graph of the average or total intensity of 2.5 VOI of 2.5D image (3D).private voidgraphPointVOI(VOI v, VOIPoint voiPt, int j, boolean useFrameRefTime) private voidgraphVOI()private voidgraphVOICurvature(boolean smooth) private voidprivate voidprotected voidinitVOIManagers(int iNViews) private voidprivate booleanisDrawCommand(String kCommand) booleanisNewVoiNeeded(int voiType) private voidprotected voidloadAllImageJVOIsFrom(String voiDir, boolean quietMode, VOIVector resultVector, boolean registerVOIs) This method loads all ImageJ VOIs to the active image from a given directory.private voidloadAllVOIs(boolean quietMode) This method loads all VOIs to the active image from the default VOI directory for that image.private voidloadAllVOIsFrom(String voiDir, boolean quietMode) This method loads all VOIs to the active image from a given directory.protected voidloadAllVOIsFrom(String voiDir, boolean quietMode, VOIVector resultVector, boolean registerVOIs) This method loads all VOIs to the active image from a given directory.booleanmake3DVOI(boolean bIntersection, ModelImage kVolume) Creates a 3D Surface out of the VOIs.private booleanmake3DVOI(boolean bIntersection, ModelImage kSrc, ModelImage kVolume, BitSet kMask, VOIManager kManager, int iValue) private voidprivate booleanmatches(int iType1, int iType2, boolean isFinished) voidmouseClicked(MouseEvent event) voidmouseDragged(MouseEvent arg0) voidvoidvoidmouseMoved(MouseEvent arg0) voidvoidvoidmoveVOI(VOIManager kActive, WildMagic.LibFoundation.Mathematics.Vector3f kDiff, int iPlane, boolean bFirstMove, boolean bUseMouse) Called from the VOIManager class when multiple contours are selected and moved as a group.voidvoidnewVOI(boolean bPropagate, boolean bSplit) Initiate a new VOI.voidnewVOI(float presetHue) Initiate a new VOI.private booleanopenOtherOrientationVOI(boolean quietMode) private booleanopenPaint(boolean quietMode) private booleanopenVOI(boolean quietMode, boolean doLabels) This method opens an existing VOI.private voidprivate voidpaste()private voidpasteAll()private voidvoidPaste the input VOIBase.private voidpropagate(int dir) booleanpropVOI(int direction, boolean active) Propagates the selected VOI in a given direction.booleanPropagates the selected VOI to all slices.voidCalled from the VOIManager class when a user has drawn the QuickLUT rectangle.private voidquickLUT(WildMagic.LibFoundation.Mathematics.Vector3f[] akMinMax, ModelImage image, ModelLUT LUT) method that performs the quick LUT operationprivate voidquickRGB(WildMagic.LibFoundation.Mathematics.Vector3f[] akMinMax, ModelImage image, ModelRGB RGB) DOCUMENT ME!private voidreadCSV(String fileName, ModelImage image) private voidreadFreesurferBinaryPatch(String fileName, ModelImage image) private voidreadImageJ(String pathName, String fileName, ModelImage image) private voidprivate voidredoVOI()protected voidredoVOIs()voidremovedCurve(VOIEvent removed) handles to the VOI being removed from the Vector.voidremovedVOI(VOIVectorEvent removed) handles to the VOI being removed from the Vector.voidremoveVOIManager(VOIManager kVOIManager) voidRemoves the UpdateVOISelectionListener from the list.voidResets the current livewire VOI.private voidThis method saves all VOIs for the active image to the default VOI directory for that image.private voidsaveAllVOIsTo(String voiDir) This method saves all VOIs for the active image to a given directory.private voidSave the dicom matrix header info.private voidsaveLabels(boolean saveAll) private voidprivate voidThis method allows the user to choose how to save the paint bitmap.private voidsaveVOI(boolean saveAllContours) This method saves a selected VOIprivate voidsaveVOIAs(boolean saveAllContours) This method allows the user to choose how to save the VOI.private voidSave intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex.private voidsaveVOIIntensitiesTo(String voiIntensitiesPath) Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex.voidSave the current VOIState to the undo/re-do list.voidselectAllVOIs(boolean bActive) Selects all VOIs.voidselectedVOI(VOIEvent selection) handles the VOI being selected. -- a state-change.voidsetActive(VOIManager kManager, ModelImage kActiveImage) Called from the VOIManager.voidsetButtonColor(JButton _button, Color _color) Set the color of the button.voidsetCenter(WildMagic.LibFoundation.Mathematics.Vector3f center) Sets the current displayed slice for 3D images.voidsetCenter(WildMagic.LibFoundation.Mathematics.Vector3f center, boolean bParent) Sets the current displayed slice for 3D images.private voidvoidCalled from VOIManager to change the mouse cursor.voidCalled from VOIManager to set the default mouse cursor.voidsetEnabled(boolean flag) Currently not used.private voidvoidsetOpacity(float fVal) Called from JDialogOpacityControls.private voidvoidsetPointerButton(JToggleButton button) Called when the Default Pointer Button is not part of the default VOI Toolbar.voidsetPresetHue(float presetHue) Sets the hue that will be used to draw the new VOI.voidsetRenderer(VolumeTriPlanarRenderBase renderer) voidsetSelectedVOI(VOI kSelected, boolean bSelectAll, boolean bUnSelectVOI) Called from the VOIManager when a new VOI is selected by the mouse.voidsetVOI_IDs(int ID, int UID) This function is deprecated.protected voidsetVOIState(VOISaveState kVOIState) voidsetVOITools(JMenu voiMenu, ViewMenuBuilder voiMenuBuilder) voidOpens the color dialog for changing the selected VOI color.voidshowCurvatureInfo(VOIBase kVOI, int m_iPlane, boolean showGraph, boolean smoothCurvature) Called from the VOIManager.voidshowIntensityInfo(VOIBase kVOI, int m_iPlane, boolean showGraph) Called from the VOIManager.protected voidOpens a JDialogStatistics to allow computation ofROI statistics.protected voidprivate voidprivate voidundoVOI()protected voidundoVOIs()voidCalled from VOIManager.voidupdateGraph(VOIBase kVOI, int m_iPlane) Called from the VOIManager when the VOIBase that is currently being graphed has changed.voidvectorSelected(VOIVectorEvent selection) handles the VOI being selected.
-
Field Details
-
m_kParent
Reference to the parent frame. -
m_kImageA
Reference to imageA -
m_kImageB
Reference to imageB -
toolbarBuilder
The toolbar builder that constructs the VOI toolbar -- it stores the VOI color button. -
m_kVOIToolbar
Reference to the VOI toolbar. -
colorChooser
Reference to the color chooser. -
m_kVOIManagers
List of VOIManagers, one per canvas displayed. -
m_iActive
private int m_iActiveThe index of the current active VOIManager. -
voiUID
private int voiUIDVOI ID used to set the VOI color button on a call to newVOI() -
m_kCurrentVOIGroup
The current active VOI -
m_kUndoCommands
List of undo commands -
m_kRedoCommands
List of re-do commands -
m_fOpacity
private float m_fOpacityOpacity for setting the JDialogOpacityControls, used for VOI opacity. -
m_bGPURenderer
private boolean m_bGPURendererSet to true if this VOIManagerInterface is used for the GPU-based Volume Renderer -
renderer
-
m_kVOIDialog
VOI Properties dialog -- from the popup menu or drop-down menu. -
m_kVOILogicalOperationsDialog
-
m_kVOIHausdorffDistanceDialog
-
m_iMaxUndo
private int m_iMaxUndo -
m_kUndoList
Saved VOI states for undo. -
m_kRedoList
Saved VOI states for re-do. -
m_kImageAUndo
Single-level undo/redo for image masks, undo-imageA: -
m_kImageARedo
Single-level undo/redo for image masks, re-do-imageA: -
m_kImageBUndo
Single-level undo/redo for image masks, undo-imageB: -
m_kImageBRedo
Single-level undo/redo for image masks, re-do-imageB: -
m_akBounds
private WildMagic.LibFoundation.Mathematics.Vector3f[] m_akBoundsBounding box for a group of selected VOIs for group-move. -
listenerList
created to handle VOI updates. Must fireVOIUpdate(...) to get listeners to handle the update. Perhaps better location for the VOIupdate is inViewJCompoenentEditImage, but this listenerlist will handle listeners of more than one type. -
popup
Popup Menu for VOIs (non-point). -
popupPt
Popup Menu for VOIPoints. -
currentColor
Restores the VOI color button after QuickLUT. -
saveGroup
Restores the current VOI after QuickLUT. -
m_kActiveList
List of active VOIBase for a moving several selected VOIs. -
m_kPointerButton
The Default pointer button is set from outside this class if the default pointer button is not part of the VOI toolbar, or if the VOI toolbar is not displayed. The VOIManagers query the default pointer button to determine if VOI interaction is enabled. -
imageStatList
Statistics dialog VOI->Statistics generator... -
presetHue
private float presetHue -
m_bDefaultImage
private boolean m_bDefaultImage -
m_kTempImage
-
voiMenu
-
voiMenuBuilder
-
-
Constructor Details
-
VOIManagerInterface
public VOIManagerInterface(VOIManagerInterfaceListener kParent, ModelImage kImageA, ModelImage kImageB, int iNViews, boolean bGPU, 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 Details
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
addedCurve
Description copied from interface:VOIListenerhandles an VOIEvent as a selection change.- Specified by:
addedCurvein interfaceVOIListener- Parameters:
added- DOCUMENT ME!
-
addedVOI
Description copied from interface:VOIVectorListenerhandles an VOIEvent as a selection change.- Specified by:
addedVOIin interfaceVOIVectorListener- Parameters:
newVOIselection- DOCUMENT ME!
-
addVOI
Add a new VOIBase. This function should only be called from VOIManager when a new VOIBase is created with the mouse.- 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.
-
addVOIManager
public VOIManager addVOIManager(ModelImage kImageA, ModelImage kImageB, Component kComponent, ScreenCoordinateListener kContext, int iOrientation) -
addVOIUpdateListener
Adds a UpdateVOISelectionListener.- Specified by:
addVOIUpdateListenerin interfaceVOIHandlerInterface- Parameters:
listener- will receive VOI selection events.
-
algorithmPerformed
public void algorithmPerformed() -
colorChanged
- Specified by:
colorChangedin interfaceVOIListener
-
deleteSelectedVOI
public void deleteSelectedVOI(boolean contoursOnly) Description copied from interface:VOIHandlerInterfaceDelete the selected VOI. This function is deprecated, replace with actionPerformed() using CustomUIBuilder.PARAM_VOI_DELETE- Specified by:
deleteSelectedVOIin interfaceVOIHandlerInterface- Parameters:
contoursOnly- when true only delete the selected contours in the VOI, do not delete the VOI.
-
deleteVOI
Deletes the input VOIBase from the VOI. If it is the only VOIBase in the VOI, that VOI is removed from the ModelImage. This function is called from VOIManager.- Parameters:
kOld- the VOIBase to remove.
-
deleteVOIs
public void deleteVOIs()Description copied from interface:VOIHandlerInterfaceDelete all VOIs.- Specified by:
deleteVOIsin interfaceVOIHandlerInterface
-
disposeLocal
public void disposeLocal(boolean flag) Description copied from interface:VOIHandlerInterfaceDispose of the implementing class.- Specified by:
disposeLocalin interfaceVOIHandlerInterface- Parameters:
flag- not used.
-
doVOI
Performs the VOI Action Command. See CustomUIBuilder. This function should be replaced withe actionPerformed(ActionEvent).- Parameters:
kCommand- VOI action command.
-
fireVOISelectionChange
Description copied from interface:VOIHandlerInterfaceCommunicates a selection change to all UpdateVOISelectionListeners.- Specified by:
fireVOISelectionChangein interfaceVOIHandlerInterface- Parameters:
voi- the modified VOI.
-
fireVOISelectionChange
Description copied from interface:VOIHandlerInterfaceCommunicates a selection change to all UpdateVOISelectionListeners.- Specified by:
fireVOISelectionChangein interfaceVOIHandlerInterface- Parameters:
voi- modified VOI.curve- modified VOIBase.
-
getActiveImage
Description copied from interface:VOIHandlerInterfaceReturns the current active image.- Specified by:
getActiveImagein interfaceVOIHandlerInterface- Returns:
- current active image.
-
getComponentImage
Description copied from interface:VOIHandlerInterfaceReturns the Component displaying the current active image.- Specified by:
getComponentImagein interfaceVOIHandlerInterface- Returns:
- the Component displaying the current active image.
-
getPointerButton
Returns the pointer button, used by VOIManager to determine if the pointer button is active.- Returns:
- current pointer button.
-
getToolBar
Returns the VOIToolbar.- Returns:
- VOIToolbar.
-
getVOI_ID
public int getVOI_ID()- Specified by:
getVOI_IDin interfaceVOIHandlerInterface- Returns:
- 0.
-
getVOIManager
Returns the VOIManager at the given position.- Parameters:
i- the index of the VOIManager to return.- Returns:
- VOIManager.
-
getVOIManagerNum
public int getVOIManagerNum()Returns the number of VOIManagers controlled by this VOIHandler. -
graph25VOI_CalcInten
public void graph25VOI_CalcInten(boolean totalIntensity, boolean useThreshold, float threshold) Description copied from interface:VOIHandlerInterfaceGenerates and displays a 1D graph of the average or total intensity of 2.5 VOI of 2.5D image (3D).- Specified by:
graph25VOI_CalcIntenin interfaceVOIHandlerInterface- Parameters:
totalIntensity- if true calculates total sum of the intensity else calculates the average pixel intensityuseThreshold- whether or not to threshold this intensity plotthreshold- the threshold value to use, if thresholding.
-
isNewVoiNeeded
public boolean isNewVoiNeeded(int voiType) - Specified by:
isNewVoiNeededin interfaceVOIHandlerInterface- Parameters:
voiType-- Returns:
- false
-
make3DVOI
Creates a 3D Surface out of the VOIs.- Parameters:
bIntersection- when true the intersection of the VOIs is used to create the surface, when false a union of the VOIs is used to create the surface.kVolume- ModelImage, the union or intersection is written into the input ModelImage.- Returns:
- true if success, false if no voxels are in the union or intersection.
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
moveVOI
-
moveVOI
public void moveVOI(VOIManager kActive, WildMagic.LibFoundation.Mathematics.Vector3f kDiff, int iPlane, boolean bFirstMove, boolean bUseMouse) Called from the VOIManager class when multiple contours are selected and moved as a group. This function calculates the group bounding box and tests the move to ensure the contours are not moved out of the image bounds.- Parameters:
kActive- VOIManager initiating the call.kDiff- the move distanceiPlane- the plane of the VOIManager (equivalent to Axial, Coronal, Sagittal)bFirstMove- true if this is the first move for the selected group of contours.
-
newVOI
public void newVOI(boolean bPropagate, boolean bSplit) Initiate a new VOI.- Parameters:
bPropagate- when true propagate the newVOI command to the VOIManagers.bSplit- true if this is a new SplitVOI.
-
newVOI
public void newVOI(float presetHue) Description copied from interface:VOIHandlerInterfaceInitiate a new VOI.- Specified by:
newVOIin interfaceVOIHandlerInterface- Parameters:
presetHue- new VOI color
-
pasteVOI
Paste the input VOIBase.- Parameters:
kNew- the enw VOIBase to paste.
-
propVOI
public boolean propVOI(int direction, boolean active) Description copied from interface:VOIHandlerInterfacePropagates the selected VOI in a given direction. This function is deprecated, replace with actionPerformed(ActionEvent) using CustomUIBuilder.PARAM_VOI_PROPAGATE_UP or CustomUIBuilder.PARAM_VOI_PROPAGATE_DOWN- Specified by:
propVOIin interfaceVOIHandlerInterface- Parameters:
direction- Up +1, or Down -1active- unused.- Returns:
- true if success, false otherwise
-
propVOIAll
public boolean propVOIAll()Description copied from interface:VOIHandlerInterfacePropagates the selected VOI to all slices. This function is deprecated, replace with actionPerformed(ActionEvent) using CustomUIBuilder.PARAM_VOI_PROPAGATE_ALL.- Specified by:
propVOIAllin interfaceVOIHandlerInterface- Returns:
- true if success, false otherwise
-
quickLUT
Called from the VOIManager class when a user has drawn the QuickLUT rectangle. This function calculates the new LUT and updates the images.- Parameters:
kLUT- VOIBase defining the QuickLUT rectangle.
-
removedCurve
Description copied from interface:VOIListenerhandles to the VOI being removed from the Vector.- Specified by:
removedCurvein interfaceVOIListener- Parameters:
removed- DOCUMENT ME!
-
removedVOI
Description copied from interface:VOIVectorListenerhandles to the VOI being removed from the Vector.- Specified by:
removedVOIin interfaceVOIVectorListener- Parameters:
removed- DOCUMENT ME!
-
removeVOIManager
-
removeVOIUpdateListener
Description copied from interface:VOIHandlerInterfaceRemoves the UpdateVOISelectionListener from the list.- Specified by:
removeVOIUpdateListenerin interfaceVOIHandlerInterface- Parameters:
listener- the UpdateVOIselectionListener to remove.
-
resetLivewire
public void resetLivewire()Description copied from interface:VOIHandlerInterfaceResets the current livewire VOI.- Specified by:
resetLivewirein interfaceVOIHandlerInterface
-
saveVOIs
Save the current VOIState to the undo/re-do list.- Parameters:
kCommand- the VOI Action Command about to be issued.
-
clearUndoRedo
public void clearUndoRedo() -
selectAllVOIs
public void selectAllVOIs(boolean bActive) Description copied from interface:VOIHandlerInterfaceSelects all VOIs. This function is deprecated, replace with actionPerformed(ActionEvent) using CustomUIBuilder.PARAM_VOI_SELECT_ALL and CustomUIBuilder.PARAM_VOI_SELECT_NONE- Specified by:
selectAllVOIsin interfaceVOIHandlerInterface- Parameters:
bActive-
-
selectedVOI
Description copied from interface:VOIListenerhandles the VOI being selected. -- a state-change.- Specified by:
selectedVOIin interfaceVOIListener- Parameters:
selection- DOCUMENT ME!
-
setActive
Called from the VOIManager. Sets the current active VOIManager.- Parameters:
kManager- calling VOIManager.
-
setButtonColor
Set the color of the button. Derived classes may also perform other functions.- Parameters:
_button- button._color- color.
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center) Description copied from interface:VOIHandlerInterfaceSets the current displayed slice for 3D images. The current center is the slice value of the three orthogonal planes displayed in the ViewJFrameTriImage. When this function is called from ViewJFrameImage the X,Y, parameters are ignored and current slice is the Z-value.- Specified by:
setCenterin interfaceVOIHandlerInterface- Parameters:
center- ModelImage file coordinates representation of the slice values of the three orthogonal image planes.
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center, boolean bParent) Description copied from interface:VOIHandlerInterfaceSets the current displayed slice for 3D images. The current center is the slice value of the three orthogonal planes displayed in the ViewJFrameTriImage. When this function is called from ViewJFrameImage the X,Y, parameters are ignored and current slice is the Z-value.- Specified by:
setCenterin interfaceVOIHandlerInterface- Parameters:
center- ModelImage file coordinates representation of the slice values of the three orthogonal image planes.bParent- when true call parent.setCenter()
-
setCursor
Called from VOIManager to change the mouse cursor.- Parameters:
kCursor- new Cursor.
-
setDefaultCursor
public void setDefaultCursor()Called from VOIManager to set the default mouse cursor. This function triggers events in the parent frame. -
setEnabled
public void setEnabled(boolean flag) Currently not used.- Parameters:
flag-
-
setOpacity
public void setOpacity(float fVal) Called from JDialogOpacityControls. Sets the VOI opacity.- Parameters:
fVal- VOI opacity.
-
setPointerButton
Called when the Default Pointer Button is not part of the default VOI Toolbar.- Parameters:
button- default pointer button.
-
setPresetHue
public void setPresetHue(float presetHue) Description copied from interface:VOIHandlerInterfaceSets the hue that will be used to draw the new VOI.- Specified by:
setPresetHuein interfaceVOIHandlerInterface- Parameters:
presetHue- the hue to be used
-
setRenderer
-
setSelectedVOI
Called from the VOIManager when a new VOI is selected by the mouse.- Parameters:
kSelected- selected VOI.bSelectAll- when true select all contours in the VOI (usually shift-key is down).bUnSelectVOI- when true unselect the previously selected VOI (if the control-key is down multiple different VOIs can be selected).
-
setVOI_IDs
public void setVOI_IDs(int ID, int UID) Description copied from interface:VOIHandlerInterfaceThis function is deprecated.- Specified by:
setVOI_IDsin interfaceVOIHandlerInterface- Parameters:
ID- not used.UID- not used.
-
setVOITools
-
showColorDialog
public void showColorDialog()Description copied from interface:VOIHandlerInterfaceOpens the color dialog for changing the selected VOI color.- Specified by:
showColorDialogin interfaceVOIHandlerInterface
-
showCurvatureInfo
public void showCurvatureInfo(VOIBase kVOI, int m_iPlane, boolean showGraph, boolean smoothCurvature) Called from the VOIManager. Displays the Curvature Graph for the input VOIBase.- Parameters:
kVOI- VOIBase to graph.m_iPlane- the plane on which to show intensity infoshowGraph-smooth-
-
showIntensityInfo
Called from the VOIManager. Displays the Intensity Graph for the input VOIBase.- Parameters:
kVOI- VOIBase to graph.m_iPlane- the plane on which to show intensity info
-
updateDisplay
public void updateDisplay()Called from VOIManager. Causes the parent frame to redraw the ModelImage and VOIs. -
updateGraph
Called from the VOIManager when the VOIBase that is currently being graphed has changed.- Parameters:
kVOI- the modified VOIBase.
-
vectorSelected
Description copied from interface:VOIVectorListenerhandles the VOI being selected.- Specified by:
vectorSelectedin interfaceVOIVectorListener- Parameters:
selection- DOCUMENT ME!
-
addVOI
private void addVOI(ModelImage kImage, VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished) -
advanceVOIUID
private void advanceVOIUID()Increments the VOI uid for internal tracking, used during both creation and loading of a new VOI -
changeVOIOrder
private void changeVOIOrder(boolean doContour, int direction) -
checkForActiveVOIs
private boolean checkForActiveVOIs() -
clearList
-
copy
private int copy() -
createMask
-
createMask
-
cut
private int cut() -
deleteActiveVOI
private void deleteActiveVOI() -
deleteAllVOI
private void deleteAllVOI() -
deleteVOIActivePt
private void deleteVOIActivePt() -
evolveBoundary2D
-
findCompatibleType
-
getActiveVOICount
private int getActiveVOICount() -
getFrame
-
getSlice
private int getSlice() -
getVOIState
-
graphPointVOI
-
graphVOI
private void graphVOI() -
graphVOICurvature
private void graphVOICurvature(boolean smooth) -
indentationVOIs2D
private void indentationVOIs2D() -
interpolateVOIs
private void interpolateVOIs() -
isDrawCommand
-
loadAllVOIs
private void loadAllVOIs(boolean quietMode) This method loads all VOIs to the active image from the default VOI directory for that image.- Parameters:
quietMode- if true indicates that warnings should not be displayed.
-
loadAllVOIsFrom
This method loads all VOIs to the active image from a given directory.- Parameters:
voiDir- the directory to load voi's fromquietMode- if true indicates that warnings should not be displayed.
-
loadAllVOIsFrom
protected void loadAllVOIsFrom(String voiDir, boolean quietMode, VOIVector resultVector, boolean registerVOIs) This method loads all VOIs to the active image from a given directory.- Parameters:
voiDir- the directory to load voi's fromquietMode- if true indicates that warnings should not be displayed.
-
loadAllImageJVOIsFrom
protected void loadAllImageJVOIsFrom(String voiDir, boolean quietMode, VOIVector resultVector, boolean registerVOIs) This method loads all ImageJ VOIs to the active image from a given directory.- Parameters:
voiDir- the directory to load voi's fromquietMode- if true indicates that warnings should not be displayed.
-
make3DVOI
private boolean make3DVOI(boolean bIntersection, ModelImage kSrc, ModelImage kVolume, BitSet kMask, VOIManager kManager, int iValue) -
matches
private boolean matches(int iType1, int iType2, boolean isFinished) -
openVOI
private boolean openVOI(boolean quietMode, boolean doLabels) This method opens an existing VOI.- Parameters:
quietMode- if true indicates that warnings should not be displayed.doLabels- DOCUMENT ME!- Returns:
- whether a VOI was successfully opened (ie - the dialog wasn't cancelled)
-
openOtherOrientationVOI
private boolean openOtherOrientationVOI(boolean quietMode) -
openPaint
private boolean openPaint(boolean quietMode) -
paintToVOI
private void paintToVOI() -
paste
private void paste() -
levelSet3D
private void levelSet3D() -
pasteAll
private void pasteAll() -
pasteFromViewUserInterface
private void pasteFromViewUserInterface() -
propagate
private void propagate(int dir) -
quickLUT
private void quickLUT(WildMagic.LibFoundation.Mathematics.Vector3f[] akMinMax, ModelImage image, ModelLUT LUT) method that performs the quick LUT operation- Parameters:
akMinMax-image-LUT-
-
quickRGB
private void quickRGB(WildMagic.LibFoundation.Mathematics.Vector3f[] akMinMax, ModelImage image, ModelRGB RGB) DOCUMENT ME!- Parameters:
image- DOCUMENT ME!RGB- DOCUMENT ME!xS- DOCUMENT ME!wS- DOCUMENT ME!yS- DOCUMENT ME!hS- DOCUMENT ME!imageBuffer- DOCUMENT ME!
-
redoImage
private void redoImage() -
redoVOI
private void redoVOI() -
redoVOIs
protected void redoVOIs() -
saveAllVOIs
private void saveAllVOIs()This method saves all VOIs for the active image to the default VOI directory for that image. -
saveAllVOIsTo
This method saves all VOIs for the active image to a given directory.- Parameters:
voiDir- directory that contains VOIs for this image.
-
saveImage
Save the dicom matrix header info. The .ply file format can't save the dicom info. We decide to save the dicom info when save the VOI file. So, the dicom info will be read when load the .ply surface into the volume render. This ensures the correct scale of surface. The dicom matrix info is saved in the current image directory with the .dicomMatrix suffix. -
saveLabels
private void saveLabels(boolean saveAll) -
saveVOI
private void saveVOI(boolean saveAllContours) This method saves a selected VOI- Parameters:
saveAllContours- if true all contours are saved
-
saveVOIAs
private void saveVOIAs(boolean saveAllContours) This method allows the user to choose how to save the VOI.- Parameters:
saveAllContours- if true all contours are saved
-
exportSelectedVOIs
private void exportSelectedVOIs() -
importVOI
private void importVOI() -
savePaint
private void savePaint() -
savePaintAs
private void savePaintAs()This method allows the user to choose how to save the paint bitmap. -
saveVOIIntensities
private void saveVOIIntensities()Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex. If color use format x,y,z,a,r,g,b on each line and if complex use format x,y,z,real,imaginary on each line. -
saveVOIIntensitiesTo
Save intensities in VOI to a text file of format x,y,z,intensity on each line if not color or complex. If color use format x,y,z,a,r,g,b on each line and if complex use format x,y,z,real,imaginary on each line. -
setCurrentColor
private void setCurrentColor() -
setGraphVisible
private void setGraphVisible() -
setPAAIGraphVisible
private void setPAAIGraphVisible() -
setVOIState
-
undoImage
private void undoImage() -
undoVOI
private void undoVOI() -
undoVOIs
protected void undoVOIs() -
showStatisticsCalculator
protected void showStatisticsCalculator()Opens a JDialogStatistics to allow computation ofROI statistics. -
showVOIProperties
protected void showVOIProperties() -
initVOIManagers
protected void initVOIManagers(int iNViews) -
readImageJ
-
makeShapeFromArray
-
getSegment
private int getSegment(float[] array, float[] seg, int index) -
extractNumber
-
getBufferShort
public final short getBufferShort(byte[] buffer, int index, boolean bigEndian) Converts byte data to short data.- Parameters:
buffer- Array of byte data.index- Index into array data.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Returns:
- Short value extracted from byte array.
-
getByte
public final short getByte(byte[] buffer, int index) -
getBufferInt
public final int getBufferInt(byte[] buffer, int index, boolean bigEndian) Converts byte data to int data.- Parameters:
buffer- Array of byte data.index- Index into array data.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Returns:
- Integer value extracted from byte array.
-
getBufferFloat
public final float getBufferFloat(byte[] buffer, int index, boolean bigEndian) Converts byte data to float data.- Parameters:
buffer- Array of byte data.index- Index into array data.bigEndian-trueindicates big endian byte order,falseindicates little endian.- Returns:
- Float value extracted from byte array.
-
readCSV
-
readFreesurferBinaryPatch
-