Class PlaneRender_WM
java.lang.Object
WildMagic.LibApplications.OpenGLApplication.Application
WildMagic.LibApplications.OpenGLApplication.JavaApplication
WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
gov.nih.mipav.view.renderer.WildMagic.PlaneRender_WM
- All Implemented Interfaces:
com.jogamp.opengl.GLEventListener,SpaceNavigatorListener,ScreenCoordinateListener,KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,Serializable,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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected booleanprotected booleanprotected WildMagic.LibFoundation.Mathematics.Vector3fprivate int[][]Axis labels color assignments.private WildMagic.LibFoundation.Mathematics.ColorRGB[][]Set of colors used to draw the axis labels.private boolean[]ModelImage axis flip.private double[]private double[]private float[]private int[]ModelImage axis orientation.private int[]The image dimensions in x,y,z:.private int[](package private) WildMagic.LibFoundation.Mathematics.Vector3f[]Camera Locations, for rendering the different Axial, Sagittal and Coronal views.(package private) WildMagic.LibFoundation.Mathematics.Vector3f[]Camera Direction, UP, and Right vectors, for rendering the different Axial, Sagittal and Coronal views.private booleanprivate booleanwhen true, the axis labels (P-> L-> S->) will be drawnprivate booleanTurns on drawing of the X,Y bars and the Axis labels:.private booleanprivate booleanTrue when the left mouse has been pressed, set to false when the left mouse button is released.protected booleanActual image orientation.private booleanFlag indicating if the right mouse button is currently pressed down:private booleanprivate booleanprivate booleanprivate floatNumbers dictating the size of the plane based on the extents and resolutions of the image.private floatFor zooming with the mouse.private floatlower x-bound of the texture-mapped polygon:private floatupper x-bound of the texture-mapped polygon:private floatNumbers dictating the size of the plane based on the extents and resolutions of the image.private floatWidth of the texture-mapped polygon:private floatlower y-bound of the texture-mapped polygon:private floatupper y-bound of the texture-mapped polygon:private floatNumbers dictating the size of the plane based on the extents and resolutions of the image.private floatHeight of the texture-mapped polygon:private floatImage scaling from Zoom:.private intprivate intprivate intprivate intprivate intprotected intWhich dimension of the ModelImage to render.private intWhich slice is currently displayed in the XY plane.private ModelImageCurrent active image for manipulating the LUT by dragging with the right-mouse down.private ModelStorageBaseThe current active lookup table:protected WildMagic.LibGraphics.SceneGraph.Polylineprivate WildMagic.LibFoundation.Mathematics.Vector3fprivate Stringx-axis label:private Stringprivate Stringy-axis label:protected VolumeTriPlanarInterfaceParent user-interface and display frame.private WildMagic.LibFoundation.Mathematics.Vector3fprivate WildMagic.LibFoundation.Mathematics.Matrix4fprotected WildMagic.LibGraphics.SceneGraph.Attributesprivate WildMagic.LibFoundation.Mathematics.Vector3fprivate WildMagic.LibFoundation.Mathematics.Vector3fprivate WildMagic.LibGraphics.SceneGraph.TriMesh[]x-axis arrowprivate WildMagic.LibGraphics.SceneGraph.TriMesh[]y-axis arrowprotected WildMagic.LibGraphics.Rendering.ZBufferStateprivate WildMagic.LibGraphics.Rendering.CameraDrawing the axis arrows in screen-space.private static final longUse serialVersionUID for interoperability.Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
currentLocation, defaultVelocityRotational, defaultVelocityTranslational, dpiScale, hyperstack, hyperstackColormap, isSpaceNavCodeRunning, m_akLights, m_bDispose, m_bDoClip, m_bExtract, m_bFirstDrag, m_bInit, m_bModified, m_bMouseDrag, m_bPickPending, m_bShared, m_bSnapshot, m_bSurfaceMaskUpdate, m_bSurfaceUpdate, m_bTestFrameRate, m_bVisible, m_fMax, m_fX, m_fY, m_fZ, m_iCaptureFPS, m_iScreenCaptureCounter, m_iXPick, m_iYPick, m_kAnimator, m_kCuller, m_kDeleteList, m_kDisplayList, m_kPicker, m_kSceneToWorld, m_kTranslate, m_kVolumeImageA, m_kVolumeImageA_New, m_kVolumeImageA_Old, m_kVolumeImageB, m_kVolumeImageB_New, m_kVolumeImageB_Old, m_kWinLevel, m_kXRotate, m_kYRotate, m_kZRotate, m_spkCull, m_spkScene, mouseRot, nearPlane, rotPower, rotScalar, transPower, transScalar, updateBoundingCube, zVector, ZXDistanceStep, ZYDistanceStep, ZZDistanceStepFields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
cameraParams, m_akWorldAxis, m_bCameraMoveable, m_bDArrowPressed, m_bEndPressed, m_bHomePressed, m_bLArrowPressed, m_bLInsertPressed, m_bObjectZoomed, m_bPgDnPressed, m_bPgUpPressed, m_bRArrowPressed, m_bRDeletePressed, m_bTrackBallDown, m_bUArrowPressed, m_bUseTrackBall, m_dAccumulatedTime, m_dFrameRate, m_dLastTime, m_fRotSpeed, m_fRotSpeedFactor, m_fTrnSpeed, m_fTrnSpeedFactor, m_fXDrag0, m_fXTrack0, m_fXTrack1, m_fYDrag0, m_fYTrack0, m_fYTrack1, m_fZoomSpeed, m_iAccumulatedFrameCount, m_iDoPitch, m_iDoRoll, m_iDoYaw, m_iFrameCount, m_iMaxTimer, m_iMouseButton, m_iTimer, m_kSaveRotate, m_mouseRotSpeed, m_spkCamera, m_spkMotionObject, pitchRotationAngle, rollRotationAngle, xCameraMove, xCameraTurn, yawRotationAngle, yCameraMove, yCameraTurn, zCameraMoveFields inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication
m_acWindowTitle, m_eBuffering, m_eDepth, m_eFormat, m_eMultisampling, m_eStencil, m_iHeight, m_iWidth, m_iXPosition, m_iYPosition, m_kBackgroundColor, m_pkRenderer -
Constructor Summary
ConstructorsConstructorDescriptionPlaneRender_WM(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB, int iPlane) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSlices(VolumeSlices kVolumeSlice) Adds the VolumeSlices object to the display list for rendering.private voidcleanup()private voidCreates the TriMesh data structures for the axis arrows.private voidInitializes the display parameters.private voidcreateSelectedIcon(int[] aiAxisOrder) voiddisplay(com.jogamp.opengl.GLAutoDrawable arg0) voiddisplayChanged(com.jogamp.opengl.GLAutoDrawable arg0, boolean arg1, boolean arg2) voiddisplaySurface(boolean bOn) voiddisplayVOIs(boolean bOn) voiddispose(com.jogamp.opengl.GLAutoDrawable arg0) Clean memory.WildMagic.LibFoundation.Mathematics.Vector3fprivate voiddrawAxes(com.jogamp.opengl.GLAutoDrawable kDraw) Called from the display function.private voiddrawSelectedPoint(VOIPoint kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder) private voiddrawSelectedPoints(VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibFoundation.Mathematics.Vector3f kVolumeScale, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, int iOrientation, int[] aiAxisOrder) protected voiddrawText(com.jogamp.opengl.GLAutoDrawable kDraw, int iX, int iY, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor, String kText) private voiddrawText(com.jogamp.opengl.GLAutoDrawable kDraw, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iX, int iY, WildMagic.LibFoundation.Mathematics.ColorRGBA kColor, String kText) voiddrawVOI(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 voiddrawVOIContour(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 voiddrawVOILine(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions, int[] aiUnits) private voiddrawVOILine(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 voiddrawVOIPoint(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 voiddrawVOIPoint(com.jogamp.opengl.GLAutoDrawable kDraw, VOIPoint kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, VolumeVOI kVolumeVOI) protected voiddrawVOIPolyLineSlice(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 voiddrawVOIProtractor(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 voiddrawVOIProtractorAngle(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions) private voiddrawVOIProtractorLength(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, float[] afResolutions, int[] aiUnits) private voidprotected voiddrawVOIText(com.jogamp.opengl.GLAutoDrawable kDraw, VOIBase kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, int iSlice, VolumeVOI kVolumeVOI) private voiddrawVOIText(com.jogamp.opengl.GLAutoDrawable kDraw, VOIText kVOI, WildMagic.LibGraphics.Rendering.Renderer kRenderer, VolumeVOI kVolumeVOI) private WildMagic.LibFoundation.Mathematics.Vector3ffileCoordinatesToPatient(WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt) WildMagic.LibFoundation.Mathematics.Vector3ffileToScreen(WildMagic.LibFoundation.Mathematics.Vector3f volumePt) WildMagic.LibFoundation.Mathematics.Vector3ffileToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kFile) Converts image file X,Y,Z coordinates into local screen coordinates.intReturns the height of the display canvas.private WildMagic.LibFoundation.Mathematics.Vector3fgetLocalCenter(VOIBase kVOI) intfloatReturns the image resolution factor in the screen x-direction.floatReturns the image resolution factor in the screen y-direction.intgetSlice()Returns the currently displayed image slice.private intintgetWidth()Returns the width of the display canvas.floatgetZoom()floatgetZoomX()Returns the image magnification factor in the screen x-direction.floatgetZoomY()Returns the image magnification factor in the screen y-direction.voidinit(com.jogamp.opengl.GLAutoDrawable arg0) voidLocalToPatient(WildMagic.LibFoundation.Mathematics.Vector3f localPt, WildMagic.LibFoundation.Mathematics.Vector3f patientPt) voidLocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kLocal, WildMagic.LibFoundation.Mathematics.Vector3f kScreen) static PlaneRender_WMmain(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB, int iPlane, VolumeSlices kVolumeSlice, boolean displayInSeparateFrame) voidmouseDragged(MouseEvent kEvent) voidmousePressed(MouseEvent kEvent) voidmouseReleased(MouseEvent kEvent) voidvoidPatientToLocal(WildMagic.LibFoundation.Mathematics.Vector3f patientPt, WildMagic.LibFoundation.Mathematics.Vector3f localPt) WildMagic.LibFoundation.Mathematics.Vector3fpatientToScreen(WildMagic.LibFoundation.Mathematics.Vector3f patientPt) WildMagic.LibFoundation.Mathematics.Vector3fpatientToScreenVOI(WildMagic.LibFoundation.Mathematics.Vector3f kPt) Converts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.private voidprocessLeftMouseDrag(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 voidprocessMousePress(MouseEvent kEvent) Process mouse prese when adding annotation pointprivate voidprocessRightMouseDrag(MouseEvent kEvent) If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)private voidvoidreshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight) Part of the GLEventListener interface.booleanscreenToFile(int iX, int iY, int iZ, WildMagic.LibFoundation.Mathematics.Vector3f volumePt) WildMagic.LibFoundation.Mathematics.Vector3fscreenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen) booleanscreenToFile(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) booleanscreenToFileVOI(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.Vector3fscreenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen) Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.booleanscreenToFileVOI(WildMagic.LibFoundation.Mathematics.Vector3f kScreen, WildMagic.LibFoundation.Mathematics.Vector3f kFile) Converts local screen coordinates, usually from a MouseEvent, into image file coordinates.booleanScreenToLocal(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:voidsetAnnotationMode(boolean _isAnnotationEnabled) Set the annotation modevoidsetBackgroundColor(WildMagic.LibFoundation.Mathematics.ColorRGBA kColor) Sets the background color for the frame and rendered image.voidsetCenter(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.voidsetImage(VolumeImage kImageA, VolumeImage kImageB) voidsetMouseActive(boolean bActive) voidsetMouseFlythruMode(boolean _isMouseFlythru) Set the mouse flythru modeprotected voidBased 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.voidsetPathFlythruMode(boolean _isPathFlythru) Set the path flythru modevoidsetRadiologicalView(boolean bOn) Sets the view to Radiological (true) or Neurological (false) view.private voidsetSlice(float fSlice) Sets the local slice value.voidsetSliceHairColor(int iView, WildMagic.LibFoundation.Mathematics.ColorRGB kColor) Sets the color for the PlaneRender iView (AXIAL, SAGITTAL, CORONAL) slice.voidsetZoom(float value) voidshowAxes(boolean bShow) Turns displaying the Axis labels on or off:voidshowXHairs(boolean bShow) Turns displaying the X and Y bars on or off:voidCauses re-display.WildMagic.LibFoundation.Mathematics.Vector3fupSlice()private voidzoom()Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
AddNode, checkIfSpaceNavNeedsCalibration, dispose, drawText, fineMovement, GetCanvas, getCounter, getDisplayList, getImage, GetLights, getNearPlane, GetNode, getNormalizedXDim, getNormalizedYDim, getNormalizedZDim, getRotationCutoffValue, getRotationScaleFactor, GetSceneRotation, getSceneToWorldMatrix, getTranslate, getTranslationCutoffValue, getTranslationScaleFactor, getVolumeImage, getVolumeImageB, invertRX, invertRY, invertRZ, invertTX, invertTY, invertTZ, isUseMouseRotationCutoffs, isUseMouseTranslationCutoffs, isVisible, keyPressed, Move, normalMovement, pauseAnimator, processSpaceNavEvent, processSpaceNavEvent, record, reInitialize, RemoveNode, RenderFrameRate, resetAxis, resetAxisX, resetAxisXInv, resetAxisY, saveAVIMovie, saveQuickTimeMovie, setCameraNearPlane, setDefaultLighting, setOrthographicProjection, setPerspectiveProjection, setRotationCutoffValue, setRotationScaleFactor, SetSceneRotation, setTranslationCutoffValue, setTranslationScaleFactor, setUseMouseRotationCutoffs, setUseMouseTranslationCutoffs, setVisible, startAnimator, updateImageFromRotation, updateLighting, UpdateSceneRotation, writeImageMethods 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, UpdateMouseRotationSpeedMethods inherited from class WildMagic.LibApplications.OpenGLApplication.JavaApplication
GetAspectRatio, GetHeight, GetRenderer, GetWidth, GetWindowTitle, GetXPosition, GetYPosition, OnIdle, OnMove, OnPrecreate, OnResize, SetRendererMethods inherited from class WildMagic.LibApplications.OpenGLApplication.Application
reloadShaders, TestStreamingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.awt.event.KeyListener
keyReleased, keyTypedMethods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExitedMethods inherited from interface java.awt.event.MouseMotionListener
mouseMoved
-
Field Details
-
m_kParent
Parent user-interface and display frame. -
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
m_akCLoc
WildMagic.LibFoundation.Mathematics.Vector3f[] m_akCLocCamera Locations, for rendering the different Axial, Sagittal and Coronal views. -
m_akCoords
WildMagic.LibFoundation.Mathematics.Vector3f[] m_akCoordsCamera Direction, UP, and Right vectors, for rendering the different Axial, Sagittal and Coronal views. -
m_bPatientOrientation
protected boolean m_bPatientOrientationActual image orientation. -
m_iPlaneOrientation
protected int m_iPlaneOrientationWhich dimension of the ModelImage to render. -
m_aiLocalImageExtents
private int[] m_aiLocalImageExtentsThe 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_aakColorsSet of colors used to draw the axis labels. -
m_aaiColorSwap
private int[][] m_aaiColorSwapAxis labels color assignments. -
m_bDrawAxes
private boolean m_bDrawAxeswhen true, the axis labels (P-> L-> S->) will be drawn -
m_bDrawXHairs
private boolean m_bDrawXHairsTurns on drawing of the X,Y bars and the Axis labels:. -
m_bLeftMousePressed
private boolean m_bLeftMousePressedTrue when the left mouse has been pressed, set to false when the left mouse button is released. -
m_bRightMousePressed
private boolean m_bRightMousePressedFlag indicating if the right mouse button is currently pressed down: -
m_kActiveLookupTable
The current active lookup table: -
m_fX0
private float m_fX0lower x-bound of the texture-mapped polygon: -
m_fX1
private float m_fX1upper x-bound of the texture-mapped polygon: -
m_fXBox
private float m_fXBoxNumbers dictating the size of the plane based on the extents and resolutions of the image. -
m_fYBox
private float m_fYBoxNumbers dictating the size of the plane based on the extents and resolutions of the image. -
m_fMaxBox
private float m_fMaxBoxNumbers dictating the size of the plane based on the extents and resolutions of the image. -
m_fXRange
private float m_fXRangeWidth of the texture-mapped polygon: -
m_fY0
private float m_fY0lower y-bound of the texture-mapped polygon: -
m_fY1
private float m_fY1upper y-bound of the texture-mapped polygon: -
m_fYRange
private float m_fYRangeHeight of the texture-mapped polygon: -
m_fZoomScale
private float m_fZoomScaleImage scaling from Zoom:. -
m_iSlice
private int m_iSliceWhich slice is currently displayed in the XY plane. -
m_kActiveImage
Current active image for manipulating the LUT by dragging with the right-mouse down. -
m_kLabelX
x-axis label: -
m_kLabelXDisplay
-
m_kLabelY
y-axis label: -
m_kXArrow
private WildMagic.LibGraphics.SceneGraph.TriMesh[] m_kXArrowx-axis arrow -
m_kYArrow
private WildMagic.LibGraphics.SceneGraph.TriMesh[] m_kYArrowy-axis arrow -
m_spkScreenCamera
private WildMagic.LibGraphics.Rendering.Camera m_spkScreenCameraDrawing 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_aiAxisOrderModelImage axis orientation. -
m_abAxisFlip
private boolean[] m_abAxisFlipModelImage axis flip. -
m_fMouseY
private float m_fMouseYFor 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 Details
-
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 Details
-
main
public static PlaneRender_WM main(com.jogamp.opengl.awt.GLCanvas kCanvas, double dpiScale, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB, int iPlane, VolumeSlices kVolumeSlice, boolean displayInSeparateFrame) -
addSlices
Adds the VolumeSlices object to the display list for rendering.- Parameters:
kVolumeSlice- .
-
display
public void display(com.jogamp.opengl.GLAutoDrawable arg0) - Specified by:
displayin interfacecom.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:
disposein interfacecom.jogamp.opengl.GLEventListener- Overrides:
disposein classGPURenderBase
-
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:ScreenCoordinateListenerConverts image file X,Y,Z coordinates into local screen coordinates.- Specified by:
fileToScreenVOIin interfaceScreenCoordinateListener- Parameters:
kFile- image file coordinates.- Returns:
- local screen coordinates.
-
getHeight
public int getHeight()Description copied from interface:ScreenCoordinateListenerReturns the height of the display canvas.- Specified by:
getHeightin interfaceScreenCoordinateListener- Returns:
- height of the display canvas.
-
getOrientation
public int getOrientation() -
getResolutionX
public float getResolutionX()Description copied from interface:ScreenCoordinateListenerReturns the image resolution factor in the screen x-direction.- Specified by:
getResolutionXin interfaceScreenCoordinateListener- Returns:
- image resolution factor in the screen x-direction.
-
getResolutionY
public float getResolutionY()Description copied from interface:ScreenCoordinateListenerReturns the image resolution factor in the screen y-direction.- Specified by:
getResolutionYin interfaceScreenCoordinateListener- Returns:
- image resolution factor in the screen y-direction.
-
getSlice
public int getSlice()Description copied from interface:ScreenCoordinateListenerReturns the currently displayed image slice.- Specified by:
getSlicein interfaceScreenCoordinateListener- Returns:
- the currently displayed image slice.
-
getWidth
public int getWidth()Description copied from interface:ScreenCoordinateListenerReturns the width of the display canvas.- Specified by:
getWidthin interfaceScreenCoordinateListener- Returns:
- width of the display canvas.
-
getZoom
public float getZoom() -
getZoomX
public float getZoomX()Description copied from interface:ScreenCoordinateListenerReturns the image magnification factor in the screen x-direction.- Specified by:
getZoomXin interfaceScreenCoordinateListener- Returns:
- the image magnification factor in the screen x-direction.
-
getZoomY
public float getZoomY()Description copied from interface:ScreenCoordinateListenerReturns the image magnification factor in the screen y-direction.- Specified by:
getZoomYin interfaceScreenCoordinateListener- Returns:
- the image magnification factor in the screen y-direction.
-
init
public void init(com.jogamp.opengl.GLAutoDrawable arg0) - Specified by:
initin interfacecom.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
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin classGPURenderBase
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceMouseWheelListener- Overrides:
mouseWheelMovedin classWildMagic.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:ScreenCoordinateListenerConverts local patient coordinate view (Axial, Coronal, Sagittal) of the image into the screen coordinates.- Specified by:
patientToScreenVOIin interfaceScreenCoordinateListener- 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:GPURenderBasePart of the GLEventListener interface. Called when the GLCanvas is resized.- Specified by:
reshapein interfacecom.jogamp.opengl.GLEventListener- Overrides:
reshapein classGPURenderBase- Parameters:
arg0- the GLCanvasiX- the new x-position in screen coordinates.iY- the new y-position in screen coordinates.iWidth- the new widthiHeight- 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin interfaceScreenCoordinateListener- 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin interfaceScreenCoordinateListener- 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:ScreenCoordinateListenerConverts local screen coordinates, usually from a MouseEvent, into image file coordinates.- Specified by:
screenToFileVOIin interfaceScreenCoordinateListener- 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 valueiY- mouse y coordinate valuekLocal- 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:
setCenterin interfaceScreenCoordinateListener- Parameters:
center- the 3D center in FileCoordinates of the three intersecting ModelImage planes.
-
setImage
-
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, 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
-
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
-
drawVOIText
-
fileCoordinatesToPatient
private WildMagic.LibFoundation.Mathematics.Vector3f fileCoordinatesToPatient(WildMagic.LibFoundation.Mathematics.Vector3f kVolumePt) -
getLocalCenter
-
getSlice
-
processLeftMouseDrag
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
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
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, 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
-
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
-