Class ViewJFrameMultimodalityViewer

  • 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 ViewJFrameMultimodalityViewer
    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.
      • imageNames

        private java.lang.String[] imageNames
      • imageNamesIndex

        private int imageNamesIndex
      • imageScroll

        private javax.swing.JScrollPane[] imageScroll
      • origin

        private java.awt.Point origin
      • quadImagePanel

        private javax.swing.JPanel[] quadImagePanel
      • splitPaneUpper

        private javax.swing.JSplitPane splitPaneUpper
      • splitPaneLower

        private javax.swing.JSplitPane splitPaneLower
      • splitPaneCenter

        private javax.swing.JSplitPane splitPaneCenter
      • zOffset

        private int zOffset
      • image1Slice

        private int image1Slice
      • zDim

        private int zDim
      • label5

        private javax.swing.JLabel label5
      • popup

        private javax.swing.JPopupMenu popup
      • imageActiveIndex

        private int imageActiveIndex
      • namesTable

        java.util.Hashtable<java.lang.String,​java.util.Vector<java.lang.String>> namesTable
      • v

        static int v
    • Constructor Detail

    • Method Detail

      • setRecordingMode

        public void setRecordingMode()
      • addPopup

        public void addPopup()
      • getFramesInfo

        private void getFramesInfo()
      • initLayout

        private void initLayout()
      • captureComponent

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

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent mouseWheelEvent)
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
      • readMultlmodalImages

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

        public void doTraverse​(java.io.File dir)
      • readImages

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

        public void readXML​(java.lang.String currentDirectory)
      • readNewXML

        public void readNewXML()
      • equalScaleImage

        public void equalScaleImage()
      • fitsToScreen

        public void fitsToScreen()
      • traverse

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

        private void readDicomImage​(java.lang.String currentDirectory)
      • printTable

        private void printTable()
      • traverseDeeper

        private void traverseDeeper​(java.io.File file)
      • traverseDicom

        private void traverseDicom​(java.io.File file,
                                   java.lang.String dirName)
      • 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
      • invokeMeasure

        public void invokeMeasure()
      • 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
      • itemStateChanged

        public void itemStateChanged​(java.awt.event.ItemEvent event)
        Does setBorderPainted for the appropriate button.
        Specified by:
        itemStateChanged in interface java.awt.event.ItemListener
        Overrides:
        itemStateChanged in class ViewJFrameTriImage
        Parameters:
        event - Event that triggered this function
      • 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
      • startRecording

        public void startRecording()
      • stopRecording

        public void stopRecording()