Class ViewJFrameMultimodalitySingleViewer

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

See Also:
  • Field Details

    • imagesChooser

      private JFileChooser imagesChooser
      target image variables.
    • UI

      private ViewUserInterface UI
      The main user interface.
    • currentFrame

      private ViewJFrameImage currentFrame
    • imageScroll

      private JScrollPane imageScroll
    • origin

      private Point origin
    • quadImagePanel

      private JPanel quadImagePanel
    • currentSlice

      private int currentSlice
    • zDim

      private int[] zDim
    • comboBoxImage

      private JComboBox comboBoxImage
    • initZoomFactor

      private float initZoomFactor
    • sliceNumCache

      private int sliceNumCache
    • serif12

      protected Font serif12
    • serif12B

      protected Font serif12B
    • sliderMax

      private JLabel[] sliderMax
    • zImageSlider

      private JSlider[] zImageSlider
    • slicesTextField

      private JTextField[] slicesTextField
    • imageFrame

      private ViewJFrameImage[] imageFrame
    • imageComp

      private ViewJComponentEditImage[] imageComp
    • imageNames

      private String[] imageNames
    • imageNamesIndex

      private int imageNamesIndex
    • images

      private ModelImage[] images
    • imageActiveIndex

      private int imageActiveIndex
    • sliderPanel

      private JPanel sliderPanel
    • cornerImage

      private ImageIcon cornerImage
    • blackImage

      private ImageIcon blackImage
    • rightPanel

      private JPanel rightPanel
    • leftPanel

      private JPanel leftPanel
    • topPanel

      private JPanel topPanel
    • lowerPanel

      private JPanel lowerPanel
    • label1

      private JLabel label1
    • label2

      private JLabel label2
    • label3

      private JLabel label3
    • label4

      private JLabel label4
    • label5

      private JLabel label5
    • label6

      private JLabel label6
    • label7

      private JLabel label7
    • label8

      private JLabel label8
    • pressed

      private boolean pressed
    • v

      static int v
  • Constructor Details

    • ViewJFrameMultimodalitySingleViewer

      public ViewJFrameMultimodalitySingleViewer(ModelImage _imageA, ViewJFrameImage frame)
  • Method Details

    • addPopup

      public void addPopup()
    • startRecording

      public void startRecording()
    • stopRecording

      public void stopRecording()
    • getFramesInfo

      private void getFramesInfo()
    • captureComponent

      void captureComponent(Component component)
    • initLayout

      private void initLayout()
    • buildSlider

      private void buildSlider(JPanel rightPanel)
    • updateSlider

      private void updateSlider()
    • mouseWheelMoved

      public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent)
      Specified by:
      mouseWheelMoved in interface MouseWheelListener
    • buildComboBoxImage

      private void buildComboBoxImage()
      Builds a list of images to operate on from the template image.
    • equalScaleImage

      public void equalScaleImage()
    • equalScaleImageLight

      public void equalScaleImageLight()
    • actionPerformed

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

      public void updateImage(int index)
    • disposeLocal

      public void disposeLocal()
      Should be called when window is closing to perform cleanup.
      Overrides:
      disposeLocal in class ViewJFrameTriImage
    • getCenter

      public int[] getCenter()
      Sets the x coordinate of the point to be the center of the transformed image.
      Overrides:
      getCenter in class ViewJFrameTriImage
      Returns:
      DOCUMENT ME!
    • getCenterPt

      public WildMagic.LibFoundation.Mathematics.Vector3f getCenterPt()
      Specified by:
      getCenterPt in interface VOIManagerInterfaceListener
      Overrides:
      getCenterPt in class ViewJFrameTriImage
    • getImageA

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

      public ModelImage getImageB()
      Accessor that returns the reference to imageB.
      Overrides:
      getImageB in class ViewJFrameTriImage
      Returns:
      imageB
    • getLinkedTriFrame

      public ViewJFrameTriImage getLinkedTriFrame()
      Gets the linked ViewJFrameTriImage.
      Overrides:
      getLinkedTriFrame in class ViewJFrameTriImage
      Returns:
      linkedFrame
    • getParentFrame

      public ViewJFrameImage getParentFrame()
      Returns a reference to the ViewJFrameImage object that is the parent of this frame.
      Overrides:
      getParentFrame in class ViewJFrameTriImage
      Returns:
      a reference to the ViewJFrameImage object that is the parent of this frame
    • keyPressed

      public void keyPressed(KeyEvent e)
      keyPressed event method for KeyListener.
      Specified by:
      keyPressed in interface KeyListener
      Overrides:
      keyPressed in class ViewJFrameTriImage
      Parameters:
      e - KeyEvent
    • keyReleased

      public void keyReleased(KeyEvent e)
      keyReleased event method for KeyListener.
      Specified by:
      keyReleased in interface KeyListener
      Overrides:
      keyReleased in class ViewJFrameTriImage
      Parameters:
      e - KeyEvent
    • keyTyped

      public void keyTyped(KeyEvent e)
      DOCUMENT ME!
      Specified by:
      keyTyped in interface KeyListener
      Overrides:
      keyTyped in class ViewJFrameTriImage
      Parameters:
      e - DOCUMENT ME!
    • mouseClicked

      public void mouseClicked(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseClicked in interface MouseListener
      Overrides:
      mouseClicked in class ViewJFrameTriImage
      Parameters:
      event - DOCUMENT ME!
    • mouseEntered

      public void mouseEntered(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseEntered in interface MouseListener
      Overrides:
      mouseEntered in class ViewJFrameTriImage
      Parameters:
      event - DOCUMENT ME!
    • mouseExited

      public void mouseExited(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseExited in interface MouseListener
      Overrides:
      mouseExited in class ViewJFrameTriImage
      Parameters:
      event - DOCUMENT ME!
    • mouseMoved

      public void mouseMoved(MouseEvent evt)
      Specified by:
      mouseMoved in interface MouseMotionListener
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mousePressed

      public void mousePressed(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class ViewJFrameTriImage
      Parameters:
      event - DOCUMENT ME!
    • mouseReleased

      public void mouseReleased(MouseEvent event)
      DOCUMENT ME!
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class ViewJFrameTriImage
      Parameters:
      event - DOCUMENT ME!
    • setActiveImage

      public void setActiveImage(int active)
      Set the active image for drawing VOIs. VOIs are only drawn in the active image. In addition, algorithms are executed on the active window.
      Specified by:
      setActiveImage in interface VOIManagerInterfaceListener
      Overrides:
      setActiveImage in class ViewJFrameTriImage
      Parameters:
      active - ViewJComponentBase.IMAGE_A or ViewJComponentBase.IMAGE_B
    • setCenter

      public void setCenter(int i, int j, int k)
      sets the crosshair positions and slices for each of the triImages. The inputs are in FileCoordinates, and are passed to the triImages in FileCoordinates. Each triImage converts from FileCoordinates to the local PatientCoordinate space, based on the triImage orientation (FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL).
      Overrides:
      setCenter in class ViewJFrameTriImage
      Parameters:
      i - model space coordinate
      j - model space coordinate
      k - model space coordinate
    • setCenter

      public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
      Specified by:
      setCenter in interface VOIManagerInterfaceListener
      Overrides:
      setCenter in class ViewJFrameTriImage
    • setCenter

      public void setCenter(int i, int j, int k, boolean checkLinkedScroll)
      sets the crosshair positions and slices for each of the triImages. The inputs are in FileCoordinates, and are passed to the triImages in FileCoordinates. Each triImage converts from FileCoordinates to the local PatientCoordinate space, based on the triImage orientation (FileInfoBase.AXIAL, FileInfoBase.CORONAL, FileInfoBase.SAGITTAL).
      Overrides:
      setCenter in class ViewJFrameTriImage
      Parameters:
      i - model space coordinate
      j - model space coordinate
      k - model space coordinate
      checkLinkedScroll - (boolean telling whether to look for linked images to sync scroll... necessary to avoid infinite loop)
    • setEnabled

      public void setEnabled(boolean flag)
      Controls whether or not the images/VOIs of the frame can be modified.
      Overrides:
      setEnabled in class ViewJFrameTriImage
      Parameters:
      flag - if true the image/VOIs can be modified; if false image/VOIs can NOT be modified
    • setImageA

      public void setImageA(ModelImage image)
      Changes imageA to a new model image reference. Swaps the references in the frame and all the component images.
      Overrides:
      setImageA in class ViewJFrameTriImage
      Parameters:
      image - the new image to use
    • setImageB

      public void setImageB(ModelImage _imageB)
      Accessor that sets the reference to imageB. Includes changing the frame's reference and the references the components keep.
      Overrides:
      setImageB in class ViewJFrameTriImage
      Parameters:
      _imageB - image to set the frame to
    • setImageB

      public void setImageB(ModelImage _imageB, boolean disposeOldB)
      Accessor that sets the reference to imageB. Includes changing the frame's reference and the references the components keep. Unlike setImageB(ModelImage) this method matches the functionality of setImageA(ModelImage)
      Overrides:
      setImageB in class ViewJFrameTriImage
      Parameters:
      _imageB - image to set the frame to
    • setLUTa

      public void setLUTa(ModelLUT LUT)
      Accessor that sets the LUT.
      Overrides:
      setLUTa in class ViewJFrameTriImage
      Parameters:
      LUT - the LUT
    • setLUTb

      public void setLUTb(ModelLUT LUT)
      Accessor that sets the LUT.
      Overrides:
      setLUTb in class ViewJFrameTriImage
      Parameters:
      LUT - the LUT
    • setPaintBitmapSwitch

      public void setPaintBitmapSwitch(boolean paintBitmapSwitch)
      When switching the active image, take the paintBitmap of the previous active image as the paintBitmap of the new active image Currenlty unused.
      Overrides:
      setPaintBitmapSwitch in class ViewJFrameTriImage
      Parameters:
      paintBitmapSwitch - if true don't do a getMask on the new actve image
    • setPaintColor

      public void setPaintColor(Color color)
      Sets the color of the paint.
      Overrides:
      setPaintColor in class ViewJFrameTriImage
      Parameters:
      color - Color the desired color of the paint
    • setPositionLabels

      public void setPositionLabels(int x, int y, int z)
      Sets the labels which show the absolute position within the image volume and the patient position.
      Overrides:
      setPositionLabels in class ViewJFrameTriImage
      Parameters:
      x - the x volume coordinate
      y - the y volume coordinate
      z - the z volume coordinate
    • setRGBTA

      public void setRGBTA(ModelRGB RGBT)
      Sets the RGB table for ARGB image A.
      Overrides:
      setRGBTA in class ViewJFrameTriImage
      Parameters:
      RGBT - the new RGB transfer functions for imageA
    • setRGBTB

      public void setRGBTB(ModelRGB RGBT)
      Sets the RGB table for image B.
      Overrides:
      setRGBTB in class ViewJFrameTriImage
      Parameters:
      RGBT - the new RGB transfer functions for imageB
    • setLinkButtonSelected

      public void setLinkButtonSelected(boolean selected)
      Sets whether the linking button should be set for this image, implies that this image will be linked to another tri-frame when true
      Overrides:
      setLinkButtonSelected in class ViewJFrameTriImage
    • setSlice

      public void setSlice(int slice)
      Does nothing.
      Specified by:
      setSlice in interface ViewImageUpdateInterface
      Overrides:
      setSlice in class ViewJFrameTriImage
      Parameters:
      slice - the slice to show
    • setSlices

      public void setSlices(int x, int y, int z)
      Sets the slice index for each plane in the frame and components. Should be zero indexed.
      Overrides:
      setSlices in class ViewJFrameTriImage
      Parameters:
      x - slice index in the patient
      y - slice index in the patient
      z - slice index in the patient
    • setSlicesFromFrame

      public void setSlicesFromFrame(int x, int y, int z)
      Called from the "normal" image component, sets the slices for the tri planar view to display. Parameters are in terms of the image volume and so must be converted.
      Overrides:
      setSlicesFromFrame in class ViewJFrameTriImage
      Parameters:
      x - X Slice of image.
      y - Y Slice of image.
      z - Z Slice of image.
    • setTimeSlice

      public void setTimeSlice(int slice)
      Sets the slice to be displayed and updates title frame.
      Specified by:
      setTimeSlice in interface ViewImageUpdateInterface
      Overrides:
      setTimeSlice in class ViewJFrameTriImage
      Parameters:
      slice - indicates image time-slice (4th dimension) to be displayed
    • setTimeSlice

      public void setTimeSlice(int slice, boolean checkedLinkedScroll)
      Sets the slice to be displayed and updates title frame.
      Overrides:
      setTimeSlice in class ViewJFrameTriImage
      Parameters:
      slice - indicates image time-slice (4th dimension) to be displayed
      checkedLinkedScroll - whether corresponding tri-frames should also be scrolled
    • setTitle

      public void setTitle()
      Sets the title bar for the tri-image frame. Called for initialization and updating. Displays time series location for 4D volumes.
      Overrides:
      setTitle in class ViewJFrameTriImage
    • setTraverseButton

      public void setTraverseButton()
      Sets the traverse button to selected.
      Overrides:
      setTraverseButton in class ViewJFrameTriImage
    • setVolumeCenter

      public void setVolumeCenter(Point3D newVolumeCenter)
      Sets the x coordinate of the point to be the center of the transformed image.
      Overrides:
      setVolumeCenter in class ViewJFrameTriImage
      Parameters:
      newVolumeCenter - The x coordinate of the center.
    • setVolumeCenter

      public void setVolumeCenter(int x, int y, int z)
      Sets the x coordinate of the point to be the center of the transformed image.
      Overrides:
      setVolumeCenter in class ViewJFrameTriImage
      Parameters:
      x - The x coordinate of the center.
      y - DOCUMENT ME!
      z - DOCUMENT ME!
    • stateChanged

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

      public boolean updateImageExtents()
      Do nothing - required by ViewJFrameBase.
      Specified by:
      updateImageExtents in interface ViewImageUpdateInterface
      Overrides:
      updateImageExtents in class ViewJFrameTriImage
      Returns:
      always false
      See Also:
    • updateImages

      public boolean updateImages()
      This methods calls the componentImage's update method to redraw the screen.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Overrides:
      updateImages in class ViewJFrameTriImage
      Returns:
      boolean confirming successful update
    • updateImages

      public 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
      Overrides:
      updateImages in class ViewJFrameTriImage
      Parameters:
      forceShow - forces show to reimport image and calc. java image
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(boolean forceShow, int interpMode)
      This methods calls the componentImage's update method to redraw the screen. Without LUT changes.
      Overrides:
      updateImages in class ViewJFrameTriImage
      Parameters:
      forceShow - forces show to reimport image and calc. java image
      interpMode -
      Returns:
      boolean confirming successful update
    • updateImages

      public boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
      This methods calls the componentImage's update method to redraw the screen.
      Specified by:
      updateImages in interface ViewImageUpdateInterface
      Overrides:
      updateImages in class ViewJFrameTriImage
      Parameters:
      LUTa - LUT used to update imageA
      LUTb - LUT used to update imageB
      forceShow - forces show to reimport image and calc. java image
      interpMode - image interpolation method (Nearest or Smooth)
      Returns:
      boolean confirming successful update
    • updateImageSubset

      public void updateImageSubset(ViewJComponentTriImage triImage)
      DOCUMENT ME!
      Overrides:
      updateImageSubset in class ViewJFrameTriImage
      Parameters:
      triImage - DOCUMENT ME!
    • windowClosing

      public void windowClosing(WindowEvent event)
      Closes window and disposes of frame and component.
      Specified by:
      windowClosing in interface WindowListener
      Overrides:
      windowClosing in class ViewJFrameTriImage
      Parameters:
      event - Event that triggered function
    • windowOpened

      public void windowOpened(WindowEvent event)
      Description copied from class: ViewJFrameBase
      Does nothing.
      Specified by:
      windowOpened in interface WindowListener
      Overrides:
      windowOpened in class ViewJFrameTriImage
      Parameters:
      event - the window event
    • buildActiveImagePanel

      protected void buildActiveImagePanel()
      Builds the active image panel for choosing which image (A, B, or BOTH) to perform operations on.
      Overrides:
      buildActiveImagePanel in class ViewJFrameTriImage
    • finalize

      protected void finalize() throws Throwable
      DOCUMENT ME!
      Overrides:
      finalize in class ViewJFrameTriImage
      Throws:
      Throwable - DOCUMENT ME!
    • adjustScrollbars

      private void adjustScrollbars(int x, int y, JScrollPane scrollPane)
      DOCUMENT ME!
      Parameters:
      x - DOCUMENT ME!
      y - DOCUMENT ME!
      scrollPane - DOCUMENT ME!
    • zoomInFrame

      protected void zoomInFrame(int frame)
      this method will zoom in a particular frame.
      Overrides:
      zoomInFrame in class ViewJFrameTriImage
      Parameters:
      frame - frame the frame number
    • zoomOutFrame

      protected void zoomOutFrame(int frame)
      this method will zoom out a particular frame.
      Overrides:
      zoomOutFrame in class ViewJFrameTriImage
      Parameters:
      frame - frame the frame number
    • getFrame

      public JFrame getFrame()
      Specified by:
      getFrame in interface VOIManagerInterfaceListener
      Overrides:
      getFrame in class ViewJFrameTriImage
    • setCursor

      public void setCursor(Cursor kCursor)
      Specified by:
      setCursor in interface VOIManagerInterfaceListener
      Overrides:
      setCursor in class ViewJFrameTriImage
    • invokeMeasure

      public void invokeMeasure()
    • readMultlmodalImages

      private void readMultlmodalImages()
      File chooser to select target image directory.
    • readImages

      private void readImages(File dir)
    • traverse

      private void traverse(File file)
    • changeIcon

      private void changeIcon(String whiteCicleName, String blackCircleName)