Class JDialogMultiPaint

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

public class JDialogMultiPaint extends JDialogBase implements MouseListener, KeyListener
.

Dialog box for the advanced paint power tools: morphology operations, object delete, etc. Bring up this dialog from the normal power paint dialog.

Version:
May 2005
Author:
Pierre-Louis Bazin
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • lutB

      private static ModelLUT lutB
      DOCUMENT ME!
    • alphaBlend

      private int alphaBlend
      DOCUMENT ME!
    • triPlanarAlphaBlend

      private int triPlanarAlphaBlend
      DOCUMENT ME!
    • bottomPanel

      private JPanel bottomPanel
      DOCUMENT ME!
    • closePanel

      private JPanel closePanel
      DOCUMENT ME!
    • buttonShortkeys

      private JToggleButton buttonShortkeys
      DOCUMENT ME!
    • buttonTextArrayList

      private ArrayList<Integer> buttonTextArrayList
      this is the array list of texts for the mask number buttons.
    • changeMaskNumberDialog

      private JDialogChangeMaskNumber changeMaskNumberDialog
      Ref to JDialogChangeMaskNumber.*
    • collapseButton

      private JButton collapseButton
      Button that allows user to collapse masks/paint to single value.*
    • saveAs3DMaskRadio

      private JRadioButton saveAs3DMaskRadio
      radio buttons for commmiting masks as 3d or 4d if image is 4d
    • saveAs4DMaskRadio

      private JRadioButton saveAs4DMaskRadio
      radio buttons for commmiting masks as 3d or 4d if image is 4d
    • radioGroup

      private ButtonGroup radioGroup
      button group for radio buttons
    • saveMasksAs4D

      private boolean saveMasksAs4D
      this boolean is needed for commiting masks for a 4d image
    • color

      private Color[] color
      array of colors to use for the labels.
    • currentOpacity

      private float currentOpacity
      saved opacity parameter when hiding the paint
    • displayMasksButton

      private JToggleButton displayMasksButton
      display masks toggle button.
    • displayModeButton

      private JToggleButton displayModeButton
      DOCUMENT ME!
    • displayPaintButton

      private JToggleButton displayPaintButton
      DOCUMENT ME!
    • editBox

      private JCheckBox editBox
      DOCUMENT ME!
    • exportVoiButton

      private JButton exportVoiButton
      button VOI export.
    • image

      private ModelImage image
      source image.
    • imgBSize

      private int imgBSize
      The size, in voxels, of the mask.
    • importVoiButton

      private JButton importVoiButton
      button VOI import.
    • indeterminateProgressBar

      private JProgressBar indeterminateProgressBar
      DOCUMENT ME!
    • intensityLockVector

      private Vector<Integer> intensityLockVector
      DOCUMENT ME!
    • label

      private String[] label
      labels for the painted objects.
    • labelField

      private JTextField[] labelField
      DOCUMENT ME!
    • listButton

      private BorderedButton[] listButton
      DOCUMENT ME!
    • listPanel

      private JPanel listPanel
      DOCUMENT ME!
    • loadDialog

      private JFileChooser loadDialog
      DOCUMENT ME!
    • loadLabelsButton

      private JButton loadLabelsButton
      DOCUMENT ME!
    • loadMaskButton

      private JButton loadMaskButton
      DOCUMENT ME!
    • checkAutosave

      private JToggleButton checkAutosave
    • save

      private MultiPaintAutoSave save
      DOCUMENT ME!
    • saver

      private Timer saver
      DOCUMENT ME!
    • mainPanel

      private JPanel mainPanel
      dialog elements.
    • multiButton

      private BorderedButton[] multiButton
      DOCUMENT ME!
    • multiPanel

      private JPanel multiPanel
      DOCUMENT ME!
    • nbx

      private int nbx
      number of paint masks initially.
    • nby

      private int nby
      number of paint masks initially.
    • newSelection

      private int newSelection
      This represents the button the user selects to..initally at 1.*
    • numberLabel

      private JLabel numberLabel
      DOCUMENT ME!
    • numberPanel

      private JPanel numberPanel
      DOCUMENT ME!
    • numberXField

      private JTextField numberXField
      resize x value.
    • numberYField

      private JTextField numberYField
      resize y value.
    • optionPanel

      private JPanel optionPanel
      DOCUMENT ME!
    • preserveBox

      private JCheckBox[] preserveBox
      DOCUMENT ME!
    • preserved

      private boolean[] preserved
      check whether the mask can be affected by new paint or not.
    • resizeButton

      private JButton resizeButton
      resize button.
    • saveDialog

      private JFileChooser saveDialog
      DOCUMENT ME!
    • saveLabelsButton

      private JButton saveLabelsButton
      save labels button.
    • saveMaskButton

      private JButton saveMaskButton
      save mask button.
    • scrollPane

      private JScrollPane scrollPane
      This is the scroll pane for the label list panel.*
    • selected

      private int selected
      id for the selected paint mask.
    • userInterface

      private ViewUserInterface userInterface
      private int destExtents[];.
    • leftPanel

      private JPanel leftPanel
      DOCUMENT ME!
    • rightPanel

      private JPanel rightPanel
      DOCUMENT ME!
    • leftRightPanel

      private JPanel leftRightPanel
      DOCUMENT ME!
    • lockAllButton

      private JButton lockAllButton
      lock all masks checkbox *
    • unlockAllButton

      private JButton unlockAllButton
      unlock all masks checkbox *
    • lockPanel

      private JPanel lockPanel
      lock panel
    • isVisibleMask

      private boolean isVisibleMask
    • isVisiblePaint

      private boolean isVisiblePaint
    • isCompactDisplay

      private boolean isCompactDisplay
    • threads

      private ThreadGroup threads
  • Constructor Details

    • JDialogMultiPaint

      public JDialogMultiPaint(ModelImage im)
      Used primarily for the script to store variables and run the algorithm. No actual dialog will appear but the set up info and result image will be stored here.
      Parameters:
      im - Source image.
    • JDialogMultiPaint

      public JDialogMultiPaint(Frame theParentFrame, ModelImage im)
      Creates dialog for plugin.
      Parameters:
      theParentFrame - Parent frame.
      im - Source image.
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Processes the events from this dialog's buttons.
      Specified by:
      actionPerformed in interface ActionListener
      Overrides:
      actionPerformed in class JDialogBase
      Parameters:
      event - Event that triggers the action.
    • addIntensityLock

      public void addIntensityLock(int intensity)
      Adds an Integer object to the intensityLockVector. The Integer object represents an intensity value which is locked - that is, cannot be overwritten by a "Paint to mask" operation.
      Parameters:
      intensity - the intensity value to lock
    • countMaskLabels

      public int countMaskLabels()
      Procedure that counts the number of labels in the mask image.
      Returns:
      DOCUMENT ME!
    • getActiveMask

      public final int getActiveMask()
    • imageBInit

      public void imageBInit()
      DOCUMENT ME!
    • keyPressed

      public void keyPressed(KeyEvent e)
      Handle the key pressed event.
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      e - DOCUMENT ME!
    • keyReleased

      public void keyReleased(KeyEvent e)
      Handle the key released event.
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - DOCUMENT ME!
    • keyTyped

      public void keyTyped(KeyEvent e)
      Handle the key typed event.
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - DOCUMENT ME!
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mouseExited

      public void mouseExited(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mousePressed

      public void mousePressed(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      DOCUMENT ME!
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      e - DOCUMENT ME!
    • readLabelsFromFile

      public void readLabelsFromFile(String filename)
      Reads the 'labels' file from disk.
      Parameters:
      filename - DOCUMENT ME!
    • removeIntensityLock

      public void removeIntensityLock(int intensity)
      Removes an intensity value from the intensityLockVector.
      Parameters:
      intensity - the intensity value to remove
    • windowClosing

      public void windowClosing(WindowEvent event)
      windowclosing...override of WindowListener interface.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class JDialogBase
      Parameters:
      event - DOCUMENT ME!
    • buildLoadDialog

      private void buildLoadDialog()
      Instantiates and shows the "Load label file" dialog, which is used to load a text file containing the names of the colored labels.
    • buildSaveDialog

      private void buildSaveDialog()
      Instantiates and shows the "Save label file" dialog, which is used to save a text file containing the names of the colored labels.
    • commitPaintToMask

      private void commitPaintToMask(int num)
      Converts the paint to a mask. Creates a new mask image if one does not already exist.
      Parameters:
      num - the index into the color array, which indicates the color of the paint
    • deselectMask

      private void deselectMask()
      Sets buttons to deselected, then calls refreshImagePaint to reset paint as mask.
    • getMaskTreeSet

      private TreeSet<Integer> getMaskTreeSet(ModelImage imgB)
      Determines the intensities of image B.....populates the treeset and returns it.
      Parameters:
      imgB - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • init

      private void init()
      Initializes the GUI (panels, buttons, etc) and displays it on the screen.
    • lockAll

      private void lockAll()
      locks all masks
    • unlockAll

      private void unlockAll()
      unlocks all masks
    • initBlankPaint

      private void initBlankPaint(int num)
      Initializes a new blank paint mask to the color indexed by the parameter 'num'
      Parameters:
      num - the index into the color array
    • loadFileActionPerformed

      private void loadFileActionPerformed(ActionEvent evt)
      Handles the action event generated by the "Load label file" dialog. Calls readLabelsFromFile(String) to read the label file selected by the user.
      Parameters:
      evt - the ActionEvent generated by this dialog
    • newLabelList

      private void newLabelList(int Nbx, int Nby)
      Purpose: unknown.
      Parameters:
      Nbx - number of labels in the x-direction
      Nby - number of labels in the y-direction
    • refreshImagePaint

      private void refreshImagePaint(ModelImage img, BitSet obj)
      Refreshes the displayed paint mask.
      Parameters:
      img - DOCUMENT ME!
      obj - DOCUMENT ME!
    • refreshImagePaint

      private void refreshImagePaint(ModelImage img)
      Refreshes the displayed paint mask.
      Parameters:
      img - DOCUMENT ME!
    • refreshLabelDisplay

      private void refreshLabelDisplay()
      Reinstantiates the labels for redisplay. Purpose: unknown
    • resetLabelList

      private void resetLabelList(int Nbx, int Nby)
      Used to reset the button labels to their default setting. Currently not used.
      Parameters:
      Nbx - number of labels in the x-direction
      Nby - number of labels in the y-direction
    • saveFileActionPerformed

      private void saveFileActionPerformed(ActionEvent evt)
      Handles the action event generated by the "Save label file" dialog. Calls readLabelsFromFile(String) to save the labels to the file selected by the user.
      Parameters:
      evt - the ActionEvent generated by this dialog
    • selectedMaskToPaint

      private void selectedMaskToPaint(int num)
      Converts the selected mask to paint.
      Parameters:
      num - the index into the color array, which indicates the color of the paint
    • switchPaintAndMask

      private void switchPaintAndMask(int from, int to, int colorNum)
      Converts paint to a mask, then mask to paint. Reason: unknown.
      Parameters:
      from - DOCUMENT ME!
      to - DOCUMENT ME!
    • writeLabelsToFile

      private void writeLabelsToFile(String filename)
      Writes the 'labels' file to disk.
      Parameters:
      filename - DOCUMENT ME!
    • autosaveMask

      private final void autosaveMask()