Class ViewJFrameColocalizationEM

All Implemented Interfaces:
ViewImageUpdateInterface, ActionListener, ComponentListener, ItemListener, WindowListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener, RootPaneContainer, WindowConstants

public class ViewJFrameColocalizationEM extends ViewJFrameBase implements ChangeListener, ItemListener
This class produces a frame surrounding a 2D histogram with ellipses surrounding the most prominent clusters. Tool bar buttons are present for magnify, unmagnify, for generating a histogram LUT dialog, for generating a dialog to set brightness and contrast, and for switching between linear and log mode. Magnify will double the present magnification and Unmagnify will half the present magnification. Magnifications are only powers of 2.

The LUT dialog can be used to set colors and transfer functions of the LUT table used by the 2D histogram display.

The dialog box for brightness and contrast has brightness and contrast sliders, an Apply button, and a Cancel button. The brightness will add an offset ranging from -255 to 255 to every scaled red, green, and blue in the image. Contrast will multiply every original red, green, and blue value by a floating point number ranging from 0.1 to 10.0. Before apply is pressed, slider changes are only temporarily made to the currently displayed slice. If apply is pressed, these changes are permanently made to the histogram image. Pressing cancel keeps all the histogram image in its original state.

The file menu only has 1 simple function - a close ViewJFramColocalization structure function.

ViewJFrameColocalizationEM is called in AlgorithmColocalizationEM. ViewJFrameColocalizationEM calls ViewJComponentColocalizationEM

