Class ViewJFrameMultimodalitySingleViewer

  • All Implemented Interfaces:
    VOIManagerInterfaceListener, ViewImageUpdateInterface, java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.WindowListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ChangeListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants

    public class ViewJFrameMultimodalitySingleViewer
    extends ViewJFrameTriImage
    implements java.awt.event.ItemListener, javax.swing.event.ChangeListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, VOIManagerInterfaceListener
    See Also:
    Serialized Form
    • Field Detail

      • imagesChooser

        private javax.swing.JFileChooser imagesChooser
        target image variables.
      • imageScroll

        private javax.swing.JScrollPane imageScroll
      • origin

        private java.awt.Point origin
      • quadImagePanel

        private javax.swing.JPanel quadImagePanel
      • currentSlice

        private int currentSlice
      • zDim

        private int[] zDim
      • comboBoxImage

        private javax.swing.JComboBox comboBoxImage
      • initZoomFactor

        private float initZoomFactor
      • popup

        private javax.swing.JPopupMenu popup
      • sliceNumCache

        private int sliceNumCache
      • serif12

        protected java.awt.Font serif12
      • serif12B

        protected java.awt.Font serif12B
      • sliderMax

        private javax.swing.JLabel[] sliderMax
      • zImageSlider

        private javax.swing.JSlider[] zImageSlider
      • slicesTextField

        private javax.swing.JTextField[] slicesTextField
      • imageNames

        private java.lang.String[] imageNames
      • imageNamesIndex

        private int imageNamesIndex
      • imageActiveIndex

        private int imageActiveIndex
      • sliderPanel

        private javax.swing.JPanel sliderPanel
      • cornerImage

        private javax.swing.ImageIcon cornerImage
      • blackImage

        private javax.swing.ImageIcon blackImage
      • rightPanel

        private javax.swing.JPanel rightPanel
      • leftPanel

        private javax.swing.JPanel leftPanel
      • topPanel

        private javax.swing.JPanel topPanel
      • lowerPanel

        private javax.swing.JPanel lowerPanel
      • label1

        private javax.swing.JLabel label1
      • label2

        private javax.swing.JLabel label2
      • label3

        private javax.swing.JLabel label3
      • label4

        private javax.swing.JLabel label4
      • label5

        private javax.swing.JLabel label5
      • label6

        private javax.swing.JLabel label6
      • label7

        private javax.swing.JLabel label7
      • label8

        private javax.swing.JLabel label8
      • pressed

        private boolean pressed
      • v

        static int v
    • Constructor Detail

      • ViewJFrameMultimodalitySingleViewer

        public ViewJFrameMultimodalitySingleViewer​(ModelImage _imageA,
                                                   ViewJFrameImage frame)
    • Method Detail

      • addPopup

        public void addPopup()
      • startRecording

        public void startRecording()
      • stopRecording

        public void stopRecording()
      • getFramesInfo

        private void getFramesInfo()
      • captureComponent

        void captureComponent​(java.awt.Component component)
      • initLayout

        private void initLayout()
      • buildSlider

        private void buildSlider​(javax.swing.JPanel rightPanel)
      • updateSlider

        private void updateSlider()
      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent mouseWheelEvent)
        Specified by:
        mouseWheelMoved in interface java.awt.event.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​(java.awt.event.ActionEvent event)
        Calls various methods depending on the action.
        Specified by:
        actionPerformed in interface java.awt.event.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!
      • 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​(java.awt.event.KeyEvent e)
        keyPressed event method for KeyListener.
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Overrides:
        keyPressed in class ViewJFrameTriImage
        Parameters:
        e - KeyEvent
      • keyReleased

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

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

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

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

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

        public void mouseMoved​(java.awt.event.MouseEvent evt)
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent e)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
      • mousePressed

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

        public void mouseReleased​(java.awt.event.MouseEvent event)
        DOCUMENT ME!
        Specified by:
        mouseReleased in interface java.awt.event.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​(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
      • 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​(java.awt.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
      • 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,
                                 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
      • 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​(javax.swing.event.ChangeEvent e)
        Sets values based on knob along time slider.
        Specified by:
        stateChanged in interface javax.swing.event.ChangeListener
        Overrides:
        stateChanged in class ViewJFrameTriImage
        Parameters:
        e - Event that triggered this function
      • 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
      • windowClosing

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

        public void windowOpened​(java.awt.event.WindowEvent event)
        Description copied from class: ViewJFrameBase
        Does nothing.
        Specified by:
        windowOpened in interface java.awt.event.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 java.lang.Throwable
        DOCUMENT ME!
        Overrides:
        finalize in class ViewJFrameTriImage
        Throws:
        java.lang.Throwable - DOCUMENT ME!
      • adjustScrollbars

        private void adjustScrollbars​(int x,
                                      int y,
                                      javax.swing.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
      • invokeMeasure

        public void invokeMeasure()
      • readMultlmodalImages

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

        private void readImages​(java.io.File dir)
      • traverse

        private void traverse​(java.io.File file)
      • changeIcon

        private void changeIcon​(java.lang.String whiteCicleName,
                                java.lang.String blackCircleName)