Class PlaneRender_WM

  • All Implemented Interfaces:
    com.jogamp.opengl.GLEventListener, SpaceNavigatorListener, ScreenCoordinateListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.io.Serializable, java.util.EventListener

    public class PlaneRender_WM
    extends GPURenderBase
    implements com.jogamp.opengl.GLEventListener, ScreenCoordinateListener
    Class PlaneRenderWM: renders a single dimension of the ModelImage data as a texture-mapped polygon. The PlaneRenderWM class keeps track of whether it is rendering the Axial, Sagittal, or Coronal view of the data.
    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSlices​(VolumeSlices kVolumeSlice)
      Adds the VolumeSlices object to the display list for rendering.
      private void cleanup()  
      private void CreateLabels()
      Creates the TriMesh data structures for the axis arrows.
      private void CreateScene()
      Initializes the display parameters.
      private void createSelectedIcon​(int[] aiAxisOrder)  
      void display​(com.jogamp.opengl.GLAutoDrawable arg0)  
      void displayChanged​(com.jogamp.opengl.GLAutoDrawable arg0, boolean arg1, boolean arg2)  
      void displaySurface​(boolean bOn)  
      void displayVOIs​(boolean bOn)  
      void dispose​(com.jogamp.opengl.GLAutoDrawable arg0)
      Clean memory.
      WildMagic.LibFoundation.Mathematics.Vector3f downSlice()  
      private void drawAxes​(com.jogamp.opengl.GLAutoDrawable kDraw)
      Called from the display function.
      private void drawSelectedPoint​(VOIPoint kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      private void drawSelectedPoints​(VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      protected void drawText​(com.jogamp.opengl.GLAutoDrawable kDraw, int iX, int iY, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor, java.lang.String kText)  
      private void drawText​(com.jogamp.opengl.GLAutoDrawable kDraw, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iX, int iY, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor, java.lang.String kText)  
      void drawVOI​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, PlaneRender_WM kDisplay, WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, float[] afResolutions, int[] aiUnits, int[] aiAxisOrder, WildMagic.LibFoundation.Mathematics.Vector3f kCenter, int iSlice, int iOrientation, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)  
      private void drawVOIContour​(com.jogamp.opengl.GLAutoDrawable kDraw, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, float[] afResolutions, int[] aiUnits, VOIBase kVOI, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      private void drawVOILine​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions, int[] aiUnits)  
      private void drawVOILine​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, float[] afResolutions, int[] aiUnits, VolumeVOI kVolumeVOI, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      private void drawVOIPoint​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, VolumeVOI kVolumeVOI, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      private void drawVOIPoint​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIPoint kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, VolumeVOI kVolumeVOI)  
      protected void drawVOIPolyLineSlice​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIPolyLineSlice kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, float[] afResolutions, int[] aiUnits, VolumeVOI kVolumeVOI, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      protected void drawVOIProtractor​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, float[] afResolutions, int[] aiUnits, VolumeVOI kVolumeVOI, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder)  
      private void drawVOIProtractorAngle​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions)  
      private void drawVOIProtractorLength​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions, int[] aiUnits)  
      private void drawVOIs​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIVector kVOIs)  
      protected void drawVOIText​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, VolumeVOI kVolumeVOI)  
      private void drawVOIText​(com.jogamp.opengl.GLAutoDrawable kDraw, VOIText kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, VolumeVOI kVolumeVOI)  
      private WildMagic.LibFoundation.Mathematics.Vector3f fileCoordinatesToPatient​(WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)  
      WildMagic.LibFoundation.Mathematics.Vector3f fileToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f volumePt)  
      WildMagic.LibFoundation.Mathematics.Vector3f fileToScreenVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
      Converts image file X,Y,Z coordinates into local screen coordinates.
      int getHeight()
      Returns the height of the display canvas.
      private WildMagic.LibFoundation.Mathematics.Vector3f getLocalCenter​(VOIBase kVOI)  
      int getOrientation()  
      float getResolutionX()
      Returns the image resolution factor in the screen x-direction.
      float getResolutionY()
      Returns the image resolution factor in the screen y-direction.
      int getSlice()
      Returns the currently displayed image slice.
      private int getSlice​(VOIBase kVOI)  
      int getWidth()
      Returns the width of the display canvas.
      float getZoom()  
      float getZoomX()
      Returns the image magnification factor in the screen x-direction.
      float getZoomY()
      Returns the image magnification factor in the screen y-direction.
      void init​(com.jogamp.opengl.GLAutoDrawable arg0)  
      void LocalToPatient​(WildMagic.LibFoundation.Mathematics.Vector3f localPt, WildMagic.LibFoundation.Mathematics.Vector3f patientPt)  
      void LocalToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f kLocal, WildMagic.LibFoundation.Mathematics.Vector3f kScreen)  
      static PlaneRender_WM main​(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB, int iPlane, VolumeSlices kVolumeSlice, boolean displayInSeparateFrame)  
      void mouseDragged​(java.awt.event.MouseEvent kEvent)  
      void mousePressed​(java.awt.event.MouseEvent kEvent)  
      void mouseReleased​(java.awt.event.MouseEvent kEvent)  
      void mouseWheelMoved​(java.awt.event.MouseWheelEvent e)  
      void PatientToLocal​(WildMagic.LibFoundation.Mathematics.Vector3f patientPt, WildMagic.LibFoundation.Mathematics.Vector3f localPt)  
      WildMagic.LibFoundation.Mathematics.Vector3f patientToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f patientPt)  
      WildMagic.LibFoundation.Mathematics.Vector3f patientToScreenVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
      Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.
      private void processLeftMouseDrag​(java.awt.event.MouseEvent kEvent)
      Dragging the mouse with the left-mouse button held down changes the positions of the X and Y cross bars, and therefore the ZSlice positions of the associated PlaneRenderWM objects and the TriPlanar Surface.
      private void processMousePress​(java.awt.event.MouseEvent kEvent)
      Process mouse prese when adding annotation point
      private void processRightMouseDrag​(java.awt.event.MouseEvent kEvent)
      If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)
      private void reCreateLabels()  
      void reshape​(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight)
      Part of the GLEventListener interface.
      boolean screenToFile​(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f volumePt)  
      WildMagic.LibFoundation.Mathematics.Vector3f screenToFile​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)  
      boolean screenToFile​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)  
      boolean screenToFileVOI​(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
      Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
      WildMagic.LibFoundation.Mathematics.Vector3f screenToFileVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
      Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
      boolean screenToFileVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile)
      Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
      boolean ScreenToLocal​(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f kLocal)
      Calculate the position of the mouse in the Local Coordinates, taking into account zoom and translate:
      void setAnnotationMode​(boolean _isAnnotationEnabled)
      Set the annotation mode
      void setBackgroundColor​(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
      Sets the background color for the frame and rendered image.
      void setCenter​(WildMagic.LibFoundation.Mathematics.Vector3f center)
      setCenter sets the cursor and slice position for this PlaneRenderWM object, based on the 3D location of the three intersecting ModelImage planes.
      void setImage​(VolumeImage kImageA, VolumeImage kImageB)  
      void setMouseActive​(boolean bActive)  
      void setMouseFlythruMode​(boolean _isMouseFlythru)
      Set the mouse flythru mode
      protected void setOrientation()
      Based on the orientation of the ModelImage, sets up the index parameters, m_aiLocalImageExtents[0], m_aiLocalImageExtents[1], and m_aiLocalImageExtents[2], the drawing colors for the z box, x and y bars, and the invert flags.
      void setPathFlythruMode​(boolean _isPathFlythru)
      Set the path flythru mode
      void setRadiologicalView​(boolean bOn)
      Sets the view to Radiological (true) or Neurological (false) view.
      private void setSlice​(float fSlice)
      Sets the local slice value.
      void setSliceHairColor​(int iView, WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
      Sets the color for the PlaneRender iView (AXIAL, SAGITTAL, CORONAL) slice.
      void setZoom​(float value)  
      void showAxes​(boolean bShow)
      Turns displaying the Axis labels on or off:
      void showXHairs​(boolean bShow)
      Turns displaying the X and Y bars on or off:
      void updateDisplay()
      Causes re-display.
      WildMagic.LibFoundation.Mathematics.Vector3f upSlice()  
      private void zoom()  
      • Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D

        DrawFrameRate, getCameraLocation, getCameraParameters, getObjectParameters, getObjectRotation, InitializeCameraMotion, InitializeCameraMotion, InitializeObjectMotion, keyReleased, keyTyped, LookDown, LookUp, MeasureTime, mouseClicked, mouseEntered, mouseExited, mouseMoved, MoveBackward, MoveCamera, MoveDown, MoveForward, MoveLeft, MoveObject, MoveRight, MoveUp, OnDisplay, OnInitialize, OnTerminate, ResetTime, RotateTrackBall, setCameraLocation, setCameraParameters, setObjectParameters, setObjectRotation, TurnLeft, TurnRight, UpdateCameraRotationSpeed, UpdateCameraTranslationSpeed, UpdateCameraZoomSpeed, UpdateFrameCount, UpdateMouseRotationSpeed
      • Methods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication

        GetAspectRatio, GetHeight, GetRenderer, GetWidth, GetWindowTitle, GetXPosition, GetYPosition, OnIdle, OnMove, OnPrecreate, OnResize, SetRenderer
      • Methods inherited from class WildMagic.LibApplications.OpenGLApplication.Application

        reloadShaders, TestStreaming
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.awt.event.KeyListener

        keyReleased, keyTyped
      • Methods inherited from interface java.awt.event.MouseListener

        mouseClicked, mouseEntered, mouseExited
      • Methods inherited from interface java.awt.event.MouseMotionListener

        mouseMoved
    • Field Detail

      • serialVersionUID

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

        WildMagic.LibFoundation.Mathematics.Vector3f[] m_akCLoc
        Camera Locations, for rendering the different Axial, Sagittal and Coronal views.
      • m_akCoords

        WildMagic.LibFoundation.Mathematics.Vector3f[] m_akCoords
        Camera Direction, UP, and Right vectors, for rendering the different Axial, Sagittal and Coronal views.
      • m_bPatientOrientation

        protected boolean m_bPatientOrientation
        Actual image orientation.
      • m_iPlaneOrientation

        protected int m_iPlaneOrientation
        Which dimension of the ModelImage to render.
      • m_aiLocalImageExtents

        private int[] m_aiLocalImageExtents
        The image dimensions in x,y,z:.
      • m_afResolutions

        private float[] m_afResolutions
      • m_aiUnits

        private int[] m_aiUnits
      • m_aakColors

        private WildMagic.LibFoundation.Mathematics.ColorRGB[][] m_aakColors
        Set of colors used to draw the axis labels.
      • m_aaiColorSwap

        private int[][] m_aaiColorSwap
        Axis labels color assignments.
      • m_bDrawAxes

        private boolean m_bDrawAxes
        when true, the axis labels (P-> L-> S->) will be drawn
      • m_bDrawXHairs

        private boolean m_bDrawXHairs
        Turns on drawing of the X,Y bars and the Axis labels:.
      • m_bLeftMousePressed

        private boolean m_bLeftMousePressed
        True when the left mouse has been pressed, set to false when the left mouse button is released.
      • m_bRightMousePressed

        private boolean m_bRightMousePressed
        Flag indicating if the right mouse button is currently pressed down:
      • m_kActiveLookupTable

        private ModelStorageBase m_kActiveLookupTable
        The current active lookup table:
      • m_fX0

        private float m_fX0
        lower x-bound of the texture-mapped polygon:
      • m_fX1

        private float m_fX1
        upper x-bound of the texture-mapped polygon:
      • m_fXBox

        private float m_fXBox
        Numbers dictating the size of the plane based on the extents and resolutions of the image.
      • m_fYBox

        private float m_fYBox
        Numbers dictating the size of the plane based on the extents and resolutions of the image.
      • m_fMaxBox

        private float m_fMaxBox
        Numbers dictating the size of the plane based on the extents and resolutions of the image.
      • m_fXRange

        private float m_fXRange
        Width of the texture-mapped polygon:
      • m_fY0

        private float m_fY0
        lower y-bound of the texture-mapped polygon:
      • m_fY1

        private float m_fY1
        upper y-bound of the texture-mapped polygon:
      • m_fYRange

        private float m_fYRange
        Height of the texture-mapped polygon:
      • m_fZoomScale

        private float m_fZoomScale
        Image scaling from Zoom:.
      • m_iSlice

        private int m_iSlice
        Which slice is currently displayed in the XY plane.
      • m_kActiveImage

        private ModelImage m_kActiveImage
        Current active image for manipulating the LUT by dragging with the right-mouse down.
      • m_kLabelX

        private java.lang.String m_kLabelX
        x-axis label:
      • m_kLabelXDisplay

        private java.lang.String m_kLabelXDisplay
      • m_kLabelY

        private java.lang.String m_kLabelY
        y-axis label:
      • m_kXArrow

        private WildMagic.LibGraphics.SceneGraph.TriMesh[] m_kXArrow
        x-axis arrow
      • m_kYArrow

        private WildMagic.LibGraphics.SceneGraph.TriMesh[] m_kYArrow
        y-axis arrow
      • m_spkScreenCamera

        private WildMagic.LibGraphics.Rendering.Camera m_spkScreenCamera
        Drawing the axis arrows in screen-space.
      • m_iLabelX_SpacingX

        private int m_iLabelX_SpacingX
      • m_iLabelX_SpacingY

        private int m_iLabelX_SpacingY
      • m_iLabelY_SpacingX

        private int m_iLabelY_SpacingX
      • m_iLabelY_SpacingY

        private int m_iLabelY_SpacingY
      • m_bUpdateSpacing

        private boolean m_bUpdateSpacing
      • m_aiAxisOrder

        private int[] m_aiAxisOrder
        ModelImage axis orientation.
      • m_abAxisFlip

        private boolean[] m_abAxisFlip
        ModelImage axis flip.
      • m_fMouseY

        private float m_fMouseY
        For zooming with the mouse.
      • m_bShowSurface

        private boolean m_bShowSurface
      • m_bShowVOIs

        private boolean m_bShowVOIs
      • m_kPatientPt

        private WildMagic.LibFoundation.Mathematics.Vector3f m_kPatientPt
      • m_kVolumeScale

        private WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScale
      • m_kVolumeScaleInv

        private WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScaleInv
      • m_kCenter

        private WildMagic.LibFoundation.Mathematics.Vector3f m_kCenter
      • m_bIsMouseActive

        private boolean m_bIsMouseActive
      • m_kPVWMatrix

        private WildMagic.LibFoundation.Mathematics.Matrix4f m_kPVWMatrix
      • m_iCirclePts

        private int m_iCirclePts
      • m_adCos

        private double[] m_adCos
      • m_adSin

        private double[] m_adSin
      • m_kBallPoint

        protected WildMagic.LibGraphics.SceneGraph.Polyline m_kBallPoint
      • m_kZState

        protected WildMagic.LibGraphics.Rendering.ZBufferState m_kZState
      • m_kVOIAttr

        protected WildMagic.LibGraphics.SceneGraph.Attributes m_kVOIAttr
      • latestVolumePt

        protected WildMagic.LibFoundation.Mathematics.Vector3f latestVolumePt
      • isAnnotationEnabled

        protected boolean isAnnotationEnabled
      • isMouseFlythru

        protected boolean isMouseFlythru
      • isPathFlythru

        protected boolean isPathFlythru
      • m_bCleanup

        private boolean m_bCleanup
    • Constructor Detail

      • PlaneRender_WM

        public PlaneRender_WM​(com.jogamp.opengl.awt.GLCanvas kCanvas,
                              double dpiScale,
                              VolumeTriPlanarInterface kParent,
                              com.jogamp.opengl.util.Animator kAnimator,
                              VolumeImage kVolumeImageA,
                              VolumeImage kVolumeImageB,
                              int iPlane)
        Parameters:
        kParent -
        kAnimator -
        kVolumeImageA -
        iPlane -
    • Method Detail

      • addSlices

        public void addSlices​(VolumeSlices kVolumeSlice)
        Adds the VolumeSlices object to the display list for rendering.
        Parameters:
        kVolumeSlice - .
      • display

        public void display​(com.jogamp.opengl.GLAutoDrawable arg0)
        Specified by:
        display in interface com.jogamp.opengl.GLEventListener
      • displayChanged

        public void displayChanged​(com.jogamp.opengl.GLAutoDrawable arg0,
                                   boolean arg1,
                                   boolean arg2)
      • displaySurface

        public void displaySurface​(boolean bOn)
      • displayVOIs

        public void displayVOIs​(boolean bOn)
      • dispose

        public void dispose​(com.jogamp.opengl.GLAutoDrawable arg0)
        Clean memory.
        Specified by:
        dispose in interface com.jogamp.opengl.GLEventListener
        Overrides:
        dispose in class GPURenderBase
      • downSlice

        public WildMagic.LibFoundation.Mathematics.Vector3f downSlice()
      • drawVOI

        public void drawVOI​(com.jogamp.opengl.GLAutoDrawable kDraw,
                            VOIBase kVOI,
                            PlaneRender_WM kDisplay,
                            WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                            WildMagic.LibGraphics.SceneGraph.Culler kCuller,
                            float[] afResolutions,
                            int[] aiUnits,
                            int[] aiAxisOrder,
                            WildMagic.LibFoundation.Mathematics.Vector3f kCenter,
                            int iSlice,
                            int iOrientation,
                            WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                            WildMagic.LibFoundation.Mathematics.Vector3f kTranslate)
      • fileToScreen

        public WildMagic.LibFoundation.Mathematics.Vector3f fileToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f volumePt)
      • fileToScreenVOI

        public WildMagic.LibFoundation.Mathematics.Vector3f fileToScreenVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kFile)
        Description copied from interface: ScreenCoordinateListener
        Converts image file X,Y,Z coordinates into local screen coordinates.
        Specified by:
        fileToScreenVOI in interface ScreenCoordinateListener
        Parameters:
        kFile - image file coordinates.
        Returns:
        local screen coordinates.
      • getOrientation

        public int getOrientation()
      • getZoom

        public float getZoom()
      • getZoomX

        public float getZoomX()
        Description copied from interface: ScreenCoordinateListener
        Returns the image magnification factor in the screen x-direction.
        Specified by:
        getZoomX in interface ScreenCoordinateListener
        Returns:
        the image magnification factor in the screen x-direction.
      • getZoomY

        public float getZoomY()
        Description copied from interface: ScreenCoordinateListener
        Returns the image magnification factor in the screen y-direction.
        Specified by:
        getZoomY in interface ScreenCoordinateListener
        Returns:
        the image magnification factor in the screen y-direction.
      • init

        public void init​(com.jogamp.opengl.GLAutoDrawable arg0)
        Specified by:
        init in interface com.jogamp.opengl.GLEventListener
      • LocalToPatient

        public void LocalToPatient​(WildMagic.LibFoundation.Mathematics.Vector3f localPt,
                                   WildMagic.LibFoundation.Mathematics.Vector3f patientPt)
      • LocalToScreen

        public void LocalToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f kLocal,
                                  WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent kEvent)
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseDragged in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent kEvent)
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Overrides:
        mousePressed in class GPURenderBase
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent kEvent)
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Overrides:
        mouseReleased in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent e)
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
        Overrides:
        mouseWheelMoved in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
      • PatientToLocal

        public void PatientToLocal​(WildMagic.LibFoundation.Mathematics.Vector3f patientPt,
                                   WildMagic.LibFoundation.Mathematics.Vector3f localPt)
      • patientToScreen

        public WildMagic.LibFoundation.Mathematics.Vector3f patientToScreen​(WildMagic.LibFoundation.Mathematics.Vector3f patientPt)
      • patientToScreenVOI

        public WildMagic.LibFoundation.Mathematics.Vector3f patientToScreenVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kPt)
        Description copied from interface: ScreenCoordinateListener
        Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.
        Specified by:
        patientToScreenVOI in interface ScreenCoordinateListener
        Parameters:
        kPt - local patient (Axial, Coronal, Sagittal) coordinates.
        Returns:
        screen coordinate representation of the input point.
      • reshape

        public void reshape​(com.jogamp.opengl.GLAutoDrawable arg0,
                            int iX,
                            int iY,
                            int iWidth,
                            int iHeight)
        Description copied from class: GPURenderBase
        Part of the GLEventListener interface. Called when the GLCanvas is resized.
        Specified by:
        reshape in interface com.jogamp.opengl.GLEventListener
        Overrides:
        reshape in class GPURenderBase
        Parameters:
        arg0 - the GLCanvas
        iX - the new x-position in screen coordinates.
        iY - the new y-position in screen coordinates.
        iWidth - the new width
        iHeight - the new height
      • screenToFile

        public boolean screenToFile​(int iX,
                                    int iY,
                                    int iZ,
                                    WildMagic.LibFoundation.Mathematics.Vector3f volumePt)
      • screenToFile

        public WildMagic.LibFoundation.Mathematics.Vector3f screenToFile​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
      • screenToFile

        public boolean screenToFile​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen,
                                    WildMagic.LibFoundation.Mathematics.Vector3f kFile)
      • screenToFileVOI

        public boolean screenToFileVOI​(int iX,
                                       int iY,
                                       int iZ,
                                       WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
        Description copied from interface: ScreenCoordinateListener
        Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
        Specified by:
        screenToFileVOI in interface ScreenCoordinateListener
        Parameters:
        iX - input X position in local screen coordinates.
        iY - input Y position in local screen coordinates.
        iZ - input slice position in the local image orientation, or z=0 for 2D images.
        kVolumePt - image file coordinates return value.
        Returns:
        returns true if the screen coordinate is clipped (is outside the displayed image space).
      • screenToFileVOI

        public WildMagic.LibFoundation.Mathematics.Vector3f screenToFileVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen)
        Description copied from interface: ScreenCoordinateListener
        Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
        Specified by:
        screenToFileVOI in interface ScreenCoordinateListener
        Parameters:
        kScreen - input X,Y,Z position in local screen coordinates, where z = local image slice or 0 for 2D images.
        Returns:
        image file coordinates.
      • screenToFileVOI

        public boolean screenToFileVOI​(WildMagic.LibFoundation.Mathematics.Vector3f kScreen,
                                       WildMagic.LibFoundation.Mathematics.Vector3f kFile)
        Description copied from interface: ScreenCoordinateListener
        Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.
        Specified by:
        screenToFileVOI in interface ScreenCoordinateListener
        Parameters:
        kScreen - input X,Y,Z position in local screen coordinates, where z = local image slice or 0 for 2D images.
        kFile - image file coordinates return value.
        Returns:
        true if the screen coordinate is clipped (is outside the displayed image space).
      • ScreenToLocal

        public boolean ScreenToLocal​(int iX,
                                     int iY,
                                     int iZ,
                                     WildMagic.LibFoundation.Mathematics.Vector3f kLocal)
        Calculate the position of the mouse in the Local Coordinates, taking into account zoom and translate:
        Parameters:
        iX - mouse x coordinate value
        iY - mouse y coordinate value
        kLocal - mouse position in Local Coordinates
      • setBackgroundColor

        public void setBackgroundColor​(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor)
        Sets the background color for the frame and rendered image.
        Parameters:
        color - RGBA color to use as the background color.
      • setCenter

        public void setCenter​(WildMagic.LibFoundation.Mathematics.Vector3f center)
        setCenter sets the cursor and slice position for this PlaneRenderWM object, based on the 3D location of the three intersecting ModelImage planes.
        Specified by:
        setCenter in interface ScreenCoordinateListener
        Parameters:
        center - the 3D center in FileCoordinates of the three intersecting ModelImage planes.
      • setMouseActive

        public void setMouseActive​(boolean bActive)
      • setRadiologicalView

        public void setRadiologicalView​(boolean bOn)
        Sets the view to Radiological (true) or Neurological (false) view.
        Parameters:
        bOn -
      • setSliceHairColor

        public void setSliceHairColor​(int iView,
                                      WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
        Sets the color for the PlaneRender iView (AXIAL, SAGITTAL, CORONAL) slice.
        Parameters:
        iView - (AXIAL, SAGITTAL, CORONAL)
        kColor - the new axis color attribute.
      • setZoom

        public void setZoom​(float value)
      • showAxes

        public void showAxes​(boolean bShow)
        Turns displaying the Axis labels on or off:
        Parameters:
        bShow - when true display the axis lablels, when false hide the axis labels
      • showXHairs

        public void showXHairs​(boolean bShow)
        Turns displaying the X and Y bars on or off:
        Parameters:
        bShow - when true show the cross-hairs when false hide the cross-hairs
      • updateDisplay

        public void updateDisplay()
        Causes re-display.
      • upSlice

        public WildMagic.LibFoundation.Mathematics.Vector3f upSlice()
      • cleanup

        private void cleanup()
      • CreateLabels

        private void CreateLabels()
        Creates the TriMesh data structures for the axis arrows.
      • reCreateLabels

        private void reCreateLabels()
      • CreateScene

        private void CreateScene()
        Initializes the display parameters.
      • createSelectedIcon

        private void createSelectedIcon​(int[] aiAxisOrder)
      • drawAxes

        private void drawAxes​(com.jogamp.opengl.GLAutoDrawable kDraw)
        Called from the display function. Draws the axis arrows.
      • drawSelectedPoint

        private void drawSelectedPoint​(VOIPoint kVOI,
                                       WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                       WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                       WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                       int iOrientation,
                                       int[] aiAxisOrder)
      • drawSelectedPoints

        private void drawSelectedPoints​(VOIBase kVOI,
                                        WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                        WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                        WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                        int iOrientation,
                                        int[] aiAxisOrder)
      • drawText

        private void drawText​(com.jogamp.opengl.GLAutoDrawable kDraw,
                              WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                              int iX,
                              int iY,
                              WildMagic.LibFoundation.Mathematics.ColorRGBA kColor,
                              java.lang.String kText)
      • drawVOIContour

        private void drawVOIContour​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                    WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                    int iSlice,
                                    float[] afResolutions,
                                    int[] aiUnits,
                                    VOIBase kVOI,
                                    WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                    WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                    int iOrientation,
                                    int[] aiAxisOrder)
      • drawVOILine

        private void drawVOILine​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                 VOIBase kVOI,
                                 WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                 float[] afResolutions,
                                 int[] aiUnits)
      • drawVOILine

        private void drawVOILine​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                 VOIBase kVOI,
                                 WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                 int iSlice,
                                 float[] afResolutions,
                                 int[] aiUnits,
                                 VolumeVOI kVolumeVOI,
                                 WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                 WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                 int iOrientation,
                                 int[] aiAxisOrder)
      • drawVOIPoint

        private void drawVOIPoint​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                  VOIBase kVOI,
                                  WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                  int iSlice,
                                  VolumeVOI kVolumeVOI,
                                  WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                  WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                  int iOrientation,
                                  int[] aiAxisOrder)
      • drawVOIPoint

        private void drawVOIPoint​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                  VOIPoint kVOI,
                                  WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                  VolumeVOI kVolumeVOI)
      • drawVOIProtractorAngle

        private void drawVOIProtractorAngle​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                            VOIBase kVOI,
                                            WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                            float[] afResolutions)
      • drawVOIProtractorLength

        private void drawVOIProtractorLength​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                             VOIBase kVOI,
                                             WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                             float[] afResolutions,
                                             int[] aiUnits)
      • drawVOIs

        private void drawVOIs​(com.jogamp.opengl.GLAutoDrawable kDraw,
                              VOIVector kVOIs)
      • drawVOIText

        private void drawVOIText​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                 VOIText kVOI,
                                 WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                 VolumeVOI kVolumeVOI)
      • fileCoordinatesToPatient

        private WildMagic.LibFoundation.Mathematics.Vector3f fileCoordinatesToPatient​(WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt)
      • getLocalCenter

        private WildMagic.LibFoundation.Mathematics.Vector3f getLocalCenter​(VOIBase kVOI)
      • getSlice

        private int getSlice​(VOIBase kVOI)
      • processLeftMouseDrag

        private void processLeftMouseDrag​(java.awt.event.MouseEvent kEvent)
        Dragging the mouse with the left-mouse button held down changes the positions of the X and Y cross bars, and therefore the ZSlice positions of the associated PlaneRenderWM objects and the TriPlanar Surface. The new positions are calculated and passed onto the parent frame.
        Parameters:
        kEvent - the mouse event generated by a mouse drag
      • processRightMouseDrag

        private void processRightMouseDrag​(java.awt.event.MouseEvent kEvent)
        If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)
        Parameters:
        kEvent - the mouse event generated by a mouse drag
      • processMousePress

        private void processMousePress​(java.awt.event.MouseEvent kEvent)
        Process mouse prese when adding annotation point
        Parameters:
        kEvent -
      • setSlice

        private void setSlice​(float fSlice)
        Sets the local slice value.
        Parameters:
        fSlice -
      • zoom

        private void zoom()
      • drawText

        protected void drawText​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                int iX,
                                int iY,
                                WildMagic.LibFoundation.Mathematics.ColorRGBA kColor,
                                java.lang.String kText)
      • drawVOIPolyLineSlice

        protected void drawVOIPolyLineSlice​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                            VOIPolyLineSlice kVOI,
                                            WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                            int iSlice,
                                            float[] afResolutions,
                                            int[] aiUnits,
                                            VolumeVOI kVolumeVOI,
                                            WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                            WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                            int iOrientation,
                                            int[] aiAxisOrder)
      • drawVOIProtractor

        protected void drawVOIProtractor​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                         VOIBase kVOI,
                                         WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                         int iSlice,
                                         float[] afResolutions,
                                         int[] aiUnits,
                                         VolumeVOI kVolumeVOI,
                                         WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale,
                                         WildMagic.LibFoundation.Mathematics.Vector3f kTranslate,
                                         int iOrientation,
                                         int[] aiAxisOrder)
      • drawVOIText

        protected void drawVOIText​(com.jogamp.opengl.GLAutoDrawable kDraw,
                                   VOIBase kVOI,
                                   WildMagic.LibGraphics.Rendering.Renderer kRenderer,
                                   int iSlice,
                                   VolumeVOI kVolumeVOI)
      • setOrientation

        protected void setOrientation()
        Based on the orientation of the ModelImage, sets up the index parameters, m_aiLocalImageExtents[0], m_aiLocalImageExtents[1], and m_aiLocalImageExtents[2], the drawing colors for the z box, x and y bars, and the invert flags.

        Once setup everything is rendered into an x,y plane where x,y may be any of the original x,y, or z dimensions in the original ModelImage.

      • setAnnotationMode

        public void setAnnotationMode​(boolean _isAnnotationEnabled)
        Set the annotation mode
        Parameters:
        _isAnnotationEnabled -
      • setMouseFlythruMode

        public void setMouseFlythruMode​(boolean _isMouseFlythru)
        Set the mouse flythru mode
        Parameters:
        _isMouseFlythur - enabled
      • setPathFlythruMode

        public void setPathFlythruMode​(boolean _isPathFlythru)
        Set the path flythru mode
        Parameters:
        _isPathFlythur - enabled