See Also:
  • Field Details

    • serialVersionUID

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

      private int bottomPad
      DOCUMENT ME!
    • componentImage

      private ViewJComponentColocalizationEM componentImage
      DOCUMENT ME!
    • componentY

      private int componentY
      DOCUMENT ME!
    • controlFrame

      private ViewJFrameBase controlFrame
      DOCUMENT ME!
    • controls

      private ViewControlsImage controls
      DOCUMENT ME!
    • destImage

      private ModelImage destImage
      The image containing the 2D histogram.
    • etchedBorder

      private Border etchedBorder
      DOCUMENT ME!
    • extents

      private int[] extents
      DOCUMENT ME!
    • gbcTP

      private GridBagConstraints gbcTP
      DOCUMENT ME!
    • halfMajor

      private double[] halfMajor
      DOCUMENT ME!
    • halfMinor

      private double[] halfMinor
      DOCUMENT ME!
    • imageA

      private ModelImage imageA
      DOCUMENT ME!
    • imageB

      private ModelImage imageB
      DOCUMENT ME!
    • imageBufferDest

      private float[] imageBufferDest
      DOCUMENT ME!
    • innerPanel

      private JPanel innerPanel
      DOCUMENT ME!
    • leftPad

      private int leftPad
      The spaces around the histogram bin area.
    • logDisplayButton

      private JToggleButton logDisplayButton
      DOCUMENT ME!
    • logMagDisplay

      private boolean logMagDisplay
      DOCUMENT ME!
    • LUTa

      private ModelLUT LUTa
      DOCUMENT ME!
    • LUTdest

      private ModelLUT LUTdest
      The LUT for the 2D histogram.
    • mean

      private double[][] mean
      red, green, and blue origContrast remains constant until applyButton is pressed, restores contrast if cancelButton is pressed.
    • min1

      private double min1
      Minimum and maximum buffer and secondBuffer areas.
    • max1

      private double max1
      Minimum and maximum buffer and secondBuffer areas.
    • min2

      private double min2
      Minimum and maximum buffer and secondBuffer areas.
    • max2

      private double max2
      Minimum and maximum buffer and secondBuffer areas.
    • minimumHeight

      private int minimumHeight
      DOCUMENT ME!
    • minimumToolBarWidth

      private int minimumToolBarWidth
      DOCUMENT ME!
    • openingMenuBar

      private JMenuBar openingMenuBar
      DOCUMENT ME!
    • origBrightness

      private int origBrightness
      DOCUMENT ME!
    • origContrast

      private float origContrast
      red, green, and blue origBrightness remains constant until applyButton is pressed, restores brightness if cancelButton is pressed.
    • paintBufferDest

      private int[] paintBufferDest
      DOCUMENT ME!
    • pixBufferDest

      private int[] pixBufferDest
      DOCUMENT ME!
    • pressedBorder

      private Border pressedBorder
      DOCUMENT ME!
    • raisedBorder

      private Border raisedBorder
      DOCUMENT ME!
    • RGBTA

      private ModelRGB RGBTA
      DOCUMENT ME!
    • rightPad

      private int rightPad
      DOCUMENT ME!
    • scale1

      private double scale1
      bin1 is generated from Math.round(scale1*(buffer[i]-min1)) and bin2 is generated from Math.round(scale2*(secondBuffer[i]-min2)).
    • scale2

      private double scale2
      bin1 is generated from Math.round(scale1*(buffer[i]-min1)) and bin2 is generated from Math.round(scale2*(secondBuffer[i]-min2)).
    • scrollPane

      private JScrollPane scrollPane
      DOCUMENT ME!
    • scrollPaneSize

      private int scrollPaneSize
      DOCUMENT ME!
    • structureY

      private int structureY
      DOCUMENT ME!
    • theta

      private double[] theta
      DOCUMENT ME!
    • toolBar

      private JToolBar toolBar
      DOCUMENT ME!
    • topPad

      private int topPad
      DOCUMENT ME!
    • topPanel

      private JPanel topPanel
      and innerPanel placed in scrollPane.
    • useBlue

      private boolean useBlue
      DOCUMENT ME!
    • useGreen

      private boolean useGreen
      DOCUMENT ME!
    • useRed

      private boolean useRed
      DOCUMENT ME!
    • userInterface

      private ViewUserInterface userInterface
      DOCUMENT ME!
    • xScreen

      private int xScreen
      DOCUMENT ME!
    • yScreen

      private int yScreen
      DOCUMENT ME!
    • zoom

      private float zoom
      DOCUMENT ME!
  • Constructor Details

    • ViewJFrameColocalizationEM

      public ViewJFrameColocalizationEM(ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, ModelRGB _RGBTA, ModelImage destImage, ViewJFrameBase controlFrame, boolean useRed, boolean useGreen, boolean useBlue, double min1, double max1, double min2, double max2, double scale1, double scale2, int leftPad, int rightPad, int bottomPad, int topPad, double[][] mean, double[] halfMajor, double[] halfMinor, double[] theta)
      Makes a frame of the animated image.
      Parameters:
      _imageA - Model of imageA
      _LUTa - Model of LUT for image A
      _imageB - Model of imageB
      _LUTb - Model of LUT for image B
      _RGBTA - Model RGB LUT for color image (A) else null
      destImage - The destination image
      controlFrame - ViewJFrameBase passed to ViewJComponentColocalizationEM
      useRed - DOCUMENT ME!
      useGreen - DOCUMENT ME!
      useBlue - DOCUMENT ME!
      min1 - DOCUMENT ME!
      max1 - DOCUMENT ME!
      min2 - DOCUMENT ME!
      max2 - DOCUMENT ME!
      scale1 - DOCUMENT ME!
      scale2 - DOCUMENT ME!
      leftPad - DOCUMENT ME!
      rightPad - DOCUMENT ME!
      bottomPad - DOCUMENT ME!
      topPad - DOCUMENT ME!
      mean - DOCUMENT ME!
      halfMajor - DOCUMENT ME!
      halfMinor - DOCUMENT ME!
      theta - DOCUMENT ME!
  • Method Details

    • actionPerformed

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

      public void cancelBrightness()
      Resets current slice's brightness and contrast to original.
    • componentResized

      public void componentResized(ComponentEvent event)
      Resizes frame and all components.
      Specified by:
      componentResized in interface ComponentListener
      Overrides:
      componentResized in class ViewJFrameBase
      Parameters:
      event - event that triggered function
    • dispose

      public void dispose()
      Disposes of components and frame.
      Overrides:
      dispose in class Window
    • getControls

      public ViewControlsImage getControls()
      Get control widgets for frame.
      Specified by:
      getControls in class ViewJFrameBase
      Returns:
      controls
    • getImageA

      public ModelImage getImageA()
      Accessor that returns the reference to imageA.
      Specified by:
      getImageA in class ViewJFrameBase
      Returns:
      image
    • getImageB

      public ModelImage getImageB()
      Accessor that returns the reference to imageB.
      Specified by:
      getImageB in class ViewJFrameBase
      Returns:
      imageB
    • itemStateChanged

      public void itemStateChanged(ItemEvent event)
      Sets border painted or not painted depending on if the button was selected or deselected. Changes the currently selected script.
      Specified by:
      itemStateChanged in interface ItemListener
      Parameters:
      event - Event that triggered this function.
    • removeControls

      public void removeControls()
      Does nothing.
      Specified by:
      removeControls in class ViewJFrameBase
    • setActiveImage

      public void setActiveImage(int active)
      Does nothing.
      Specified by:
      setActiveImage in class ViewJFrameBase
      Parameters:
      active - DOCUMENT ME!
    • setAlphaBlend

      public void setAlphaBlend(int value)
      Does nothing.
      Specified by:
      setAlphaBlend in class ViewJFrameBase
      Parameters:
      value - DOCUMENT ME!
    • setBrightness

      public void setBrightness(int brightness, float contrast)
      Sets the brightness and contrast of the component image. Set all slices to have the new brightness and contrast. Results in createImage producing an Image img[slice] for every slice.
      Parameters:
      brightness - Brightness to set.
      contrast - Contrast to set.
    • setControls

      public void setControls()
      Does nothing.
      Specified by:
      setControls in class ViewJFrameBase
    • setEnabled

      public void setEnabled(boolean flag)
      Does nothing.
      Specified by:
      setEnabled in class ViewJFrameBase
      Parameters:
      flag - DOCUMENT ME!
    • setImageB

      public void setImageB(ModelImage _imageB)
      Does nothing.
      Specified by:
      setImageB in class ViewJFrameBase
      Parameters:
      _imageB - DOCUMENT ME!
    • setLUTdest

      public void setLUTdest(ModelLUT LUTdest)
      DOCUMENT ME!
      Parameters:
      LUTdest - DOCUMENT ME!
    • setPaintBitmapSwitch

      public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
      Does nothing.
      Specified by:
      setPaintBitmapSwitch in class ViewJFrameBase
      Parameters:
      paintBitmapSwitch - DOCUMENT ME!
    • 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
    • setRGBTB

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

      public void setSlice(int slice)
      Does nothing.
      Specified by:
      setSlice in interface ViewImageUpdateInterface
      Parameters:
      slice - DOCUMENT ME!
    • setTimeSlice

      public void setTimeSlice(int slice)
      Does nothing.
      Specified by:
      setTimeSlice in interface ViewImageUpdateInterface
      Parameters:
      slice - DOCUMENT ME!
    • setTitle

      public void setTitle()
      Set the title of the frame with the image name and magnification.
      Specified by:
      setTitle in class ViewJFrameBase
    • stateChanged

      public void stateChanged(ChangeEvent e)
      Sets values based on knob along slider.
      Specified by:
      stateChanged in interface ChangeListener
      Overrides:
      stateChanged in class ViewJFrameBase
      Parameters:
      e - Event that triggered this function
    • updateFrame

      public void updateFrame(float sX, float sY)
      Does nothing.
      Parameters:
      sX - DOCUMENT ME!
      sY - DOCUMENT ME!
    • updateImageExtents

      public boolean updateImageExtents()
      Does nothing.
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Specified by:
      updateImageExtents in class ViewJFrameBase
      Returns:
      DOCUMENT ME!
      See Also:
    • updateImages

      public final boolean updateImages()
      Does nothing.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Returns:
      DOCUMENT ME!
    • updateImages

      public final boolean updateImages(boolean forceShow)
      This methods calls the componentImage's update method to redraw the screen. Without LUT changes.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      forceShow - unused parameter
      Returns:
      boolean confirming successful update
    • updateImages

      public final boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
      Does nothing.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Parameters:
      LUTa - DOCUMENT ME!
      LUTb - DOCUMENT ME!
      forceShow - DOCUMENT ME!
      interpMode - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • windowActivated

      public void windowActivated(WindowEvent event)
      Does nothing.
      Specified by:
      windowActivated in interface WindowListener
      Overrides:
      windowActivated in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • windowClosed

      public void windowClosed(WindowEvent event)
      Does nothing.
      Specified by:
      windowClosed in interface WindowListener
      Overrides:
      windowClosed in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • windowClosing

      public void windowClosing(WindowEvent event)
      Stops thread, calls close.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class ViewJFrameBase
      Parameters:
      event - event that triggered function
    • windowDeactivated

      public void windowDeactivated(WindowEvent event)
      Does nothing.
      Specified by:
      windowDeactivated in interface WindowListener
      Overrides:
      windowDeactivated in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • windowDeiconified

      public void windowDeiconified(WindowEvent event)
      Does nothing.
      Specified by:
      windowDeiconified in interface WindowListener
      Overrides:
      windowDeiconified in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • windowIconified

      public void windowIconified(WindowEvent event)
      Does nothing.
      Specified by:
      windowIconified in interface WindowListener
      Overrides:
      windowIconified in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • windowOpened

      public void windowOpened(WindowEvent event)
      Does nothing.
      Specified by:
      windowOpened in interface WindowListener
      Overrides:
      windowOpened in class ViewJFrameBase
      Parameters:
      event - DOCUMENT ME!
    • testParameter

      protected boolean testParameter(String str, double minValue, double maxValue)
      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
    • buildColocalizeToolBar

      private JToolBar buildColocalizeToolBar(ActionListener al)
      Method to build the toolbar for the Animate frame.
      Parameters:
      al - Action listener (this frame)
      Returns:
      The animation toolbar
    • buildMenu

      private void buildMenu()
      This method builds a menu which contains the option Close Colocalization.
    • buildScrollPane

      private void buildScrollPane()
      Make a scroll frame and puts an image component into it.
    • makeSeparator

      private JButton makeSeparator()
      Makes a separator for the use in the toolbars.
      Returns:
      Separator button.