Class VOIManagerInterface

  • 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
    Direct Known Subclasses:
    VOILatticeManagerInterface

    public class VOIManagerInterface
    extends java.lang.Object
    implements java.awt.event.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 Detail

      • 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 javax.swing.JToolBar m_kVOIToolbar
        Reference to the VOI toolbar.
      • colorChooser

        protected ViewJColorChooser colorChooser
        Reference to the color chooser.
      • m_kVOIManagers

        protected java.util.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 java.util.Vector<java.lang.String> m_kUndoCommands
        List of undo commands
      • m_kRedoCommands

        private java.util.Vector<java.lang.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
      • m_kVOIDialog

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

        private int m_iMaxUndo
      • m_kUndoList

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

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

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

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

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

        private java.lang.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 javax.swing.event.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.
      • popup

        protected ViewJPopupVOI popup
        Popup Menu for VOIs (non-point).
      • popupPt

        protected ViewJPopupPt popupPt
        Popup Menu for VOIPoints.
      • currentColor

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

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

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

        private javax.swing.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
      • voiMenu

        protected javax.swing.JMenu voiMenu
    • Constructor Detail

      • VOIManagerInterface

        public VOIManagerInterface​(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 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 Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Specified by:
        actionPerformed in interface java.awt.event.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!
      • 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.
      • algorithmPerformed

        public void algorithmPerformed()
      • colorChanged

        public void colorChanged​(java.awt.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.
      • doVOI

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

        public java.awt.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 javax.swing.JToggleButton getPointerButton()
        Returns the pointer button, used by VOIManager to determine if the pointer button is active.
        Returns:
        current pointer button.
      • getToolBar

        public javax.swing.JToolBar getToolBar()
        Returns the VOIToolbar.
        Returns:
        VOIToolbar.
      • 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.
      • 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​(java.awt.event.MouseEvent event)
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent arg0)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent e)
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent e)
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent arg0)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent e)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent e)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
      • moveVOI

        public void moveVOI​(java.lang.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!
      • removeVOIManager

        public void removeVOIManager​(VOIManager kVOIManager)
      • saveVOIs

        public void saveVOIs​(java.lang.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
      • 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​(javax.swing.JButton _button,
                                   java.awt.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​(java.awt.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​(javax.swing.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
      • 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​(javax.swing.JMenu voiMenu,
                                ViewMenuBuilder voiMenuBuilder)
      • 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.
      • 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​(java.util.Vector<VOISaveState> list,
                               int limit)
      • copy

        private int copy()
      • createMask

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

        private void createMask​(java.lang.String command)
      • cut

        private int cut()
      • deleteActiveVOI

        private void deleteActiveVOI()
      • deleteAllVOI

        private void deleteAllVOI()
      • deleteVOIActivePt

        private void deleteVOIActivePt()
      • evolveBoundary2D

        private void evolveBoundary2D​(java.lang.String command)
      • findCompatibleType

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

        private int getActiveVOICount()
      • getFrame

        private javax.swing.JFrame getFrame()
      • getSlice

        private int getSlice()
      • 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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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,
                                  java.util.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:
        xS - DOCUMENT ME!
        wS - DOCUMENT ME!
        yS - DOCUMENT ME!
        hS - DOCUMENT ME!
        imageBuffer - DOCUMENT ME!
        image - DOCUMENT ME!
        RGB - 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​(java.lang.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​(java.lang.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​(java.lang.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​(java.lang.String pathName,
                                java.lang.String fileName,
                                ModelImage image)
      • makeShapeFromArray

        private void makeShapeFromArray​(float[] array,
                                        java.util.Vector<java.util.Vector<java.lang.Integer>> xVector,
                                        java.util.Vector<java.util.Vector<java.lang.Integer>> yVector)
      • getSegment

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

        public java.lang.String extractNumber​(java.lang.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​(java.lang.String fileName,
                             ModelImage image)
      • readFreesurferBinaryPatch

        private void readFreesurferBinaryPatch​(java.lang.String fileName,
                                               ModelImage image)