Class ViewJComponentRegistration

  • All Implemented Interfaces:
    PaintGrowListener, ScreenCoordinateListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener

    public class ViewJComponentRegistration
    extends ViewJComponentEditImage
    implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener
    DOCUMENT ME!
    Author:
    William Gandler
    See Also:
    Serialized Form
    • Field Detail

      • serialVersionUID

        private static final long serialVersionUID
        Use serialVersionUID for interoperability.
        See Also:
        Constant Field Values
      • ROTATIONCENTER

        public static final int ROTATIONCENTER
        The 3 types of markers - rotation center, reference slice, and adjusted slice.
        See Also:
        Constant Field Values
      • OPACITY

        public float OPACITY
        Opacity value used by the paint brush. value = 1.0 - opaque value = 0.25 - default (mostly see through)
      • addPointCursor

        protected java.awt.Cursor addPointCursor
        DOCUMENT ME!
      • defaultCursor

        protected java.awt.Cursor defaultCursor
        DOCUMENT ME!
      • magRegionCursor

        protected java.awt.Cursor magRegionCursor
        Custom cursor: magnify region.
      • moveCursor

        protected java.awt.Cursor moveCursor
        DOCUMENT ME!
      • pointCursor

        protected java.awt.Cursor pointCursor
        DOCUMENT ME!
      • rectCursor

        protected java.awt.Cursor rectCursor
        DOCUMENT ME!
      • removePointCursor

        protected java.awt.Cursor removePointCursor
        DOCUMENT ME!
      • waitCursor

        protected java.awt.Cursor waitCursor
        DOCUMENT ME!
      • wandCursor

        protected java.awt.Cursor wandCursor
        DOCUMENT ME!
      • toolFrame

        protected ViewJFrameRegistrationTool toolFrame
        Frame where component image is displayed (only for new RegistrationTool).
      • memCount

        int memCount
        DOCUMENT ME!
      • adjMark

        private int adjMark
        number of VOIs for adjustable slice
      • anchorPt

        private java.awt.Point anchorPt
        DOCUMENT ME!
      • centerid

        private short centerid
        id of rotation center
      • centerVOI

        private VOI centerVOI
        center rotation VOI
      • doAdjMark

        private boolean doAdjMark
        DOCUMENT ME!
      • doCenter

        private boolean doCenter
        DOCUMENT ME!
      • doDrag

        private boolean doDrag
        no adjusted slice movements with mouseDrag
      • doRefMark

        private boolean doRefMark
        DOCUMENT ME!
      • hue

        private float hue
        DOCUMENT ME!
      • id

        private short id
        DOCUMENT ME!
      • markerType

        private int[] markerType
        DOCUMENT ME!
      • newVOI

        private VOI newVOI
        DOCUMENT ME!
      • newX

        private int newX
        adjustable slice VOI.
      • newY

        private int newY
        adjustable slice VOI.
      • oldFrame

        private boolean oldFrame
        Used to set old or new mode of registration.
      • ptCoord

        private float[] ptCoord
        DOCUMENT ME!
      • red

        private int red
        DOCUMENT ME!
      • green

        private int green
        DOCUMENT ME!
      • blue

        private int blue
        DOCUMENT ME!
      • refMark

        private int refMark
        number of VOIs for reference slice
      • rotCenterMark

        private int rotCenterMark
        number of VOIs for rotation center
      • xFinish

        private float xFinish
        values obtained when mouseReleased
      • yFinish

        private float yFinish
        values obtained when mouseReleased
      • xOrg

        private int[] xOrg
        DOCUMENT ME!
      • xPres

        private int[] xPres
        DOCUMENT ME!
      • xRotation

        private float xRotation
        DOCUMENT ME!
      • xStart

        private float xStart
        values obtained when mousePressed
      • yStart

        private float yStart
        values obtained when mousePressed
      • yOrg

        private int[] yOrg
        DOCUMENT ME!
      • yPres

        private int[] yPres
        DOCUMENT ME!
      • yRotation

        private float yRotation
        DOCUMENT ME!
    • Constructor Detail

      • ViewJComponentRegistration

        public ViewJComponentRegistration​(ViewJFrameRegistration _frame,
                                          ModelImage _imageA,
                                          ModelLUT _LUTa,
                                          float[] imgBufferA,
                                          ModelImage _imageB,
                                          ModelLUT _LUTb,
                                          float[] imgBufferB,
                                          int[] pixelBuffer,
                                          float zoom,
                                          int[] extents,
                                          boolean logMagDisplay,
                                          int _orientation,
                                          float alphaBl)
        Constructor: ImageA and ImageB are expected to be of the same dimensionality !!
        Parameters:
        _frame - frame where image(s) will be displayed
        _imageA - Model of the image that will be displayed
        _LUTa - LUT used to display imageA
        imgBufferA - storage buffer used to display image A
        _imageB - Model of the image that will be displayed
        _LUTb - LUT used to display imageB
        imgBufferB - storage buffer used to display image B
        pixelBuffer - storage buffer used to build a displayable image
        zoom - initial magnification of image
        extents - initial display dimensions of the image
        logMagDisplay - display log magnitude of image
        _orientation - orientation of the image
        alphaBl - DOCUMENT ME!
      • ViewJComponentRegistration

        public ViewJComponentRegistration​(ViewJFrameRegistrationTool _toolFrame,
                                          ModelImage _imageA,
                                          ModelLUT _LUTa,
                                          float[] imgBufferA,
                                          ModelImage _imageB,
                                          ModelLUT _LUTb,
                                          float[] imgBufferB,
                                          int[] pixelBuffer,
                                          float zoom,
                                          int[] extents,
                                          boolean logMagDisplay,
                                          int _orientation,
                                          float alphaBl)
        Constructor: ImageA and ImageB are expected to be of the same dimensionality !!
        Parameters:
        _toolFrame - frame where image(s) will be displayed
        _imageA - Model of the image that will be displayed
        _LUTa - LUT used to display imageA
        imgBufferA - storage buffer used to display image A
        _imageB - Model of the image that will be displayed
        _LUTb - LUT used to display imageB
        imgBufferB - storage buffer used to display image B
        pixelBuffer - storage buffer used to build a displayable image
        zoom - initial magnification of image
        extents - initial display dimensions of the image
        logMagDisplay - display log magnitude of image
        _orientation - orientation of the image
        alphaBl - DOCUMENT ME!
    • Method Detail

      • deleteAdjRotVOIs

        public void deleteAdjRotVOIs()
        Deletes all ROTATIONCENTER and ADJMARK VOIs.
      • deleteAdjustableVOIs

        public void deleteAdjustableVOIs()
        Deletes all ADJMARK VOIs.
      • deletePoint

        public void deletePoint​(boolean isReference)
        If a point is selected of the given type (reference or adjusted) delete the point and reset the.
        Parameters:
        isReference - delete point if of this type
      • deleteReferenceVOIs

        public void deleteReferenceVOIs()
        Deletes all REFMARK VOIs.
      • deleteRefRotVOIs

        public void deleteRefRotVOIs()
        Deletes all REFMARK and ROTATIONCENTER VOIs.
      • deleteVOIs

        public void deleteVOIs()
        Deletes all VOIs.
      • dispose

        public void dispose​(boolean gcFlag)
        Sets all variables to null, disposes, and garbage collects.
        Overrides:
        dispose in class ViewJComponentEditImage
        Parameters:
        gcFlag - if true garbage collector should be called.
      • getAdjMark

        public int getAdjMark()
        Returns the adjust mark flag.
        Returns:
        int adjust mark flag
      • getBlue

        public int getBlue()
        accessor that returns int blue.
        Returns:
        int blue component
      • getGreen

        public int getGreen()
        Accessor that returns int green.
        Returns:
        int green component
      • getMarkerType

        public int[] getMarkerType()
        Returns the marker type.
        Returns:
        int[] marker
      • getOpacity

        public float getOpacity()
        Returns the opacity used in alpha blending between the input image and the reference image.
        Overrides:
        getOpacity in class ViewJComponentEditImage
        Returns:
        float opacity
      • getRed

        public int getRed()
        Returns int red.
        Returns:
        int red component
      • getRefMark

        public int getRefMark()
        Returns the reference mark flag.
        Returns:
        int reference mark flag
      • getxOrg

        public int[] getxOrg()
        Returns the X origin.
        Returns:
        int[] the X origin
      • getxPres

        public int[] getxPres()
        DOCUMENT ME!
        Returns:
        int[] list of x coordinates
      • getyOrg

        public int[] getyOrg()
        Returns the Y origin.
        Returns:
        int[] the Y origin
      • getyPres

        public int[] getyPres()
        DOCUMENT ME!
        Returns:
        int[] list of y coordinates
      • makeAdjustableVOI

        public void makeAdjustableVOI​(WildMagic.LibFoundation.Mathematics.Vector3f adjPoint)
        Constructs reference point VOI from the refPoint passed in.
        Parameters:
        adjPoint - a point VOI is generated from the 3D point
      • makeReferenceVOI

        public void makeReferenceVOI​(WildMagic.LibFoundation.Mathematics.Vector3f refPoint)
        Constructs reference point VOI from the refPoint passed in.
        Parameters:
        refPoint - a point VOI is generated from the 3D point
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent mouseEvent)
        When the mouse is clicked in the image, several different things may happen. If a Region of Interest (VOI) is selected and the click count is 2, a VOI dialog should pop up. If the click count is 1 and the mouse is in an VOI, it should select the VOI. In all other cases, a click within the image but not in an VOI should deselect all VOIs.
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Overrides:
        mouseClicked in class ViewJComponentEditImage
        Parameters:
        mouseEvent - event that triggers function; contains click count
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent mouseEvent)
        Drags an VOI real time by calling a series of translations and draws. Once the mouse is released, the positions are reset permenantly. Also rubberbands points if the cursor indicates it by calling rubberbandVOI.
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class ViewJComponentEditImage
        Parameters:
        mouseEvent - event that triggered function
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent mouseEvent)
        Sets the mode of the program depending on the cursor mode. If the mode is move, activates the contour or line and enables the delete button.
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class ViewJComponentEditImage
        Parameters:
        mouseEvent - event that triggered function
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent mouseEvent)
        If the mode is level set, draws level sets as user moves mouse. Otherwise, changes the cursor depending on where the mouse is in relation to the VOI.
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseMoved in class ViewJComponentEditImage
        Parameters:
        mouseEvent - event that triggered the function
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent mouseEvent)
        This function sets up and draws the VOI according to the mode.
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class ViewJComponentEditImage
        Parameters:
        mouseEvent - event that triggered function
      • moveVOIPosition

        public void moveVOIPosition​(int deltaX,
                                    int deltaY)
        Moves VOIs to new position by deltaX and deltaY.
        Parameters:
        deltaX - distance VOI moves in the X direction
        deltaY - distance VOI moves in the Y direction
      • moveVOITo

        public void moveVOITo​(int id,
                              int x,
                              int y)
        Moves VOI with ID == id to a new position (x,y).
        Parameters:
        id - DOCUMENT ME!
        x - x coordinate of new position
        y - y coordinate of new position
      • paintComponent

        public void paintComponent​(java.awt.Graphics g)
        Paints the image and calls drawSelf for all VOIs.
        Overrides:
        paintComponent in class ViewJComponentEditImage
        Parameters:
        g - graphics
      • paintWindowComponent

        public void paintWindowComponent​(java.awt.Graphics g,
                                         java.awt.event.MouseEvent mouseEvent)
        Paints the image and calls drawSelf for all VOIs.
        Parameters:
        g - graphics
        mouseEvent - DOCUMENT ME!
      • setAdjMark

        public void setAdjMark​(boolean doAdj)
        Sets the adjusted mark flag.
        Parameters:
        doAdj - DOCUMENT ME!
      • setCenter

        public void setCenter​(boolean doCen)
        Sets the center point used in transformations.
        Parameters:
        doCen - if true construct a center point VOI
      • setLogMagDisplay

        public void setLogMagDisplay​(boolean flag)
        Sets the log magnitude display flag.
        Overrides:
        setLogMagDisplay in class ViewJComponentEditImage
        Parameters:
        flag - if true display log of the Magnitude of the complex image
      • setCursorMode

        public void setCursorMode​(int mode)
        Switches modes based on the variable mode. Sets rubberband activity and the cursor.
        Overrides:
        setCursorMode in class ViewJComponentEditImage
        Parameters:
        mode - the integer mode
      • setMouseDrag

        public void setMouseDrag​(boolean doDrag)
        doDrag true enables the adjusted slice to respond to mouse press and drag events doDrag false restricts the adjusted slice to responding to mouse press and release events.
        Parameters:
        doDrag - DOCUMENT ME!
      • setNewAlphaBlend

        public void setNewAlphaBlend​(int value)
        Sets the alpha blending of parameter for two image displaying.
        Parameters:
        value - amount [0,100] that is the percentage of Image A to be displayed
      • setRefMark

        public void setRefMark​(boolean doRef)
        Sets the reference mark flag.
        Parameters:
        doRef - DOCUMENT ME!