Class DialogDTIColorDisplay

All Implemented Interfaces:
AlgorithmInterface, ViewImageUpdateInterface, ActionListener, ComponentListener, FocusListener, ItemListener, KeyListener, MouseListener, MouseWheelListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

Author:
pandyan This is the main dialog for the DTI Color Display References: Developed in concert with Sinisa Pajevic from the NIH/CIT/DCB/MSCL group, Lin-Ching Chang D.Sc., Carlo Pierpaoli MD Ph.D., and Lindsay Walker MS from the the NIH/NICHD/LIMB/STBB group and Olga Vogt from the NIH/CIT/DCB/ISL/BIRSS group: Mathematical and Statistical Computing Laboratory (MSCL) Biomedical Imaging Research Services Section (BIRSS) Imaging Sciences Laboratory (ISL) Division of Cumputational Bioscience (DCB) Center for Informational Technology (CIT) Section on Tissue Biophysics and Biomimetics (STBB) Laboratory of Integrative and Medical Biophysics (LIMB) National Institute of Child Health invalid input: '&' Humann Development National Institutes of Health Publication Reference: S. Pajevic and C. Pierpaoli, "Color Schemes to Represent the Orientation of Anisotropic Tissues from Diffusion Tensor Data: Application to White Matter Fiber Tract Mapping in the Human Brain," Magnetic Resonance in Medicine, vol. 42, no. 3, pp. 526-540, 1999
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • title

      private String title
      dialog title and version *
    • mainPanel

      private JPanel mainPanel
      panels *
    • bottomPanel

      private JPanel bottomPanel
      panels *
    • refPanel

      private JPanel refPanel
      panels *
    • colorPanel

      private JPanel colorPanel
      panels *
    • colorWheelPanel

      private JPanel colorWheelPanel
      panels *
    • resultImagePanel

      private JPanel resultImagePanel
      panels *
    • optionsPanel

      private JPanel optionsPanel
      panels *
    • colorWheelChoicesPanel

      private JPanel colorWheelChoicesPanel
      panels *
    • heuristicParametersPanel

      private JPanel heuristicParametersPanel
      panels *
    • anisotropyMaxPanel

      private JPanel anisotropyMaxPanel
      panels *
    • anisotropyMinPanel

      private JPanel anisotropyMinPanel
      panels *
    • gammaPanel

      private JPanel gammaPanel
      panels *
    • stevensBetaPanel

      private JPanel stevensBetaPanel
      panels *
    • satBluePanel

      private JPanel satBluePanel
      panels *
    • dimGreenPanel

      private JPanel dimGreenPanel
      panels *
    • colorRangePanel

      private JPanel colorRangePanel
      panels *
    • satVsThetaPanel

      private JPanel satVsThetaPanel
      panels *
    • resultPanel

      private JPanel resultPanel
      panels *
    • resultImageSliderPanel

      private JPanel resultImageSliderPanel
      panels *
    • tempPanel

      private JPanel tempPanel
      panels *
    • toolbarPanel

      private JPanel toolbarPanel
      panels *
    • adjustExpPanel

      private JPanel adjustExpPanel
      panels *
    • truncMultPanel

      private JPanel truncMultPanel
      panels *
    • restoreDefaultsPanel

      private JPanel restoreDefaultsPanel
      panels *
    • saveLoadPanel

      private JPanel saveLoadPanel
      panels *
    • minAnisotropyMaxLabel

      private JLabel minAnisotropyMaxLabel
      labels *
    • maxAnisotropyMaxLabel

      private JLabel maxAnisotropyMaxLabel
      labels *
    • minAnisotropyMinLabel

      private JLabel minAnisotropyMinLabel
      labels *
    • maxAnisotropyMinLabel

      private JLabel maxAnisotropyMinLabel
      labels *
    • minGammaLabel

      private JLabel minGammaLabel
      labels *
    • maxGammaLabel

      private JLabel maxGammaLabel
      labels *
    • minStevensBetaLabel

      private JLabel minStevensBetaLabel
      labels *
    • maxStevensBetaLabel

      private JLabel maxStevensBetaLabel
      labels *
    • minSatBlueLabel

      private JLabel minSatBlueLabel
      labels *
    • maxSatBlueLabel

      private JLabel maxSatBlueLabel
      labels *
    • minDimGreenLabel

      private JLabel minDimGreenLabel
      labels *
    • maxDimGreenLabel

      private JLabel maxDimGreenLabel
      labels *
    • minColorRangeLabel

      private JLabel minColorRangeLabel
      labels *
    • maxColorRangeLabel

      private JLabel maxColorRangeLabel
      labels *
    • minSatVsThetaLabel

      private JLabel minSatVsThetaLabel
      labels *
    • maxSatVsThetaLabel

      private JLabel maxSatVsThetaLabel
      labels *
    • minResultImageSlicesLabel

      private JLabel minResultImageSlicesLabel
      labels *
    • maxResultImageSlicesLabel

      private JLabel maxResultImageSlicesLabel
      labels *
    • currentResultImageSlicesLabel

      private JLabel currentResultImageSlicesLabel
      labels *
    • magLabel

      private JLabel magLabel
      labels *
    • refLabel1

      private JLabel refLabel1
      labels *
    • refLabel2

      private JLabel refLabel2
      labels *
    • refLabel3

      private JLabel refLabel3
      labels *
    • minAdjustExpLabel

      private JLabel minAdjustExpLabel
      labels *
    • maxAdjustExpLabel

      private JLabel maxAdjustExpLabel
      labels *
    • minAnisotropyMax

      private float minAnisotropyMax
      mins and maxes for heuristic parameters*
    • maxAnisotropyMax

      private float maxAnisotropyMax
      mins and maxes for heuristic parameters*
    • minAnisotropyMin

      private float minAnisotropyMin
      mins and maxes for heuristic parameters*
    • maxAnisotropyMin

      private float maxAnisotropyMin
      mins and maxes for heuristic parameters*
    • minGamma

      private float minGamma
      mins and maxes for heuristic parameters*
    • maxGamma

      private float maxGamma
      mins and maxes for heuristic parameters*
    • minStevensBeta

      private float minStevensBeta
      mins and maxes for heuristic parameters*
    • maxStevensBeta

      private float maxStevensBeta
      mins and maxes for heuristic parameters*
    • minSatBlue

      private float minSatBlue
      mins and maxes for heuristic parameters*
    • maxSatBlue

      private float maxSatBlue
      mins and maxes for heuristic parameters*
    • minDimGreen

      private float minDimGreen
      mins and maxes for heuristic parameters*
    • maxDimGreen

      private float maxDimGreen
      mins and maxes for heuristic parameters*
    • minColorRange

      private float minColorRange
      mins and maxes for heuristic parameters*
    • maxColorRange

      private float maxColorRange
      mins and maxes for heuristic parameters*
    • minSatVsTheta

      private float minSatVsTheta
      mins and maxes for heuristic parameters*
    • maxSatVsTheta

      private float maxSatVsTheta
      mins and maxes for heuristic parameters*
    • minAdjustExp

      private float minAdjustExp
      mins and maxes for heuristic parameters*
    • maxAdjustExp

      private float maxAdjustExp
      mins and maxes for heuristic parameters*
    • resultScrollPanel

      private JScrollPane resultScrollPanel
      scroll pane for result image *
    • anisotropyMaxTextField

      private JTextField anisotropyMaxTextField
      textfields *
    • anisotropyMinTextField

      private JTextField anisotropyMinTextField
      textfields *
    • gammaTextField

      private JTextField gammaTextField
      textfields *
    • stevensBetaTextField

      private JTextField stevensBetaTextField
      textfields *
    • satBlueTextField

      private JTextField satBlueTextField
      textfields *
    • dimGreenTextField

      private JTextField dimGreenTextField
      textfields *
    • colorRangeTextField

      private JTextField colorRangeTextField
      textfields *
    • satVsThetaTextField

      private JTextField satVsThetaTextField
      textfields *
    • adjustExpTextField

      private JTextField adjustExpTextField
      textfields *
    • magButton

      private JButton magButton
      buttons *
    • unMagButton

      private JButton unMagButton
      buttons *
    • zoomOneButton

      private JButton zoomOneButton
      buttons *
    • captureImageButton

      private JButton captureImageButton
      buttons *
    • restoreDefaultsButton

      private JButton restoreDefaultsButton
      buttons *
    • saveButton

      private JButton saveButton
      buttons *
    • loadButton

      private JButton loadButton
      buttons *
    • eigvecSrcImage

      private ModelImage eigvecSrcImage
      eigenvector src image *
    • anisotropyImage

      private ModelImage anisotropyImage
      anisotropy src image *
    • eigvecFilename

      private String eigvecFilename
      names of eigenvector and anisotropy files*
    • anisotropyFilename

      private String anisotropyFilename
      names of eigenvector and anisotropy files*
    • resultImage

      private ModelImage resultImage
      result image *
    • colorWheel

      private ColorWheel colorWheel
      Color Wheels *
    • alg

      handle to the algorithm *
    • gbl

      private GridBagLayout gbl
      GridBagLayout *
    • gbc

      private GridBagConstraints gbc
      GridbagConstraints *
    • anisotropyMaxSlider

      public JSlider anisotropyMaxSlider
      various sliders in dialog *
    • anisotropyMinSlider

      public JSlider anisotropyMinSlider
      various sliders in dialog *
    • gammaSlider

      public JSlider gammaSlider
      various sliders in dialog *
    • stevensBetaSlider

      public JSlider stevensBetaSlider
      various sliders in dialog *
    • satBlueSlider

      public JSlider satBlueSlider
      various sliders in dialog *
    • dimGreenSlider

      public JSlider dimGreenSlider
      various sliders in dialog *
    • colorRangeSlider

      public JSlider colorRangeSlider
      various sliders in dialog *
    • satVsThetaSlider

      public JSlider satVsThetaSlider
      various sliders in dialog *
    • resultImageSlider

      public JSlider resultImageSlider
      various sliders in dialog *
    • adjustExpSlider

      public JSlider adjustExpSlider
      various sliders in dialog *
    • titledBorder

      private TitledBorder titledBorder
      titled border for certain components *
    • colorWheelComboBox

      private JComboBox colorWheelComboBox
      color wheel choices combo box *
    • anisotropyMax

      private float anisotropyMax
      anisotropy max *
    • anisotropyMin

      private float anisotropyMin
      anisotropy min *
    • adjustExp

      private float adjustExp
      adjust exp *
    • gamma

      private float gamma
      gamma correction *
    • stevensBeta

      private float stevensBeta
      steven's beta *
    • pB

      private float pB
      blue saturation *
    • pG

      private float pG
      green saturation *
    • pC

      private float pC
      color range *
    • pS

      private float pS
      saturation vs theta *
    • componentImage

      private ViewJComponentDTIImage componentImage
      ViewJComponentDTIImage *
    • imageBufferA

      protected float[] imageBufferA
      Buffer used to store image intensities the presently viewed slice of image A.
    • resols

      protected float[] resols
      Storage of the image voxel resolutions. One resolution value per dimension.
    • pixBuffer

      protected int[] pixBuffer
      Integer buffer (4 bytes that stores the concatenated Alpha (1 byte), Red (1 byte), Green ( 1 byte ), Blue (1 byte ) data. The ARGB values are generated by using the imageA intensities as a index into a LUT.
    • units

      protected int[] units
      Storage of the resolution units of measure. For example, mm, cm, inches ...
    • zSlice

      private int zSlice
      current z slice *
    • widthResFactor

      protected float widthResFactor
      Storage for correction parameters where datasets have non isotropic values.
    • heightResFactor

      protected float heightResFactor
      Storage for correction parameters where datasets have non isotropic values.
    • tSlice

      protected int tSlice
      Image time sequence number of image that is displayed. Zero indexed based.
    • nImage

      protected int nImage
      Number of slices in a 3D dataset.
    • nTImage

      protected int nTImage
      Number of time sequences in a 4D dataset.
    • type

      private String type
      type of color wheel ABSVAL, NOSYMM, ROTATIONALSYMM, MIRRORSYMM *
    • toolbarBuilder

      private ViewToolBarBuilder toolbarBuilder
      ViewToolBarBuilder *
    • zoom

      private float zoom
      current zoom for result image *
    • numSlices

      private int numSlices
      num slices for result image *
    • currentRectangle

      private Rectangle currentRectangle
      rectangle for screen capture*
    • truncMultRadioGroup

      private ButtonGroup truncMultRadioGroup
      radio group for truncate/multiply *
    • truncRadio

      private JRadioButton truncRadio
      radio buttons for truncate/multiply *
    • multRadio

      private JRadioButton multRadio
      radio buttons for truncate/multiply *
    • isMultiply

      private boolean isMultiply
      boolean for truncate/multiply *
    • flag

      private boolean flag
      flag needed when performing restore defaults *
    • in

      private BufferedReader in
      Buffered Reader for loading params *
    • out

      private BufferedWriter out
      Buffered Writer for saving params *
    • currentColorWheelType

      private String currentColorWheelType
      String indicating current color wheel type *
    • m_afScreenResolutions

      private float[] m_afScreenResolutions
      Sets the correct resolutions for the image that is created by captureImage.
    • m_fSliceThickness

      private float m_fSliceThickness
      Sets the correct slice thickness
  • Constructor Details

    • DialogDTIColorDisplay

      public DialogDTIColorDisplay(boolean modal)
      Constructor
    • DialogDTIColorDisplay

      public DialogDTIColorDisplay(ModelImage kEigenVector, ModelImage kAnisotropy, ModelLUT kLUT, boolean modal)
  • Method Details

    • init

      public void init()
      init
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      action performed
      Specified by:
      actionPerformed in interface ActionListener
      Specified by:
      actionPerformed in class ViewJFrameBase
      Parameters:
      e - the event from the UI
    • algorithmPerformed

      public void algorithmPerformed(AlgorithmBase algorithm)
      algorithm performed
      Specified by:
      algorithmPerformed in interface AlgorithmInterface
      Parameters:
      algorithm - the algorithm which has just completed
    • callAlgorithm

      protected void callAlgorithm()
      call algorithm
    • stateChanged

      public void stateChanged(ChangeEvent e)
      state changed
      Specified by:
      stateChanged in interface ChangeListener
      Overrides:
      stateChanged in class ViewJFrameBase
      Parameters:
      e - the change event
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      item state changed
      Specified by:
      itemStateChanged in interface ItemListener
    • updateCurrentColorWheel

      public void updateCurrentColorWheel()
      update current color wheel
    • mouseClicked

      public void mouseClicked(MouseEvent event)
      mouse clicked
      Specified by:
      mouseClicked in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent event)
      mouse entered
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent event)
      mouse exited
      Specified by:
      mouseExited in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent event)
      mouse pressed
      Specified by:
      mousePressed in interface MouseListener
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      mouse released
      Specified by:
      mouseReleased in interface MouseListener
    • magImage

      public void magImage()
      magnifies image
    • unMagImage

      public void unMagImage()
      un-magnifies image
    • zoomOne

      public void zoomOne()
      sets image zoom to 1
    • restoreDefaults

      public void restoreDefaults()
      restore default parameters
    • saveParams

      public void saveParams()
      save heuristic parameters
    • loadParams

      public void loadParams()
      loads heuristic parameter values
    • captureImage

      private boolean captureImage()
      Scrolls through all z slices of a 3d/4d image and captures them into a new ARGB ModelImage, then puts the ModelImage in a ViewJFrameImage.
      Returns:
    • windowClosing

      public void windowClosing(WindowEvent event)
      window closing
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class ViewJFrameBase
      Parameters:
      event - the window event that triggered this method
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent event)
      mouse wheel moved
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
      Parameters:
      event -
    • keyTyped

      public void keyTyped(KeyEvent event)
      key typed
      Specified by:
      keyTyped in interface KeyListener
    • focusLost

      public void focusLost(FocusEvent event)
      focus lost
      Specified by:
      focusLost in interface FocusListener
    • validateCurrentNum

      public float validateCurrentNum(String numString, float min, float max)
      validate current number
      Parameters:
      numString -
      min -
      max -
      Returns:
    • initImageBuffer

      protected static float[] initImageBuffer(int[] extents, boolean isColor)
      Create the intensity buffer for an image.
      Parameters:
      extents - the extents of the image
      isColor - whether the image is in color
      Returns:
      a buffer which is big enough to contain the image intensity data
    • initPixelBuffer

      protected static int[] initPixelBuffer(int[] extents)
      Create the pixel buffer for an image.
      Parameters:
      extents - the extents of the image
      Returns:
      a buffer which is big enough to contain the image pixel data
    • initResolutions

      protected static float[] initResolutions(ModelImage img)
      init resolutions
      Parameters:
      img -
      Returns:
    • initUnits

      protected static int[] initUnits(ModelImage img)
      init units
      Parameters:
      img -
      Returns:
    • initResFactor

      protected static float[] initResFactor(float[] imgResols, int[] imgUnits)
      Get the resolution correction needed for non-isotropic images.
      Parameters:
      imgResols - the image resolution
      imgUnits - the image units of measure
      Returns:
      the resolution correction factor in the x (the first element) and y (the second element) dimensions
    • initRGB

      public static ModelRGB initRGB(ModelImage img) throws OutOfMemoryError
      Creates and initializes the ModelRGB for an image.
      Parameters:
      img - the image to create a ModelRGB for
      Returns:
      a ModelRGB for the image img (null if NOT a color image)
      Throws:
      OutOfMemoryError - if enough memory cannot be allocated for this method
    • initExtentsVariables

      public void initExtentsVariables(ModelImage img)
      Initializes the variables based on the image extents. (i.e. number of slices, number of time slices, the initial z-slice, etc.
      Parameters:
      img - the image to set the extent variables for
    • initSlicePositions

      protected static int[] initSlicePositions(ModelImage img)
      Get the initial time and volume slice positions.
      Parameters:
      img - the image to get the slice positions of
      Returns:
      an array containing the slice in the volume (in the first element) and the time slice (in the second element)
    • initNumSlices

      protected static int[] initNumSlices(ModelImage img)
      Get the total number of time slices and volume slices.
      Parameters:
      img - the image to get the slices of
      Returns:
      an array containing the number of volume slices (in the first element) and the number of time slices in the image (in the second element)
    • finalize

      public void finalize()
      finalize
      Overrides:
      finalize in class ViewJFrameBase
    • getRGBTA

      public ModelRGB getRGBTA()
      Gets the RGB LUT table for ARGB image A.
      Overrides:
      getRGBTA in class ViewJFrameBase
      Returns:
      RGBT the new RGB LUT to be applied to the image
    • setRGBTA

      public void setRGBTA(ModelRGB RGBT)
      Sets the RGB LUT table for ARGB image A.
      Specified by:
      setRGBTA in class ViewJFrameBase
      Parameters:
      RGBT - the new RGB LUT to be applied to the image
    • getControls

      public ViewControlsImage getControls()
      get controls
      Specified by:
      getControls in class ViewJFrameBase
      Returns:
      the frame's image controls
    • getImageA

      public ModelImage getImageA()
      get image a
      Specified by:
      getImageA in class ViewJFrameBase
      Returns:
      imageA
    • getImageB

      public ModelImage getImageB()
      get image b
      Specified by:
      getImageB in class ViewJFrameBase
      Returns:
      imageB
    • removeControls

      public void removeControls()
      remove controls
      Specified by:
      removeControls in class ViewJFrameBase
    • setActiveImage

      public void setActiveImage(int active)
      set active image
      Specified by:
      setActiveImage in class ViewJFrameBase
      Parameters:
      active - IMAGE_A or IMAGE_B
    • setAlphaBlend

      public void setAlphaBlend(int value)
      set alpha blend
      Specified by:
      setAlphaBlend in class ViewJFrameBase
      Parameters:
      value - amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
    • setControls

      public void setControls()
      set controls
      Specified by:
      setControls in class ViewJFrameBase
    • setEnabled

      public void setEnabled(boolean flag)
      set enabled
      Specified by:
      setEnabled in class ViewJFrameBase
      Parameters:
      flag - if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
    • setImageB

      public void setImageB(ModelImage imageB)
      set image b
      Specified by:
      setImageB in class ViewJFrameBase
      Parameters:
      imageB - The image to make image-B in this frame.
    • setPaintBitmapSwitch

      public void setPaintBitmapSwitch(boolean flag)
      set paint bitmap switch
      Specified by:
      setPaintBitmapSwitch in class ViewJFrameBase
      Parameters:
      flag - if true do not getMask on a setActiveImage command
    • setRGBTB

      public void setRGBTB(ModelRGB RGBT)
      set rgbtb
      Specified by:
      setRGBTB in class ViewJFrameBase
      Parameters:
      RGBT - the RGB table to use for image B
    • setTitle

      public void setTitle()
      set title
      Specified by:
      setTitle in class ViewJFrameBase
    • updateImageExtents

      public boolean updateImageExtents()
      update image extents
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Specified by:
      updateImageExtents in class ViewJFrameBase
      Returns:
      true if the update was successful, false otherwise
      See Also:
    • setSlice

      public void setSlice(int slice)
      set slice
      Specified by:
      setSlice in interface ViewImageUpdateInterface
      Parameters:
      slice - Current slice
    • setTimeSlice

      public void setTimeSlice(int tSlice)
      set time slice
      Specified by:
      setTimeSlice in interface ViewImageUpdateInterface
      Parameters:
      tSlice - Current time volume
    • updateImages

      public boolean updateImages()
      update images
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(boolean flag)
      update images
      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)
      update images
      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
    • focusGained

      public void focusGained(FocusEvent event)
      focus gained
      Specified by:
      focusGained in interface FocusListener
    • keyPressed

      public void keyPressed(KeyEvent event)
      key pressed
      Specified by:
      keyPressed in interface KeyListener
    • keyReleased

      public void keyReleased(KeyEvent event)
      key released
      Specified by:
      keyReleased in interface KeyListener
    • setScreenImageResolutions

      public void setScreenImageResolutions(float[] afResolutions, float fSlice)
      Sets the correct resolutions for the image that is created by captureImage.
      Parameters:
      afResolutions - correct image resolutions.
      fSlice - slice thickness