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.
  • Field Details

    • m_kParent

      protected VOIManagerInterfaceListener m_kParent
      Reference to the parent frame.
    • m_kImageA

      protected ModelImage m_kImageA
      Reference to imageA
    • m_kImageB

      protected ModelImage m_kImageB
      Reference to imageB
    • toolbarBuilder

      private ViewToolBarBuilder toolbarBuilder
      The toolbar builder that constructs the VOI toolbar -- it stores the VOI color button.
    • m_kVOIToolbar

      private JToolBar m_kVOIToolbar
      Reference to the VOI toolbar.
    • colorChooser

      protected ViewJColorChooser colorChooser
      Reference to the color chooser.
    • m_kVOIManagers

      protected Vector<VOIManager> m_kVOIManagers
      List of VOIManagers, one per canvas displayed.
    • m_iActive

      private int m_iActive
      The index of the current active VOIManager.
    • voiUID

      private int voiUID
      VOI ID used to set the VOI color button on a call to newVOI()
    • m_kCurrentVOIGroup

      protected VOI m_kCurrentVOIGroup
      The current active VOI
    • m_kUndoCommands

      private Vector<String> m_kUndoCommands
      List of undo commands
    • m_kRedoCommands

      private Vector<String> m_kRedoCommands
      List of re-do commands
    • m_fOpacity

      private float m_fOpacity
      Opacity for setting the JDialogOpacityControls, used for VOI opacity.
    • m_bGPURenderer

      private boolean m_bGPURenderer
      Set to true if this VOIManagerInterface is used for the GPU-based Volume Renderer
    • renderer

      protected VolumeTriPlanarRenderBase renderer
    • m_kVOIDialog

      protected JDialogVOIStats m_kVOIDialog
      VOI Properties dialog -- from the popup menu or drop-down menu.
    • m_kVOILogicalOperationsDialog

      private JDialogVOILogicalOperations m_kVOILogicalOperationsDialog
    • m_kVOIHausdorffDistanceDialog

      private JDialogVOIHausdorffDistance m_kVOIHausdorffDistanceDialog
    • m_iMaxUndo

      private int m_iMaxUndo
    • m_kUndoList

      protected Vector<VOISaveState> m_kUndoList
      Saved VOI states for undo.
    • m_kRedoList

      protected Vector<VOISaveState> m_kRedoList
      Saved VOI states for re-do.
    • m_kImageAUndo

      private Object m_kImageAUndo
      Single-level undo/redo for image masks, undo-imageA:
    • m_kImageARedo

      private Object m_kImageARedo
      Single-level undo/redo for image masks, re-do-imageA:
    • m_kImageBUndo

      private Object m_kImageBUndo
      Single-level undo/redo for image masks, undo-imageB:
    • m_kImageBRedo

      private Object m_kImageBRedo
      Single-level undo/redo for image masks, re-do-imageB:
    • m_akBounds

      private WildMagic.LibFoundation.Mathematics.Vector3f[] m_akBounds
      Bounding box for a group of selected VOIs for group-move.
    • listenerList

      protected EventListenerList listenerList
      created to handle VOI updates. Must fireVOIUpdate(...) to get listeners to handle the update. Perhaps better location for the VOIupdate is in ViewJCompoenentEditImage, but this listenerlist will handle listeners of more than one type.
    • popupPt

      protected ViewJPopupPt popupPt
      Popup Menu for VOIPoints.
    • currentColor

      protected Color currentColor
      Restores the VOI color button after QuickLUT.
    • saveGroup

      protected VOI saveGroup
      Restores the current VOI after QuickLUT.
    • m_kActiveList

      private Vector<VOIBase> m_kActiveList
      List of active VOIBase for a moving several selected VOIs.
    • m_kPointerButton

      private JToggleButton 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

      protected JDialogVOIStatistics imageStatList
      Statistics dialog VOI->Statistics generator...
    • presetHue

      private float presetHue
    • m_bDefaultImage

      private boolean m_bDefaultImage
    • m_kTempImage

      private ModelImage m_kTempImage
    • voiMenu

      protected JMenu voiMenu
    • voiMenuBuilder

      protected ViewMenuBuilder 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 VOIManagerInterfaceListener
      kImageA - imageA
      kImageB - imageB
      iNViews - 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

      public void actionPerformed(ActionEvent event)
      Specified by:
      actionPerformed in interface ActionListener
    • addedCurve

      public void addedCurve(VOIEvent added)
      Description copied from interface: VOIListener
      handles an VOIEvent as a selection change.
      Specified by:
      addedCurve in interface VOIListener
      Parameters:
      added - DOCUMENT ME!
    • addedVOI

      public void addedVOI(VOIVectorEvent newVOIselection)
      Description copied from interface: VOIVectorListener
      handles an VOIEvent as a selection change.
      Specified by:
      addedVOI in interface VOIVectorListener
      Parameters:
      newVOIselection - DOCUMENT ME!
    • addVOI

      public void addVOI(VOIBase kNew, boolean bQuickLUT, boolean bUpdate, boolean isFinished)
      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 added
      isFinished - 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

      public void addVOIUpdateListener(UpdateVOISelectionListener listener)
      Adds a UpdateVOISelectionListener.
      Specified by:
      addVOIUpdateListener in interface VOIHandlerInterface
      Parameters:
      listener - will receive VOI selection events.
    • algorithmPerformed

      public void algorithmPerformed()
    • colorChanged

      public void colorChanged(Color c)
      Specified by:
      colorChanged in interface VOIListener
    • deleteSelectedVOI

      public void deleteSelectedVOI(boolean contoursOnly)
      Description copied from interface: VOIHandlerInterface
      Delete the selected VOI. This function is deprecated, replace with actionPerformed() using CustomUIBuilder.PARAM_VOI_DELETE
      Specified by:
      deleteSelectedVOI in interface VOIHandlerInterface
      Parameters:
      contoursOnly - when true only delete the selected contours in the VOI, do not delete the VOI.
    • deleteVOI

      public void deleteVOI(VOIBase kOld, boolean update)
      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: VOIHandlerInterface
      Delete all VOIs.
      Specified by:
      deleteVOIs in interface VOIHandlerInterface
    • disposeLocal

      public void disposeLocal(boolean flag)
      Description copied from interface: VOIHandlerInterface
      Dispose of the implementing class.
      Specified by:
      disposeLocal in interface VOIHandlerInterface
      Parameters:
      flag - not used.
    • doVOI

      public void doVOI(String kCommand)
      Performs the VOI Action Command. See CustomUIBuilder. This function should be replaced withe actionPerformed(ActionEvent).
      Parameters:
      kCommand - VOI action command.
    • fireVOISelectionChange

      public void fireVOISelectionChange(VOI voi)
      Description copied from interface: VOIHandlerInterface
      Communicates a selection change to all UpdateVOISelectionListeners.
      Specified by:
      fireVOISelectionChange in interface VOIHandlerInterface
      Parameters:
      voi - the modified VOI.
    • fireVOISelectionChange

      public void fireVOISelectionChange(VOI voi, VOIBase curve)
      Description copied from interface: VOIHandlerInterface
      Communicates a selection change to all UpdateVOISelectionListeners.
      Specified by:
      fireVOISelectionChange in interface VOIHandlerInterface
      Parameters:
      voi - modified VOI.
      curve - modified VOIBase.
    • getActiveImage

      public ModelImage getActiveImage()
      Description copied from interface: VOIHandlerInterface
      Returns the current active image.
      Specified by:
      getActiveImage in interface VOIHandlerInterface
      Returns:
      current active image.
    • getComponentImage

      public Component getComponentImage()
      Description copied from interface: VOIHandlerInterface
      Returns the Component displaying the current active image.
      Specified by:
      getComponentImage in interface VOIHandlerInterface
      Returns:
      the Component displaying the current active image.
    • getPointerButton

      public JToggleButton getPointerButton()
      Returns the pointer button, used by VOIManager to determine if the pointer button is active.
      Returns:
      current pointer button.
    • getToolBar

      public JToolBar getToolBar()
      Returns the VOIToolbar.
      Returns:
      VOIToolbar.
    • getVOI_ID

      public int getVOI_ID()
      Specified by:
      getVOI_ID in interface VOIHandlerInterface
      Returns:
      0.
    • getVOIManager

      public VOIManager getVOIManager(int i)
      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: VOIHandlerInterface
      Generates and displays a 1D graph of the average or total intensity of 2.5 VOI of 2.5D image (3D).
      Specified by:
      graph25VOI_CalcInten in interface VOIHandlerInterface
      Parameters:
      totalIntensity - if true calculates total sum of the intensity else calculates the average pixel intensity
      useThreshold - whether or not to threshold this intensity plot
      threshold - the threshold value to use, if thresholding.
    • isNewVoiNeeded

      public boolean isNewVoiNeeded(int voiType)
      Specified by:
      isNewVoiNeeded in interface VOIHandlerInterface
      Parameters:
      voiType -
      Returns:
      false
    • make3DVOI

      public boolean make3DVOI(boolean bIntersection, ModelImage kVolume)
      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

      public void mouseClicked(MouseEvent event)
      Specified by:
      mouseClicked in interface MouseListener
    • mouseDragged

      public void mouseDragged(MouseEvent arg0)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent e)
      Specified by:
      mouseExited in interface MouseListener
    • mouseMoved

      public void mouseMoved(MouseEvent arg0)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
    • moveVOI

      public void moveVOI(String kCommand, float fScale)
    • 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 distance
      iPlane - 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: VOIHandlerInterface
      Initiate a new VOI.
      Specified by:
      newVOI in interface VOIHandlerInterface
      Parameters:
      presetHue - new VOI color
    • pasteVOI

      public void pasteVOI(VOIBase kNew)
      Paste the input VOIBase.
      Parameters:
      kNew - the enw VOIBase to paste.
    • propVOI

      public boolean propVOI(int direction, boolean active)
      Description copied from interface: VOIHandlerInterface
      Propagates 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:
      propVOI in interface VOIHandlerInterface
      Parameters:
      direction - Up +1, or Down -1
      active - unused.
      Returns:
      true if success, false otherwise
    • propVOIAll

      public boolean propVOIAll()
      Description copied from interface: VOIHandlerInterface
      Propagates the selected VOI to all slices. This function is deprecated, replace with actionPerformed(ActionEvent) using CustomUIBuilder.PARAM_VOI_PROPAGATE_ALL.
      Specified by:
      propVOIAll in interface VOIHandlerInterface
      Returns:
      true if success, false otherwise
    • quickLUT

      public void quickLUT(VOIBase kLUT)
      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

      public void removedCurve(VOIEvent removed)
      Description copied from interface: VOIListener
      handles to the VOI being removed from the Vector.
      Specified by:
      removedCurve in interface VOIListener
      Parameters:
      removed - DOCUMENT ME!
    • removedVOI

      public void removedVOI(VOIVectorEvent removed)
      Description copied from interface: VOIVectorListener
      handles to the VOI being removed from the Vector.
      Specified by:
      removedVOI in interface VOIVectorListener
      Parameters:
      removed - DOCUMENT ME!
    • removeVOIManager

      public void removeVOIManager(VOIManager kVOIManager)
    • removeVOIUpdateListener

      public void removeVOIUpdateListener(UpdateVOISelectionListener listener)
      Description copied from interface: VOIHandlerInterface
      Removes the UpdateVOISelectionListener from the list.
      Specified by:
      removeVOIUpdateListener in interface VOIHandlerInterface
      Parameters:
      listener - the UpdateVOIselectionListener to remove.
    • resetLivewire

      public void resetLivewire()
      Description copied from interface: VOIHandlerInterface
      Resets the current livewire VOI.
      Specified by:
      resetLivewire in interface VOIHandlerInterface
    • saveVOIs

      public void saveVOIs(String kCommand)
      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: VOIHandlerInterface
      Selects all VOIs. This function is deprecated, replace with actionPerformed(ActionEvent) using CustomUIBuilder.PARAM_VOI_SELECT_ALL and CustomUIBuilder.PARAM_VOI_SELECT_NONE
      Specified by:
      selectAllVOIs in interface VOIHandlerInterface
      Parameters:
      bActive -
    • selectedVOI

      public void selectedVOI(VOIEvent selection)
      Description copied from interface: VOIListener
      handles the VOI being selected. -- a state-change.
      Specified by:
      selectedVOI in interface VOIListener
      Parameters:
      selection - DOCUMENT ME!
    • setActive

      public void setActive(VOIManager kManager, ModelImage kActiveImage)
      Called from the VOIManager. Sets the current active VOIManager.
      Parameters:
      kManager - calling VOIManager.
    • setButtonColor

      public void setButtonColor(JButton _button, Color _color)
      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: VOIHandlerInterface
      Sets 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:
      setCenter in interface VOIHandlerInterface
      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: VOIHandlerInterface
      Sets 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:
      setCenter in interface VOIHandlerInterface
      Parameters:
      center - ModelImage file coordinates representation of the slice values of the three orthogonal image planes.
      bParent - when true call parent.setCenter()
    • setCursor

      public void setCursor(Cursor kCursor)
      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

      public void setPointerButton(JToggleButton button)
      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: VOIHandlerInterface
      Sets the hue that will be used to draw the new VOI.
      Specified by:
      setPresetHue in interface VOIHandlerInterface
      Parameters:
      presetHue - the hue to be used
    • setRenderer

      public void setRenderer(VolumeTriPlanarRenderBase renderer)
    • setSelectedVOI

      public void setSelectedVOI(VOI kSelected, boolean bSelectAll, boolean bUnSelectVOI)
      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: VOIHandlerInterface
      This function is deprecated.
      Specified by:
      setVOI_IDs in interface VOIHandlerInterface
      Parameters:
      ID - not used.
      UID - not used.
    • setVOITools

      public void setVOITools(JMenu voiMenu, ViewMenuBuilder voiMenuBuilder)
    • showColorDialog

      public void showColorDialog()
      Description copied from interface: VOIHandlerInterface
      Opens the color dialog for changing the selected VOI color.
      Specified by:
      showColorDialog in interface VOIHandlerInterface
    • 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 info
      showGraph -
      smooth -
    • showIntensityInfo

      public void showIntensityInfo(VOIBase kVOI, int m_iPlane, boolean showGraph)
      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

      public void updateGraph(VOIBase kVOI, int m_iPlane)
      Called from the VOIManager when the VOIBase that is currently being graphed has changed.
      Parameters:
      kVOI - the modified VOIBase.
    • vectorSelected

      public void vectorSelected(VOIVectorEvent selection)
      Description copied from interface: VOIVectorListener
      handles the VOI being selected.
      Specified by:
      vectorSelected in interface VOIVectorListener
      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

      private void clearList(Vector<VOISaveState> list, int limit)
    • copy

      private int copy()
    • createMask

      private void createMask(ModelImage kActive, boolean bInside)
    • createMask

      private void createMask(String command)
    • cut

      private int cut()
    • deleteActiveVOI

      private void deleteActiveVOI()
    • deleteAllVOI

      private void deleteAllVOI()
    • deleteVOIActivePt

      private void deleteVOIActivePt()
    • evolveBoundary2D

      private void evolveBoundary2D(String command)
    • findCompatibleType

      private void findCompatibleType(ModelImage kImage, VOIBase kNew, boolean isFinished)
    • getActiveVOICount

      private int getActiveVOICount()
    • getFrame

      private JFrame getFrame()
    • getSlice

      private int getSlice()
    • getVOIState

      protected VOISaveState getVOIState()
    • graphPointVOI

      private void graphPointVOI(VOI v, VOIPoint voiPt, int j, boolean useFrameRefTime)
    • graphVOI

      private void graphVOI()
    • graphVOICurvature

      private void graphVOICurvature(boolean smooth)
    • indentationVOIs2D

      private void indentationVOIs2D()
    • interpolateVOIs

      private void interpolateVOIs()
    • isDrawCommand

      private boolean isDrawCommand(String kCommand)
    • 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

      private void loadAllVOIsFrom(String voiDir, boolean quietMode)
      This method loads all VOIs to the active image from a given directory.
      Parameters:
      voiDir - the directory to load voi's from
      quietMode - 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 from
      quietMode - 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 from
      quietMode - 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

      private void saveAllVOIsTo(String voiDir)
      This method saves all VOIs for the active image to a given directory.
      Parameters:
      voiDir - directory that contains VOIs for this image.
    • saveImage

      private void saveImage(String kCommand)
      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

      private void saveVOIIntensitiesTo(String voiIntensitiesPath)
      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

      protected void setVOIState(VOISaveState kVOIState)
    • 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

      private void readImageJ(String pathName, String fileName, ModelImage image)
    • makeShapeFromArray

      private void makeShapeFromArray(float[] array, Vector<Vector<Integer>> xVector, Vector<Vector<Integer>> yVector)
    • getSegment

      private int getSegment(float[] array, float[] seg, int index)
    • extractNumber

      public String extractNumber(String str)
    • 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 - true indicates big endian byte order, false indicates 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 - true indicates big endian byte order, false indicates 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 - true indicates big endian byte order, false indicates little endian.
      Returns:
      Float value extracted from byte array.
    • readCSV

      private void readCSV(String fileName, ModelImage image)
    • readFreesurferBinaryPatch

      private void readFreesurferBinaryPatch(String fileName, ModelImage image)