Class JDialogVOIStats

  • All Implemented Interfaces:
    AlgorithmInterface, ScriptableActionInterface, UpdateVOISelectionListener, DialogDefaultsInterface, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.event.TreeSelectionListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogVOIStats
    extends JDialogScriptableBase
    implements java.awt.event.ItemListener, javax.swing.event.ChangeListener, java.awt.event.FocusListener, UpdateVOISelectionListener, javax.swing.event.TreeSelectionListener, AlgorithmInterface
    DOCUMENT ME!
    Version:
    1.1 June 15, 1999
    Author:
    Matthew J. McAuliffe, Ph.D.

    $Logfile: /mipav/src/gov/nih/mipav/view/dialogs/JDialogVOIStats.java $ $Revision: 56 $ $Date: 2/17/06 6:20p $

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) class  JDialogVOIStats.CancelListener
      Does nothing.
      (package private) class  JDialogVOIStats.OkColorListener
      Pick up the selected color and call method to change the VOI color.
      private class  JDialogVOIStats.VOITreePopup
      DOCUMENT ME!
      private class  JDialogVOIStats.VOITreeRenderer
      DOCUMENT ME!
      • Nested classes/interfaces inherited from class javax.swing.JDialog

        javax.swing.JDialog.AccessibleJDialog
      • Nested classes/interfaces inherited from class java.awt.Dialog

        java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Container

        java.awt.Container.AccessibleAWTContainer
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Applies changes to VOI when "Apply" is pressed; closes when "Cancel" is pressed; and calculates statistics and outputs them to the message frame when "Calculate" is pressed.
      void algorithmPerformed​(AlgorithmBase algorithm)
      Called after an algorithm this listener is registered to exits (maybe successfully, maybe not).
      private void anotherCall()  
      protected void buildVOIContourPane()
      DOCUMENT ME!
      protected void buildVOITree()
      DOCUMENT ME!
      protected void callAlgorithm()
      Starts the algorithm.
      void callVOIAlgo​(ViewVOIVector voiProcessingSet, int processingMode, boolean inSepThread)  
      private java.lang.String extendName​(java.lang.String name, VOI tempVOI, int contourNum, int processType)
      Changes voi name used for statistics retrieval based on processing mode
      void focusLost​(java.awt.event.FocusEvent event)
      Test the seed value and if appropriate, sets it.
      JPanelStatisticsList getListPanel()  
      private VOI getVOIforProcessing​(VOI parent)  
      protected void init()
      Sets up GUI components - buttons, checkboxes, sliders, etc.
      void itemStateChanged​(java.awt.event.ItemEvent event)
      Updates the VOI when the checkboxes for title, boundary, processing, and opacity are changed
      private void printTree​(javax.swing.tree.TreeModel model, java.lang.Object parent)  
      void selectionChanged​(UpdateVOIEvent newVOIselection)
      responds to the volume of interest (VOI) change events.
      void setCheckboxBoundingBox​(boolean flag)  
      protected void setGUIFromParams()
      Set the dialog GUI using the script parameters while running this algorithm as part of a script.
      void setVisible​(boolean visible)
      DOCUMENT ME!
      private void setVOIActive​(VOI v)
      Internal method for setting all relevant parts of the GUI and the MIPAV interface to reflect the active VOI.
      void showColorChooser()
      DOCUMENT ME!
      void stateChanged​(javax.swing.event.ChangeEvent e)
      Sets values based on knob along slider.
      protected void storeParamsFromGUI()
      Record the parameters just used to run this algorithm in a script.
      private void updateContourPane​(VOIBase leadBase)
      DOCUMENT ME!
      void updateTree()
      DOCUMENT ME!
      void updateVOIPanel​(VOI _voi, ModelImage img)
      Updates the dialog based on the VOI passed in.
      void valueChanged​(javax.swing.event.TreeSelectionEvent e)
      Updates the ViewJFrameImage when a VOI/contour is selected.
      • Methods inherited from class javax.swing.JDialog

        addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
      • Methods inherited from class java.awt.Dialog

        addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBack
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.event.FocusListener

        focusGained
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • ICON_POLYGON

        private static javax.swing.Icon ICON_POLYGON
        DOCUMENT ME!
      • ICON_POLYLINE

        private static javax.swing.Icon ICON_POLYLINE
        DOCUMENT ME!
      • ICON_POINT

        private static javax.swing.Icon ICON_POINT
        DOCUMENT ME!
      • ICON_LINE

        private static javax.swing.Icon ICON_LINE
        DOCUMENT ME!
      • ICON_MEDICAL_FRAME

        private static javax.swing.Icon ICON_MEDICAL_FRAME
        DOCUMENT ME!
      • ICON_X_AXIS

        private static javax.swing.Icon ICON_X_AXIS
        DOCUMENT ME!
      • ICON_Y_AXIS

        private static javax.swing.Icon ICON_Y_AXIS
        DOCUMENT ME!
      • ICON_Z_AXIS

        private static javax.swing.Icon ICON_Z_AXIS
        DOCUMENT ME!
      • ICON_PROTRACTOR

        private static javax.swing.Icon ICON_PROTRACTOR
        DOCUMENT ME!
      • applyButton

        protected javax.swing.JButton applyButton
        Applies bounding box/shading/name display and other UI changes to ModelImage
      • calcButton

        protected javax.swing.JButton calcButton
        Performs statistics calculations
      • helpButton

        protected javax.swing.JButton helpButton
        Displays Stats dialog help
      • checkboxOpacity

        protected javax.swing.JCheckBox checkboxOpacity
        Whether to display VOI with shading
      • checkboxBoundingBox

        protected javax.swing.JCheckBox checkboxBoundingBox
        Whether to display bounding box around VOI
      • checkboxSaveStats

        protected javax.swing.JCheckBox checkboxSaveStats
        Whether to save statistics to a file
      • checkboxIncludeForProcessing

        protected javax.swing.JCheckBox checkboxIncludeForProcessing
        Whether to include the selected VOI for statistics processing
      • checkboxVOIName

        protected javax.swing.JCheckBox checkboxVOIName
        Whether to display VOI name
      • colorButton

        protected javax.swing.JButton colorButton
        Allows VOI color to be selected
      • colorChooser

        private ViewJColorChooser colorChooser
        Internal dialog box for selecting VOI color
      • colorVOI

        private java.awt.Color colorVOI
        The current color of the selected VOI
      • contourTextArea

        private javax.swing.JTextArea contourTextArea
        Displays points and name of selected VOI or contour
      • currentOpacity

        protected javax.swing.JLabel currentOpacity
        Displays current opacity level in slider
      • followVOISelectionBox

        protected javax.swing.JCheckBox followVOISelectionBox
        DOCUMENT ME!
      • frameBorder

        protected javax.swing.border.Border frameBorder
        DOCUMENT ME!
      • frameFollowsSelection

        private boolean frameFollowsSelection
        DOCUMENT ME!
      • image

        protected ModelImage image
        Internal reference to the currently selected ModelImage
      • opacitySlider

        protected javax.swing.JSlider opacitySlider
        The opacity slider for the selected VOI
      • root

        private javax.swing.tree.DefaultMutableTreeNode root
        A reference in the voiTree to the currently selected image
      • seedValue

        private short seedValue
        The seed value last entered by the user
      • seedValueTF

        protected javax.swing.JTextField seedValueTF
        Watershed seed value
      • treeSelectionChange

        private boolean treeSelectionChange
        DOCUMENT ME!
      • updateTree

        private boolean updateTree
      • voi

        private VOI voi
        The selected VOI when the VOIStats dialogue was created
      • voiContourPane

        protected javax.swing.JScrollPane voiContourPane
        DOCUMENT ME!
      • voiModel

        private javax.swing.tree.DefaultTreeModel voiModel
        The tree of VOIs, composed of an image with children VOIs
      • VOIName

        protected javax.swing.JTextField VOIName
        Name of the currently selected voi
      • VOIThicknessField

        protected javax.swing.JTextField VOIThicknessField
        Thickness of the currently selected voi
      • UIDfield

        protected javax.swing.JTextField UIDfield
        uid of the selected voi
      • voiTree

        private javax.swing.JTree voiTree
        The graphical representation of voiModel
      • voiTreePane

        protected javax.swing.JScrollPane voiTreePane
        Displays the orthoganal list of VOIs in the selected ModelImage
      • processList

        private ViewVOIVector[] processList
        List of VOI sets that will have statistics calculated
      • processListIndex

        private int processListIndex
        Current set of VOIs that are being processed
      • activeVolumeButton

        private javax.swing.JRadioButton activeVolumeButton
      • allVolumesButton

        private javax.swing.JRadioButton allVolumesButton
      • activeVolume

        private int activeVolume
      • doAllVolumes

        private boolean doAllVolumes
      • tDim

        private int tDim
      • wholeImage

        private VOI wholeImage
        VOI used for whole image processing
      • rangeMaximum

        private float rangeMaximum
        DOCUMENT ME!
      • rangeMinimum

        private float rangeMinimum
        DOCUMENT ME!
      • rangeMaximumR

        private float rangeMaximumR
      • rangeMinimumR

        private float rangeMinimumR
      • rangeMaximumG

        private float rangeMaximumG
      • rangeMinimumG

        private float rangeMinimumG
      • rangeMaximumB

        private float rangeMaximumB
      • rangeMinimumB

        private float rangeMinimumB
    • Constructor Detail

      • JDialogVOIStats

        public JDialogVOIStats()
        Empty constructor needed for dynamic instantiation.
      • JDialogVOIStats

        public JDialogVOIStats​(VOIHandlerInterface theVoiHandler,
                               ModelImage img,
                               VOI _voi)
        Constructor for the JDialogVOIStats.

        this class ought to listen for VOI updates, but we are having it implemented elsewhere.

        Parameters:
        theParentFrame - DOCUMENT ME!
        img - DOCUMENT ME!
        _voi - DOCUMENT ME!
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Applies changes to VOI when "Apply" is pressed; closes when "Cancel" is pressed; and calculates statistics and outputs them to the message frame when "Calculate" is pressed. Also brings up a color chooser when the color button is pressed.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - Event that triggers this function
      • getVOIforProcessing

        private VOI getVOIforProcessing​(VOI parent)
      • callVOIAlgo

        public void callVOIAlgo​(ViewVOIVector voiProcessingSet,
                                int processingMode,
                                boolean inSepThread)
      • algorithmPerformed

        public void algorithmPerformed​(AlgorithmBase algorithm)
        Description copied from interface: AlgorithmInterface
        Called after an algorithm this listener is registered to exits (maybe successfully, maybe not). If the algorithm is run in a separate thread, this call will be made within that thread. If not, this call will be made from that same, shared thread.
        Specified by:
        algorithmPerformed in interface AlgorithmInterface
        Parameters:
        algorithm - the algorithm which has just completed
      • extendName

        private java.lang.String extendName​(java.lang.String name,
                                            VOI tempVOI,
                                            int contourNum,
                                            int processType)
        Changes voi name used for statistics retrieval based on processing mode
      • anotherCall

        private void anotherCall()
      • focusLost

        public void focusLost​(java.awt.event.FocusEvent event)
        Test the seed value and if appropriate, sets it.
        Specified by:
        focusLost in interface java.awt.event.FocusListener
        Overrides:
        focusLost in class JDialogBase
        Parameters:
        event - Event that triggered function.
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent event)
        Updates the VOI when the checkboxes for title, boundary, processing, and opacity are changed
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
        Overrides:
        itemStateChanged in class JDialogBase
        Parameters:
        event - Event that cause the method to fire
      • selectionChanged

        public void selectionChanged​(UpdateVOIEvent newVOIselection)
        responds to the volume of interest (VOI) change events.

        This method calls updateVOI using the UpdateVOIEvent changed VOI, and retrieves the runningInSeparateThread out of the current image's frame.

        Specified by:
        selectionChanged in interface UpdateVOISelectionListener
        Parameters:
        newVOIselection - DOCUMENT ME!
        See Also:
        UpdateVOIEvent, #updateVOI, ViewJFrameBase#getActiveImage
      • setVisible

        public void setVisible​(boolean visible)
        DOCUMENT ME!
        Overrides:
        setVisible in class JDialogBase
        Parameters:
        visible - DOCUMENT ME!
      • showColorChooser

        public void showColorChooser()
        DOCUMENT ME!
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent e)
        Sets values based on knob along slider. Changes the opacity of the VOI
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        e - Event that triggered this function
      • updateVOIPanel

        public void updateVOIPanel​(VOI _voi,
                                   ModelImage img)
        Updates the dialog based on the VOI passed in.
        Parameters:
        _voi - VOI whose properties we want to calculate.
        img - Image where voi is to be updated
      • printTree

        private void printTree​(javax.swing.tree.TreeModel model,
                               java.lang.Object parent)
      • valueChanged

        public void valueChanged​(javax.swing.event.TreeSelectionEvent e)
        Updates the ViewJFrameImage when a VOI/contour is selected.
        Specified by:
        valueChanged in interface javax.swing.event.TreeSelectionListener
        Parameters:
        e - TreeSelectionEvent
      • setVOIActive

        private void setVOIActive​(VOI v)
        Internal method for setting all relevant parts of the GUI and the MIPAV interface to reflect the active VOI.
      • buildVOIContourPane

        protected void buildVOIContourPane()
        DOCUMENT ME!
      • buildVOITree

        protected void buildVOITree()
        DOCUMENT ME!
      • init

        protected void init()
        Sets up GUI components - buttons, checkboxes, sliders, etc.
      • updateContourPane

        private void updateContourPane​(VOIBase leadBase)
        DOCUMENT ME!
        Parameters:
        leadBase - DOCUMENT ME!
      • updateTree

        public void updateTree()
        DOCUMENT ME!
      • setCheckboxBoundingBox

        public void setCheckboxBoundingBox​(boolean flag)
      • callAlgorithm

        protected void callAlgorithm()
        Description copied from class: JDialogScriptableBase
        Starts the algorithm. Already exists in most algorithm dialogs. Should be called during scripted execution and regular operation.
        Specified by:
        callAlgorithm in class JDialogScriptableBase
      • setGUIFromParams

        protected void setGUIFromParams()
        Set the dialog GUI using the script parameters while running this algorithm as part of a script.
        Specified by:
        setGUIFromParams in class JDialogScriptableBase