Class JDialogPaintVasculature

All Implemented Interfaces:
DialogDefaultsInterface, RegionGrowDialog, ActionListener, FocusListener, ItemListener, KeyListener, MouseListener, MouseMotionListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class JDialogPaintVasculature extends JDialogBase implements RegionGrowDialog, ChangeListener, ActionListener, KeyListener, MouseMotionListener, 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:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • 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:
    • 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:
    • 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 JButton doneButton
      Button to indicate that the painting is finished and the dialog and attached image frame should be closed.
    • growButton

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

      private 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 JSlider lowerDeltaSlider
      Slider which adjusts the lower bound of the region grow.
    • lowerDeltaTF

      private 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 JLabel mouseIntensityLabel
      The intensity of the current mouse position within the mip.
    • mouseXLabel

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

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

      private 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 Vector<ViewJComponentEditImage> paintGrowListeners
      List of frames that want to know about paint updates.
    • paintGrowMode

      private int paintGrowMode
      The point selection mode.
    • rfastFrame

      private ViewJFrameImage rfastFrame
      The main RFAST frame.
    • seedPoints

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

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

      private 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 JSlider upperDeltaSlider
      Slider which adjusts the upper bound of the region grow.
    • upperDeltaTF

      private JTextField upperDeltaTF
      Text field containing the upper bound of the region grow.
  • Constructor Details

    • JDialogPaintVasculature

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

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Handle events from the dialog's buttons.
      Specified by:
      actionPerformed in interface 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
    • getDisplayFuzzy

      public boolean getDisplayFuzzy()
      Placeholder.
      Specified by:
      getDisplayFuzzy in interface RegionGrowDialog
      Returns:
      false.
    • getFuzzyThreshold

      public float getFuzzyThreshold()
      Placeholder.
      Specified by:
      getFuzzyThreshold in interface RegionGrowDialog
      Returns:
      -1.
    • 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.
    • getLowerBoundB

      public float getLowerBoundB()
      DOCUMENT ME!
      Specified by:
      getLowerBoundB in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getLowerBoundG

      public float getLowerBoundG()
      DOCUMENT ME!
      Specified by:
      getLowerBoundG in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getLowerBoundR

      public float getLowerBoundR()
      DOCUMENT ME!
      Specified by:
      getLowerBoundR in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getMaxDistance

      public int getMaxDistance()
      Placeholder.
      Specified by:
      getMaxDistance in interface RegionGrowDialog
      Returns:
      -1.
    • getMaxSize

      public int getMaxSize()
      Placeholder.
      Specified by:
      getMaxSize in interface RegionGrowDialog
      Returns:
      -1.
    • 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.
    • getUpperBoundB

      public float getUpperBoundB()
      DOCUMENT ME!
      Specified by:
      getUpperBoundB in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getUpperBoundG

      public float getUpperBoundG()
      DOCUMENT ME!
      Specified by:
      getUpperBoundG in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getUpperBoundR

      public float getUpperBoundR()
      DOCUMENT ME!
      Specified by:
      getUpperBoundR in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • getUseVOI

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

      public boolean getVariableThresholds()
      DOCUMENT ME!
      Specified by:
      getVariableThresholds in interface RegionGrowDialog
      Returns:
      DOCUMENT ME!
    • keyPressed

      public void keyPressed(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 KeyListener
      Parameters:
      event - key event generated by either the sliders or text fields
    • keyReleased

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

      public void keyTyped(KeyEvent e)
      Placeholder required by KeyListener. Does nothing.
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - KeyEvent
    • mouseClicked

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

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

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

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

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

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

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

      public void notifyPaintListeners(boolean isRegionGrow, boolean backup, 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(String posString)
      Placeholder.
      Specified by:
      setPositionText in interface RegionGrowDialog
      Parameters:
      posString - doesn't matter.
    • setRegionGrowAlgo

      public void setRegionGrowAlgo(AlgorithmRegionGrow regionGrowAlgo)
      Placeholder.
      Specified by:
      setRegionGrowAlgo in interface RegionGrowDialog
      Parameters:
      regionGrowAlgo - doesn't matter.
    • stateChanged

      public void stateChanged(ChangeEvent event)
      Handle events from the intensity bounds sliders.
      Specified by:
      stateChanged in interface 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 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 JPanel initUpperSlider()
      Construct the upper intensity bound slider panel.
      Returns:
      panel which allows adjustment of the upper intensity bound