Class JPanelHistoLUT

java.lang.Object
gov.nih.mipav.view.renderer.JPanelHistoLUT
All Implemented Interfaces:
HistoLUTParent, ViewImageUpdateInterface, ActionListener, FocusListener, ItemListener, KeyListener, EventListener, ChangeListener

Deprecated.
This class produces a frame where the user can specify a specific LUT, the number of colors of the LUT or dynamically edit the LUT. The frame with histogram of the image data is displayed using the color map. All frames using the color map are dynamically updated with the new color map. This control panel is the control LUT of the gray scale images.
Version:
1.0
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:
    • displayMode

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

      private int cursorIndex
      Deprecated.
      Active mouse cursor index of the imageA, B and GM image A, B.
    • cursorIndexB

      private int cursorIndexB
      Deprecated.
      Active mouse cursor index of the imageA, B and GM image A, B.
    • entireFlag

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

      private ModelHistogram histogramA
      Deprecated.
      Model histogram A.
    • histogramB

      private ModelHistogram histogramB
      Deprecated.
      Model histogram B.
    • histoPanelA

      private ViewJPanelHistoLUT histoPanelA
      Deprecated.
      Panel containing the histogram and lut components for image A.
    • histoPanelB

      private ViewJPanelHistoLUT histoPanelB
      Deprecated.
      Panel containing the histogram and lut components for image B.
    • imageA

      private ModelImage imageA
      Deprecated.
      image A reference.
    • imageB

      private ModelImage imageB
      Deprecated.
      image B reference.
    • indexColorATextF

      private JTextField indexColorATextF
      Deprecated.
      Color LUT A, B textfield.
    • indexColorBTextF

      private JTextField indexColorBTextF
      Deprecated.
      Color LUT A, B textfield.
    • labelsTable

      private Hashtable<Integer,JLabel> labelsTable
      Deprecated.
      Histogram dialog slider labels of the imageA, B and GM imageA, B.
    • labelsTableB

      private Hashtable<Integer,JLabel> labelsTableB
      Deprecated.
      Histogram dialog slider labels of the imageA, B and GM imageA, B.
    • logCheckBoxA

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

      private JCheckBox logCheckBoxB
      Deprecated.
      The histogram log view Check box.
    • LUTa

      private ModelLUT LUTa
      Deprecated.
      Model LUT A.
    • lutAdjustCheckboxA

      private JCheckBox lutAdjustCheckboxA
      Deprecated.
      LutA table adjust check box.
    • lutAdjustCheckboxB

      private JCheckBox lutAdjustCheckboxB
      Deprecated.
      LutB table adjust check box.
    • LUTb

      private ModelLUT LUTb
      Deprecated.
      Model LUT B.
    • mainPanel

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

      private JLabel mouseLabel
      Deprecated.
      The opacity slider label.
    • mouseLabelB

      private JLabel mouseLabelB
      Deprecated.
      The opacity slider label.
    • mouseSlider

      private JSlider mouseSlider
      Deprecated.
      Opacity X scale sliders.
    • mouseSliderB

      private JSlider mouseSliderB
      Deprecated.
      Opacity X scale sliders.
    • mouseSliderLabels

      private JLabel[] mouseSliderLabels
      Deprecated.
      The labels below the opacity slider.
    • mouseSliderLabelsB

      private JLabel[] mouseSliderLabelsB
      Deprecated.
      The labels below the opacity slider.
    • nColorsATextF

      private JTextField nColorsATextF
      Deprecated.
      Update check box. Updating the histogram and volume during mouse drag.
    • nColorsBTextF

      private JTextField nColorsBTextF
      Deprecated.
      Update check box. Updating the histogram and volume during mouse drag.
    • panelA

      private JPanel panelA
      Deprecated.
      Tabbed panel A.
    • panelB

      private JPanel panelB
      Deprecated.
      Tabbed panel B.
    • rangeText

      private JTextField rangeText
      Deprecated.
      X range text field in the imageA, B histogram dialog.
    • rangeTextB

      private JTextField rangeTextB
      Deprecated.
      X range text field in the imageA, B histogram dialog.
    • rangeX

      private float rangeX
      Deprecated.
      X range value of the imageA, B and GM imageA, B.
    • rangeXB

      private float rangeXB
      Deprecated.
      X range value of the imageA, B and GM imageA, B.
    • scaleRangeA

      private int scaleRangeA
      Deprecated.
      Scale range value according to the image min and max.
    • scaleRangeB

      private int scaleRangeB
      Deprecated.
      Scale range value according to the image min and max.
    • scroller

      private JScrollPane scroller
      Deprecated.
      Scroll pane.
    • scrollPanel

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

      private JTabbedPane tabbedPane
      Deprecated.
      The main tabbed control panel.
    • threshLowerF

      private JTextField threshLowerF
      Deprecated.
      threshold related.
    • threshUpperF

      private JTextField threshUpperF
      Deprecated.
      threshold related.
    • toolBarBottom

      private JToolBar toolBarBottom
      Deprecated.
      Bottom toolbar.
    • toolBarObj

      private ViewToolBarBuilder toolBarObj
      Deprecated.
      Toolbar that hold the linear, horizontal mode control buttons.
    • toolBarTop

      private JToolBar toolBarTop
      Deprecated.
      Top toolbar
    • toolBarCenter

      private JToolBar toolBarCenter
      Deprecated.
      center toolbar
    • topPanel

      private JPanel topPanel
      Deprecated.
      Toolbar panel.
    • xRangeTextA

      private JTextField xRangeTextA
      Deprecated.
      X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
    • xRangeTextB

      private JTextField xRangeTextB
      Deprecated.
      X range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
    • yRangeTextA

      private JTextField yRangeTextA
      Deprecated.
      Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
    • yRangeTextB

      private JTextField yRangeTextB
      Deprecated.
      Y range text field in the imageA, B and GM image A, B histogram dialog. Following text fields are used by the tri-planar volume view.
    • ctDialogA

      private JDialogCTHistoLUT ctDialogA
      Deprecated.
      Reference to CT dialog. The CT dialog only works with the componentHistogram.
    • ctDialogB

      private JDialogCTHistoLUT ctDialogB
      Deprecated.
      Reference to CT dialog. The CT dialog only works with the componentHistogram.
    • bImageUpdate

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

    • JPanelHistoLUT

      public JPanelHistoLUT(ModelImage _imageA, ModelImage _imageB, ModelLUT _LUTa, ModelLUT _LUTb, boolean _entireFlag)
      Deprecated.
      Makes a frame of the histogram and LUT.
      Parameters:
      _imageA - Model of imageA
      _imageB - Model of imageB
      _LUTa - Model of LUT for image A
      _LUTb - Model of LUT for image B
      _entireFlag - Flag indicating if histogram should be done on all of image.
    • JPanelHistoLUT

      public JPanelHistoLUT(ModelImage _imageA, ModelImage _imageB, ModelLUT _LUTa, ModelLUT _LUTb, boolean _entireFlag, boolean bUpdateImage)
      Deprecated.
      Makes a frame of the histogram and LUT.
      Parameters:
      _imageA - Model of imageA
      _imageB - Model of imageB
      _LUTa - Model of LUT for image A
      _LUTb - Model of LUT for image B
      _entireFlag - Flag indicating if histogram should be done on all of image.
  • 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
    • focusGained

      public void focusGained(FocusEvent e)
      Deprecated.
      Focus Events:
      Specified by:
      focusGained in interface FocusListener
      Parameters:
      e - event handler.
    • focusLost

      public void focusLost(FocusEvent e)
      Deprecated.
      If focus is lost from either threshold field (lower/upper), update the new value on the LUT.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      e - FocusEvent
    • getDisplayMode

      public int getDisplayMode()
      Deprecated.
      Get the LUT panel current display mode.
      Returns:
      int displayMode value, which is either IMAGE_A or IMAGE_B
    • getHistoLUTComponentA

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

      public ViewJComponentHLUTBase 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
    • getLUT

      public ModelLUT getLUT()
      Deprecated.
      This method returns the current LUT.
      Returns:
      LUT for Image A if selected, otherwise for Image B
    • getLUTa

      public final ModelLUT getLUTa()
      Deprecated.
      Get the imageA histo component lut.
      Returns:
      ModelLUT
    • getLUTb

      public final ModelLUT getLUTb()
      Deprecated.
      Get the imageB histo component lut.
      Returns:
      ModelLUT
    • getLUTComponentA

      public ViewJComponentLUT getLUTComponentA()
      Deprecated.
      Get the imageA LUT.
      Returns:
      the imageA LUT component
    • getLUTComponentB

      public ViewJComponentLUT getLUTComponentB()
      Deprecated.
      Get the imageB LUT.
      Returns:
      the imageB LUT component
    • getMainPanel

      public JPanel getMainPanel()
      Deprecated.
      Return the main control panel.
      Returns:
      mainPanel the main control panel
    • getSelectedLUT

      public int getSelectedLUT()
      Deprecated.
      Returns which LUT is currently visible.
      Returns:
      return the currently selcted LUT table index.
    • getTransferLine

      public TransferFunction getTransferLine()
      Deprecated.
      This method is used to obtain the VOIBase Single Transfer Line.
      Returns:
      LUTb.getTransferFunction() - VOIBase of Single Transfer Line for Image B
    • 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
    • keyPressed

      public void keyPressed(KeyEvent e)
      Deprecated.
      Unchanged.
      Specified by:
      keyPressed in interface KeyListener
      Parameters:
      e - key press event handler.
    • keyReleased

      public void keyReleased(KeyEvent e)
      Deprecated.
      Unchanged.
      Specified by:
      keyReleased in interface KeyListener
      Parameters:
      e - kay release event handler.
    • keyTyped

      public void keyTyped(KeyEvent e)
      Deprecated.
      If the ENTER key is hit while in threshold boxes, update the LUT's threshold (for dual threshold).
      Specified by:
      keyTyped in interface KeyListener
      Parameters:
      e - KeyEvent
    • 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.
    • loadLUTandTransferFunctionFrom

      public void loadLUTandTransferFunctionFrom(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.
    • notifyOfUpdate

      public void notifyOfUpdate(ModelLUT LUT, int imageAorB)
      Deprecated.
      Enable button to indicate image has changed and the histogram should be recalculated.
      Parameters:
      LUT - new Lookup table
      imageAorB - indicates which histogram needs to be recalculated
    • removeHistoLUTb

      public void removeHistoLUTb()
      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 - panel width.
      frameHeight - parent frame 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
    • saveLUTandTransferFunction

      public void saveLUTandTransferFunction(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
    • selectLUTa

      public void selectLUTa()
      Deprecated.
      Forces the panel to display the LUTB panel.
    • selectLUTb

      public void selectLUTb()
      Deprecated.
      Forces the panel to display the LUTB panel.
    • setAllOff

      public void setAllOff()
      Deprecated.
      Placeholder.
      Specified by:
      setAllOff in interface HistoLUTParent
    • setCTMode

      public void setCTMode(int st, int end)
      Deprecated.
      This method is used to set Computed Tomography (CT) presets for CT images.
      Parameters:
      st - starting preset of the window
      end - ending preset of the window
      See Also:
    • setHistoLUTa

      public final void setHistoLUTa(ModelLUT lut)
      Deprecated.
      Change the histogram component LUT.
      Parameters:
      lut - the new lut
    • setHistoLUTb

      public final void setHistoLUTb(ModelLUT lut)
      Deprecated.
      Change the histogram component LUT.
      Parameters:
      lut - the new lut
    • 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
    • setLinearLUT

      public void setLinearLUT()
      Deprecated.
      This method sets the histogram to Linear Transfer Function Mode.
    • setLUT

      public void setLUT(ModelLUT LUT)
      Deprecated.
      Replaces the LUT and builds a new LUT component.
      Specified by:
      setLUT in interface HistoLUTParent
      Parameters:
      LUT - New LUT
    • setLUTA

      public void setLUTA(ModelLUT LUT)
      Deprecated.
      Replaces the LUT A component.
      Parameters:
      LUT - new LUT
    • setLUTa

      public void setLUTa(ModelLUT _LUTa)
      Deprecated.
      Set imageA lookup table.
      Parameters:
      _LUTa - ModelLUTa
    • setLUTB

      public void setLUTB(ModelLUT LUT)
      Deprecated.
      Replaces the LUT B component.
      Parameters:
      LUT - new LUT
    • setLUTb

      public void setLUTb(ModelLUT _LUTb)
      Deprecated.
      Set imageB lookup table.
      Parameters:
      _LUTb - ModelLUTb
    • setRangeText

      public void setRangeText(float x, float y, int _index)
      Deprecated.
      Set the range value of the text field.
      Specified by:
      setRangeText in interface HistoLUTParent
      Parameters:
      x - the x threshold range value
      y - the y threshold range value
      _index - the cursor index
    • setSlice

      public void setSlice(int slice)
      Deprecated.
      Does nothing in this.
      Specified by:
      setSlice in interface ViewImageUpdateInterface
      Parameters:
      slice - slice value.
    • setTimeSlice

      public void setTimeSlice(int tSlice)
      Deprecated.
      Does nothing in this class.
      Specified by:
      setTimeSlice in interface ViewImageUpdateInterface
      Parameters:
      tSlice - time slice value.
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Deprecated.
      Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Parameters:
      e - event that triggered this function
    • updateComponentLUT

      public void updateComponentLUT()
      Deprecated.
      update the LUT and images.
      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:
    • updateHistoLUT

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

      public boolean updateImageExtents()
      Deprecated.
      This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Returns:
      return false.
    • updateImages

      public boolean updateImages()
      Deprecated.
      This methods calls the componentImage's REPAINT method to redraw the screen. Without LUT changes or image changes
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Returns:
      return false.
    • updateImages

      public boolean updateImages(boolean flag)
      Deprecated.
      This methods calls the componentImage's update method to redraw the screen. Without LUT changes. Does nothing in this class.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      flag - forces show to re import image and calc. java image
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean flag, int interpMode)
      Deprecated.
      This methods calls the componentImage's update method to redraw the screen. Does nothing in this class.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      LUTa - LUT used to update imageA
      LUTb - LUT used to update imageB
      flag - forces show to re import image and calc. java image
      interpMode - image interpolation method (Nearest or Smooth)
      Returns:
      boolean confirming a successful update
    • updateLUTPositionString

      public void updateLUTPositionString(String str)
      Deprecated.
      Sets the position string in the LUT text field.
      Specified by:
      updateLUTPositionString in interface HistoLUTParent
      Parameters:
      str - the position string
    • updateThresholdFields

      public void updateThresholdFields(float lower, float upper)
      Deprecated.
      Method to update the threshold text fields when the lower or upper threshold changes.
      Specified by:
      updateThresholdFields in interface HistoLUTParent
      Parameters:
      lower - the lower threshold value
      upper - the upper threshold value
    • finalize

      protected void finalize() throws Throwable
      Deprecated.
      Calls dispose.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - dispose memory.
    • makeString

      protected String makeString(float number, int decPts)
      Deprecated.
      Makes a string of a float with a specific number of decimal points.
      Parameters:
      number - number to be converted to a string
      decPts - the number of decimal points
      Returns:
      string representation of the number
    • 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
    • buildPanelA

      private void buildPanelA(ModelImage image, ModelLUT LUT, 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
      LUT - Model of LUT
      entireFlag - Flag indicating if histogram should be made of entire image.
    • buildPanelB

      private void buildPanelB(ModelImage image, ModelLUT LUT, 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
      LUT - Model of LUT
      entireFlag - Flag indicating if histogram should be made of entire image.
    • calcHistogram

      private void calcHistogram(int imageAorB, boolean entireFlag)
      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.
    • setLUTs

      private void setLUTs(ModelLUT _LUTa, ModelLUT _LUTb)
      Deprecated.
      Set the gray scale image LUT tables.
      Parameters:
      _LUTa - ModelLUTA
      _LUTb - ModelLUTB