Class JPanelHistoRGB

java.lang.Object
gov.nih.mipav.view.renderer.JPanelHistoRGB
All Implemented Interfaces:
HistoLUTParent, ActionListener, ItemListener, MouseListener, MouseMotionListener, EventListener, ChangeListener

Deprecated.
This class produces a frame where the histogram of the image data is displayed using the color mapping. All frames using the color map are dynamically updated with the new color map. This control panel manipulate the Histogram RGB LUT table for the color images.
Version:
1.0
Author:
Matthew J. McAuliffe, Ph.D. ( Primary ), Ruida Cheng
See Also:
  • Field Details

    • IMAGE_A

      public static final int IMAGE_A
      Deprecated.
      Display mode image A.
      See Also:
    • IMAGE_B

      public static final int IMAGE_B
      Deprecated.
      Display mode image B.
      See Also:
    • alphaBlend

      protected float alphaBlend
      Deprecated.
      Indicates the amount of blending when two images are loaded in the image frame.
    • displayMode

      protected int displayMode
      Deprecated.
      Indicates which image is to be acted upon when two images are displayed.
    • blueCheckBoxA

      private JCheckBox blueCheckBoxA
      Deprecated.
      Update Blue channel histogram check box A, B. Updating during mouse dragging
    • blueCheckBoxB

      private JCheckBox blueCheckBoxB
      Deprecated.
      Update Blue channel histogram check box A, B. Updating during mouse dragging
    • entireFlag

      private boolean entireFlag
      Deprecated.
      Flag indicating if histogram should be done on all of image or not.
    • greenCheckBoxA

      private JCheckBox greenCheckBoxA
      Deprecated.
      Update Green channel histogram check box A, B. Updating during mouse dragging
    • greenCheckBoxB

      private JCheckBox greenCheckBoxB
      Deprecated.
      Update Green channel histogram check box A, B. Updating during mouse dragging
    • histogramABlue

      private ModelHistogram histogramABlue
      Deprecated.
      imageA histogram of the Blue channel.
    • histogramAGreen

      private ModelHistogram histogramAGreen
      Deprecated.
      imageA histogram of the Green channel.
    • histogramARed

      private ModelHistogram histogramARed
      Deprecated.
      imageA histogram of the Red channel.
    • histogramBBlue

      private ModelHistogram histogramBBlue
      Deprecated.
      imageB histogram, the Blue channel.
    • histogramBGreen

      private ModelHistogram histogramBGreen
      Deprecated.
      imageB histogram, the Green channel.
    • histogramBRed

      private ModelHistogram histogramBRed
      Deprecated.
      imageB histogram of the Red channel.
    • histoPanelA

      private ViewJPanelHistoLUT histoPanelA
      Deprecated.
      The panel containing the RGB histogram component.
    • histoPanelB

      private ViewJPanelHistoLUT histoPanelB
      Deprecated.
      The panel containing the RGB histogram component.
    • imageA

      private ModelImage imageA
      Deprecated.
      Model image A, B. Define inside this class in order to get rid of the JFrame
    • imageB

      private ModelImage imageB
      Deprecated.
      ImageB reference.f
    • logCheckBoxA

      private JCheckBox logCheckBoxA
      Deprecated.
      The histogram log view check box.
    • logCheckBoxB

      private JCheckBox logCheckBoxB
      Deprecated.
      The histogram log view check box.
    • mainPanel

      private JPanel mainPanel
      Deprecated.
      The main GUI control panel.
    • panelA

      private JPanel panelA
      Deprecated.
      Tabbed control panel A, B.
    • panelB

      private JPanel panelB
      Deprecated.
      Tabbed control panel A, B.
    • redCheckBoxA

      private JCheckBox redCheckBoxA
      Deprecated.
      Update Red channel histogram check box A, B. Updating during mouse dragging
    • redCheckBoxB

      private JCheckBox redCheckBoxB
      Deprecated.
      Update Red channel histogram check box A, B. Updating during mouse dragging
    • redRGBButton

      private JToggleButton redRGBButton
      Deprecated.
      R, G, B channel control buttons.
    • blueRGBButton

      private JToggleButton blueRGBButton
      Deprecated.
      R, G, B channel control buttons.
    • greenRGBButton

      private JToggleButton greenRGBButton
      Deprecated.
      R, G, B channel control buttons.
    • allRGBButton

      private JToggleButton allRGBButton
      Deprecated.
      R, G, B channel control buttons.
    • regComponent

      private ViewJComponentRegistration regComponent
      Deprecated.
      Not used now.
    • RGBExtents

      private int[] RGBExtents
      Deprecated.
      RGB extents.
    • RGBTA

      private ModelRGB RGBTA
      Deprecated.
      Model RGB table A reference.
    • RGBTB

      private ModelRGB RGBTB
      Deprecated.
      Model RGB table B reference.
    • scroller

      private JScrollPane scroller
      Deprecated.
      Scroll pane.
    • scrollPanel

      private JPanelHistoRGB.DrawingPanel scrollPanel
      Deprecated.
      Scroll panel that holding the all the control components.
    • tabbedPane

      private JTabbedPane tabbedPane
      Deprecated.
      The Tabbed control panel.
    • toolBar

      private JToolBar toolBar
      Deprecated.
      ToolBar that hold the linear, horizontal mode etc.
    • toolBarObj

      private ViewToolBarBuilder toolBarObj
      Deprecated.
      Object which generates the toolbar.
    • transferButton

      private JToggleButton transferButton
      Deprecated.
      Toggle buttons for transfer, threshold and threshold inverse.
    • thresholdButton

      private JToggleButton thresholdButton
      Deprecated.
      Toggle buttons for transfer, threshold and threshold inverse.
    • inverseThresholdButton

      private JToggleButton inverseThresholdButton
      Deprecated.
      Toggle buttons for transfer, threshold and threshold inverse.
    • bImageUpdate

      private boolean bImageUpdate
      Deprecated.
      Update the LUT in real-time:
  • Constructor Details

    • JPanelHistoRGB

      public JPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag)
      Deprecated.
      Makes a frame of the histogram.
      Parameters:
      _imageA - Model of imageA
      _imageB - Model of imageB
      _RGBTA - Model RGB
      _RGBTB - Model RGB
      _entireFlag - Flag indicating if histogram should be done on all of image.
      See Also:
    • JPanelHistoRGB

      public JPanelHistoRGB(ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag, boolean bUpdateImage)
      Deprecated.
      Makes a frame of the histogram.
      Parameters:
      _imageA - Model of imageA
      _imageB - Model of imageB
      _RGBTA - Model RGB
      _RGBTB - Model RGB
      _entireFlag - Flag indicating if histogram should be done on all of image.
      bUpdateImage - update the displayed image continuously when true or on mouse-release when false.
      See Also:
    • JPanelHistoRGB

      public JPanelHistoRGB(ViewJComponentRegistration _regComponent, ModelImage _imageA, ModelImage _imageB, ModelRGB _RGBTA, ModelRGB _RGBTB, boolean _entireFlag)
      Deprecated.
      Makes a frame of the histogram.
      Parameters:
      _regComponent - component to pass parameters to in manual registration
      _imageA - Model of imageA
      _imageB - Model of imageB
      _RGBTA - Model RGB
      _RGBTB - Model RGB
      _entireFlag - Flag indicating if histogram should be done on all of image.
      See Also:
  • Method Details

    • actionPerformed

      public void actionPerformed(ActionEvent event)
      Deprecated.
      Calls various methods depending on the action.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      event - event that triggered function
    • disposeLocal

      public void disposeLocal()
      Deprecated.
      Still needs more work Matt.
    • dragPoint

      public void dragPoint(MouseEvent mouseEvent)
      Deprecated.
      Placeholder.
      Specified by:
      dragPoint in interface HistoLUTParent
      Parameters:
      mouseEvent - drag event
    • getHistoLUTComponentA

      public final ViewJComponentHistoRGB getHistoLUTComponentA()
      Deprecated.
      Get the histogram component for imageA.
      Returns:
      the imageA histogram component
    • getHistoLUTComponentB

      public final ViewJComponentHistoRGB getHistoLUTComponentB()
      Deprecated.
      Get the histogram component for imageB.
      Returns:
      the imageB histogram component
    • getImageA

      public ModelImage getImageA()
      Deprecated.
      Accessor that returns the imageA.
      Returns:
      image
    • getImageB

      public ModelImage getImageB()
      Deprecated.
      Accessor that returns the imageB.
      Returns:
      imageB
    • getMainPanel

      public JPanel getMainPanel()
      Deprecated.
      Get the control panel.
      Returns:
      Container control panel.
    • isImageUpdate

      public boolean isImageUpdate()
      Deprecated.
      Indicates if real-time update of the image should take place.
      Specified by:
      isImageUpdate in interface HistoLUTParent
      Returns:
      true if real time update should take place
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Deprecated.
      Sets the flags for the checkboxes.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      event - event that triggered this function
    • loadLUTFrom

      public void loadLUTFrom(boolean loadAll, String filename, String dirName, boolean quietMode)
      Deprecated.
      This method loads the LUT for the active image. If the image is not a color image then both the functions and the LUT data are loaded. If this is a color image, then only the functions are loaded.
      Parameters:
      loadAll - loadAll boolean indicating that both lut and transfer functions should be loaded. If false, then only transfer functions are loaded.
      filename - filename filename to save LUT as
      dirName - dirName directory to save LUT to
      quietMode - quietMode if true indicates that warnings should not be displayed.
    • mouseClicked

      public void mouseClicked(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseClicked in interface MouseListener
      Parameters:
      mouseEvent - mouse event handler.
    • mouseDragged

      public void mouseDragged(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseDragged in interface MouseMotionListener
      Parameters:
      mouseEvent - mouse event handler.
    • mouseEntered

      public void mouseEntered(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseEntered in interface MouseListener
      Parameters:
      mouseEvent - mouse event handler.
    • mouseExited

      public void mouseExited(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseExited in interface MouseListener
      Parameters:
      mouseEvent - mouse event handler.
    • mouseMoved

      public void mouseMoved(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseMoved in interface MouseMotionListener
      Parameters:
      mouseEvent - mouse event handler.
    • mousePressed

      public void mousePressed(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mousePressed in interface MouseListener
      Parameters:
      mouseEvent - mouse event handler.
    • mouseReleased

      public void mouseReleased(MouseEvent mouseEvent)
      Deprecated.
      Unchanged.
      Specified by:
      mouseReleased in interface MouseListener
      Parameters:
      mouseEvent - mouse event handler.
    • removeHistoRGBb

      public void removeHistoRGBb()
      Deprecated.
      Removes the tabbed pane for the histogram of image B.
    • resizePanel

      public void resizePanel(int panelWidth, int frameHeight)
      Deprecated.
      Resizig the control panel with ViewJFrameVolumeView's frame width and height.
      Parameters:
      panelWidth - width
      frameHeight - height
    • saveLUTAs

      public void saveLUTAs(boolean saveAll, String filename, String dirName)
      Deprecated.
      This method saves the LUT for the active image. If the image is not a color image then both the functions and the LUT data are saved. If this is a color image, then only the functions are saved.
      Parameters:
      saveAll - boolean indicating that both lut and transfer functions should be saved. If false, then only transfer functions are saved.

      If either filename or directory is null, then the user will be prompted for a filename.

      filename - filename to save LUT as
      dirName - directory to save LUT to
    • setAllOff

      public void setAllOff()
      Deprecated.
      Accessor to disable the all RGB color channels button if one of the lines has moved.
      Specified by:
      setAllOff in interface HistoLUTParent
    • setAlphaBlend

      public void setAlphaBlend(int value)
      Deprecated.
      Sets the alpha blending of parameter for two image displaying.
      Parameters:
      value - amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
    • setImageA

      public void setImageA(ModelImage image)
      Deprecated.
      Accessor that sets the imageA.
      Parameters:
      image - image to set frame to
    • setImageB

      public void setImageB(ModelImage image)
      Deprecated.
      Accessor that sets the imageB.
      Parameters:
      image - image to set frame to
    • setLUT

      public void setLUT(ModelLUT newLUT)
      Deprecated.
      Placeholder.
      Specified by:
      setLUT in interface HistoLUTParent
      Parameters:
      newLUT - lut
    • setRangeText

      public void setRangeText(float x, float y, int _index)
      Deprecated.
      Placeholder.
      Specified by:
      setRangeText in interface HistoLUTParent
      Parameters:
      x - x
      y - y
      _index - index
    • setRGBTA

      public void setRGBTA(ModelRGB RGBT)
      Deprecated.
      The following 2 functions set the RGB tables for images A and B.
      Parameters:
      RGBT - RGB table reference.
    • setRGBTB

      public void setRGBTB(ModelRGB RGBT)
      Deprecated.
      DOCUMENT ME!
      Parameters:
      RGBT - RGB table reference.
    • setRedOn

      public void setRedOn(boolean bOn, boolean bImageA)
      Deprecated.
    • setGreenOn

      public void setGreenOn(boolean bOn, boolean bImageA)
      Deprecated.
    • setBlueOn

      public void setBlueOn(boolean bOn, boolean bImageA)
      Deprecated.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Deprecated.
      Resets the buttons depending on which tab was selected.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - Event that triggered this function.
    • update

      public void update()
      Deprecated.
      Redisplay histoLUT.
    • updateComponentLUT

      public void updateComponentLUT()
      Deprecated.
      Placeholder.
      Specified by:
      updateComponentLUT in interface HistoLUTParent
    • updateFrames

      public void updateFrames(boolean flag)
      Deprecated.
      Update all of the image frames that display the image this histo lut is for.
      Specified by:
      updateFrames in interface HistoLUTParent
      Parameters:
      flag - this boolean indicates if the frame that displays the image should re-export the image and apply new LUT
      See Also:
    • updateHistoRGB

      public void updateHistoRGB(ModelImage _imageA, ModelImage _imageB, boolean progressFlag)
      Deprecated.
      This method is called to update the histogram(s) displayed in each tabbed pane of the frame.
      Parameters:
      _imageA - image A
      _imageB - image B
      progressFlag - passed to calculateHistogram algorithm. If false progress bar is not displayed.
    • updateLUTPositionString

      public void updateLUTPositionString(String str)
      Deprecated.
      Placeholder.
      Specified by:
      updateLUTPositionString in interface HistoLUTParent
      Parameters:
      str - string
    • updateThresholdFields

      public void updateThresholdFields(float lower, float upper)
      Deprecated.
      Placeholder.
      Specified by:
      updateThresholdFields in interface HistoLUTParent
      Parameters:
      lower - lower threshold
      upper - upper threshold
    • finalize

      protected void finalize() throws Throwable
      Deprecated.
      Calls dispose.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - throw exception.
    • testParameter

      protected boolean testParameter(String str, double minValue, double maxValue)
      Deprecated.
      Tests that the entered parameter is in range.
      Parameters:
      str - the value entered by the user
      minValue - the minimum value this variable may be set to
      maxValue - the maximum value this variable may be set to
      Returns:
      boolean result of test
    • buildMenu

      private void buildMenu()
      Deprecated.
      This method builds a menu which contains the options for opening/saving a LUT or set of transfer functions, closing the LUT, and utilities such as CT presets.
    • buildPanelA

      private void buildPanelA(ModelImage image, boolean entireFlag)
      Deprecated.
      Method that displays the histogram and LUT and other controls to manipulate the LUT. Panel for image A.
      Parameters:
      image - Model of image
      entireFlag - Flag indicating if histogram should be made of entire image.
    • buildPanelB

      private void buildPanelB(ModelImage image, boolean entireFlag)
      Deprecated.
      Method that displays the histogram and LUT and other controls to manipulate the LUT. Panel for image B.
      Parameters:
      image - Model of image
      entireFlag - Flag indicating if histogram should be made of entire image.
    • calcHistogram

      private void calcHistogram(int imageAorB, boolean entireFlag, boolean progressFlag)
      Deprecated.
      Calculates histogram for the image(s).
      Parameters:
      imageAorB - flag to indicate if histogram is to be calculated for imageA or imageB.
      entireFlag - if true calculate histogram for the entire image. if false uses areas defined by VOI regions.
      progressFlag - passed to calculateHistogram algorithm. If false progress bar is not displayed.
    • getDisplayMode

      public int getDisplayMode()
      Deprecated.
      Accessor that indicates which image is active:
      Returns:
      displayMode = IMAGE_A or IMAGE_B