Class JDialogPaintVasculature

  • All Implemented Interfaces:
    DialogDefaultsInterface, RegionGrowDialog, java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, 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.RootPaneContainer, javax.swing.WindowConstants

    public class JDialogPaintVasculature
    extends JDialogBase
    implements RegionGrowDialog, javax.swing.event.ChangeListener, java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseMotionListener, java.awt.event.MouseListener
    Dialog to facilitate the painting of a region of an image (such as the vascualture in a liver mip).
    Version:
    1.0
    Author:
    Evan McCreedy
    See Also:
    Serialized Form
    • Nested Class Summary

      • 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
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int AUTO_POINT
      The mode where paint grow seed points are automatically determined and chosen by the user.
      static int CLICK_POINT
      The mode where the user picks an arbitrary point to start a paint grow from.
      private boolean deltaSetFromField
      Boolean which indicates that the seed point intensity bounds were changed from one of the text fields and not from one of the sliders.
      private javax.swing.JButton doneButton
      Button to indicate that the painting is finished and the dialog and attached image frame should be closed.
      private javax.swing.JButton growButton
      Button which indicates that a region grow has been initiated / is being adjusted.
      private javax.swing.JTextField intensityTF
      Text field containing the seed value intensity.
      private int intensityValue
      The value of seed points to use.
      private boolean isCloseOkay
      Indicates that we are done with the current grow, and can close the MIP when the done button is next clicked.
      private javax.swing.JSlider lowerDeltaSlider
      Slider which adjusts the lower bound of the region grow.
      private javax.swing.JTextField lowerDeltaTF
      Text field containing the lower bound of the region grow.
      private int maxDelta
      The most we can get away from the initial seed point intensity value (151).
      private javax.swing.JLabel mouseIntensityLabel
      The intensity of the current mouse position within the mip.
      private javax.swing.JLabel mouseXLabel
      The x position of the current mouse position within the mip.
      private javax.swing.JLabel mouseYLabel
      The y position of the current mouse position within the mip.
      private javax.swing.JLabel mouseZLabel
      The z position of the current mouse position within the mip (the z position of the volume voxel put into the mip).
      private int oldSeedIntensity
      The intensity value to use to recalculate the possible seed points when switching from CLICK_POINT mode back to AUTO_MODE.
      private java.util.Vector<ViewJComponentEditImage> paintGrowListeners
      List of frames that want to know about paint updates.
      private int paintGrowMode
      The point selection mode.
      private ViewJFrameImage rfastFrame
      The main RFAST frame.
      private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> seedPoints
      List of points where we have grown a region from.
      private static long serialVersionUID
      Use serialVersionUID for interoperability.
      private javax.swing.JPanel toolbarPanel
      The dialog's toolbar panel.
      private javax.swing.JButton undoButton
      Button to undo the last region grow change (either a click of the grow button, or an adjustment of the threshold sliders).
      private javax.swing.JSlider upperDeltaSlider
      Slider which adjusts the upper bound of the region grow.
      private javax.swing.JTextField upperDeltaTF
      Text field containing the upper bound of the region grow.
      • Fields inherited from class javax.swing.JDialog

        accessibleContext, rootPane, rootPaneCheckingEnabled
      • Fields inherited from class java.awt.Dialog

        DEFAULT_MODALITY_TYPE
      • Fields inherited from class java.awt.Component

        BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
      • Fields inherited from interface javax.swing.WindowConstants

        DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)
      Handle events from the dialog's buttons.
      void commitGrow​(boolean flag)
      Tells the dialog to commit the current set of region grows and prepare for another set region grows, or the closing of the dialog.
      boolean getDisplayFuzzy()
      Placeholder.
      float getFuzzyThreshold()
      Placeholder.
      float getLowerBound()
      Accessor to the lower bound slider.
      float getLowerBoundB()
      DOCUMENT ME!
      float getLowerBoundG()
      DOCUMENT ME!
      float getLowerBoundR()
      DOCUMENT ME!
      int getMaxDistance()
      Placeholder.
      int getMaxSize()
      Placeholder.
      int getSeedIntensity()
      Get the current seed intensity.
      float getUpperBound()
      Accessor to the upper bound slider.
      float getUpperBoundB()
      DOCUMENT ME!
      float getUpperBoundG()
      DOCUMENT ME!
      float getUpperBoundR()
      DOCUMENT ME!
      boolean getUseVOI()
      Placeholder.
      boolean getVariableThresholds()
      DOCUMENT ME!
      private void initGUI()
      Construct the dialog interface.
      private javax.swing.JPanel initLowerSlider()
      Construct the lower intensity bound slider panel.
      private void initToolbar()
      Construct the dialog toolbar (including zoom, lut, and paint clearing tools).
      private javax.swing.JPanel initUpperSlider()
      Construct the upper intensity bound slider panel.
      void keyPressed​(java.awt.event.KeyEvent event)
      Allow the user to use left and right keys to adjust the intensity bounds sliders, and update the region grow when the user hits enter from within the bounds text fields.
      void keyReleased​(java.awt.event.KeyEvent e)
      Placeholder required by KeyListener.
      void keyTyped​(java.awt.event.KeyEvent e)
      Placeholder required by KeyListener.
      void mouseClicked​(java.awt.event.MouseEvent event)
      void mouseDragged​(java.awt.event.MouseEvent event)
      void mouseEntered​(java.awt.event.MouseEvent event)
      Do nothing.
      void mouseExited​(java.awt.event.MouseEvent event)
      void mouseMoved​(java.awt.event.MouseEvent event)
      void mousePressed​(java.awt.event.MouseEvent event)
      Do nothing.
      void mouseReleased​(java.awt.event.MouseEvent event)
      Do nothing.
      void notifyPaintListeners​(boolean isRegionGrow, boolean backup, java.util.BitSet paintMask)
      Tells images which are watching the paint region grow to update themselves.
      void resetDialogs()
      Sets the reference to this dialog for all of the images listening to it to null.
      void setPaintGrowMode​(int mode)
      Change the method for determining the points to paint grow from.
      void setPositionText​(java.lang.String posString)
      Placeholder.
      void setRegionGrowAlgo​(AlgorithmRegionGrow regionGrowAlgo)
      Placeholder.
      void stateChanged​(javax.swing.event.ChangeEvent event)
      Handle events from the intensity bounds sliders.
      void updateLowerSliderValues()
      Update the lower threshold slider labels and values.
      void updateSliderValues()
      Update the slider labels around the current intensityValue.
      void updateUpperSliderValues()
      Update the upper threshold slider labels and values.
      • 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
    • Field Detail

      • serialVersionUID

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

        public static final int AUTO_POINT
        The mode where paint grow seed points are automatically determined and chosen by the user.
        See Also:
        Constant Field Values
      • CLICK_POINT

        public static final int CLICK_POINT
        The mode where the user picks an arbitrary point to start a paint grow from.
        See Also:
        Constant Field Values
      • deltaSetFromField

        private boolean deltaSetFromField
        Boolean which indicates that the seed point intensity bounds were changed from one of the text fields and not from one of the sliders.
      • doneButton

        private javax.swing.JButton doneButton
        Button to indicate that the painting is finished and the dialog and attached image frame should be closed.
      • growButton

        private javax.swing.JButton growButton
        Button which indicates that a region grow has been initiated / is being adjusted.
      • intensityTF

        private javax.swing.JTextField intensityTF
        Text field containing the seed value intensity.
      • intensityValue

        private int intensityValue
        The value of seed points to use.
      • isCloseOkay

        private boolean isCloseOkay
        Indicates that we are done with the current grow, and can close the MIP when the done button is next clicked.
      • lowerDeltaSlider

        private javax.swing.JSlider lowerDeltaSlider
        Slider which adjusts the lower bound of the region grow.
      • lowerDeltaTF

        private javax.swing.JTextField lowerDeltaTF
        Text field containing the lower bound of the region grow.
      • maxDelta

        private int maxDelta
        The most we can get away from the initial seed point intensity value (151).
      • mouseIntensityLabel

        private javax.swing.JLabel mouseIntensityLabel
        The intensity of the current mouse position within the mip.
      • mouseXLabel

        private javax.swing.JLabel mouseXLabel
        The x position of the current mouse position within the mip.
      • mouseYLabel

        private javax.swing.JLabel mouseYLabel
        The y position of the current mouse position within the mip.
      • mouseZLabel

        private javax.swing.JLabel mouseZLabel
        The z position of the current mouse position within the mip (the z position of the volume voxel put into the mip).
      • oldSeedIntensity

        private int oldSeedIntensity
        The intensity value to use to recalculate the possible seed points when switching from CLICK_POINT mode back to AUTO_MODE.
      • paintGrowListeners

        private java.util.Vector<ViewJComponentEditImage> paintGrowListeners
        List of frames that want to know about paint updates.
      • paintGrowMode

        private int paintGrowMode
        The point selection mode.
      • seedPoints

        private java.util.Vector<WildMagic.LibFoundation.Mathematics.Vector3f> seedPoints
        List of points where we have grown a region from.
      • toolbarPanel

        private javax.swing.JPanel toolbarPanel
        The dialog's toolbar panel.
      • undoButton

        private javax.swing.JButton undoButton
        Button to undo the last region grow change (either a click of the grow button, or an adjustment of the threshold sliders).
      • upperDeltaSlider

        private javax.swing.JSlider upperDeltaSlider
        Slider which adjusts the upper bound of the region grow.
      • upperDeltaTF

        private javax.swing.JTextField upperDeltaTF
        Text field containing the upper bound of the region grow.
    • Constructor Detail

      • JDialogPaintVasculature

        public JDialogPaintVasculature​(ViewJFrameBase parent)
        Create the paint vasculature dialog.
        Parameters:
        parent - the parent frame which this dialog is attached to
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        Handle events from the dialog's buttons.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Overrides:
        actionPerformed in class JDialogBase
        Parameters:
        event - gui action events
      • commitGrow

        public void commitGrow​(boolean flag)
        Tells the dialog to commit the current set of region grows and prepare for another set region grows, or the closing of the dialog.
        Parameters:
        flag - whether to commit the grow, or remember to commit later before closing
      • getLowerBound

        public float getLowerBound()
        Accessor to the lower bound slider.
        Specified by:
        getLowerBound in interface RegionGrowDialog
        Returns:
        The value to be subtracted to the seed intensity the defines the lower intensity value that the region can grow into.
      • getSeedIntensity

        public int getSeedIntensity()
        Get the current seed intensity.
        Returns:
        the region grow seed intensity to use
      • getUpperBound

        public float getUpperBound()
        Accessor to the upper bound slider.
        Specified by:
        getUpperBound in interface RegionGrowDialog
        Returns:
        The value to be added to the seed intensity that defines the upper intensity value that the region can grow into.
      • getUseVOI

        public boolean getUseVOI()
        Placeholder.
        Specified by:
        getUseVOI in interface RegionGrowDialog
        Returns:
        false.
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent event)
        Allow the user to use left and right keys to adjust the intensity bounds sliders, and update the region grow when the user hits enter from within the bounds text fields.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Parameters:
        event - key event generated by either the sliders or text fields
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent e)
        Placeholder required by KeyListener. Does nothing.
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
        Parameters:
        e - KeyEvent
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent e)
        Placeholder required by KeyListener. Does nothing.
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
        Parameters:
        e - KeyEvent
      • 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 event)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent event)
        Do nothing. Required by MouseListener interface.
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Parameters:
        event - the mouse event
      • mouseExited

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

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

        public void mousePressed​(java.awt.event.MouseEvent event)
        Do nothing. Required by MouseListener interface.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        event - the mouse event
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent event)
        Do nothing. Required by MouseListener interface.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Parameters:
        event - the mouse event
      • notifyPaintListeners

        public void notifyPaintListeners​(boolean isRegionGrow,
                                         boolean backup,
                                         java.util.BitSet paintMask)
        Tells images which are watching the paint region grow to update themselves.
        Specified by:
        notifyPaintListeners in interface RegionGrowDialog
        Parameters:
        isRegionGrow - whether the update was caused by a region grow or by something else (eg - eraseall)
        backup - whether to backup the paint region before updating it (to allow for undos).
        paintMask - the paint mask to tell the listeners about.
      • resetDialogs

        public void resetDialogs()
        Sets the reference to this dialog for all of the images listening to it to null.
        Specified by:
        resetDialogs in interface RegionGrowDialog
      • setPaintGrowMode

        public void setPaintGrowMode​(int mode)
        Change the method for determining the points to paint grow from.
        Parameters:
        mode - the new paint grow mode
      • setPositionText

        public void setPositionText​(java.lang.String posString)
        Placeholder.
        Specified by:
        setPositionText in interface RegionGrowDialog
        Parameters:
        posString - doesn't matter.
      • stateChanged

        public void stateChanged​(javax.swing.event.ChangeEvent event)
        Handle events from the intensity bounds sliders.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Parameters:
        event - event fired by slider change
      • updateLowerSliderValues

        public void updateLowerSliderValues()
        Update the lower threshold slider labels and values.
      • updateSliderValues

        public void updateSliderValues()
        Update the slider labels around the current intensityValue.
      • updateUpperSliderValues

        public void updateUpperSliderValues()
        Update the upper threshold slider labels and values.
      • initGUI

        private void initGUI()
        Construct the dialog interface.
      • initLowerSlider

        private javax.swing.JPanel initLowerSlider()
        Construct the lower intensity bound slider panel.
        Returns:
        panel which allows adjustment of the lower intensity bound
      • initToolbar

        private void initToolbar()
        Construct the dialog toolbar (including zoom, lut, and paint clearing tools).
      • initUpperSlider

        private javax.swing.JPanel initUpperSlider()
        Construct the upper intensity bound slider panel.
        Returns:
        panel which allows adjustment of the upper intensity bound