Class PlaneRenderProstate
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.ProstateFramework.PlaneRenderProstate
- All Implemented Interfaces:
com.jogamp.opengl.GLEventListener,SpaceNavigatorListener,KeyListener,MouseListener,MouseMotionListener,MouseWheelListener,Serializable,EventListener
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classprivate classprivate class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PointStackprivate 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 final double[]private final double[]private final float[][]private int[]ModelImage axis orientation.private final int[][]private int[]The image dimensions in x,y,z:.private int[]The image dimension factors in x,y,z:.(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 final WildMagic.LibFoundation.Mathematics.Vector2f[][]private byte[]private booleanwhen true, the axis labels (P-> L-> S->) will be drawnprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanprivate booleanTurns on drawing of the X,Y bars and the Axis labels:.private booleanChange the mouse cursor with the first mouseDrag eventprivate booleanprivate booleanTrue when the left mouse has been pressed, set to false when the left mouse button is released.protected booleanActual image orientation.private booleanprivate booleanFlag indicating if the right mouse button is currently pressed down:private booleanprivate 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 floatprivate 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 final intprivate final intprivate intprivate intprivate intprivate intprivate intprivate final intprivate final intprivate final intprotected intWhich dimension of the ModelImage to render.private final intprivate intWhich slice is currently displayed in the XY plane.private intprivate ModelImageCurrent active image for manipulating the LUT by dragging with the right-mouse down.private ModelStorageBaseThe current active lookup table:private WildMagic.LibGraphics.SceneGraph.TriMeshprivate final WildMagic.LibFoundation.Mathematics.Vector3fprivate Stringx-axis label:private Stringprivate Stringy-axis label:protected VolumeTriPlanarInterfaceParent user-interface and display frame.private final WildMagic.LibFoundation.Mathematics.Vector3fprivate WildMagic.LibGraphics.SceneGraph.Attributesprivate PlaneRenderProstate.LocalVolumeVOIVector[]private final WildMagic.LibFoundation.Mathematics.Vector3fprivate final WildMagic.LibFoundation.Mathematics.Vector3fprotected WindowLevelWindow-level interface.private WildMagic.LibGraphics.SceneGraph.TriMesh[]x-axis arrowprivate WildMagic.LibGraphics.SceneGraph.TriMesh[]y-axis arrowprivate WildMagic.LibGraphics.Rendering.ZBufferStateprivate WildMagic.LibGraphics.Rendering.CameraDrawing the axis arrows in screen-space.private BitSetprivate static final longUse serialVersionUID for interoperability.private final Stack<int[]> Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
dpiScale, hyperstack, hyperstackColormap, isSpaceNavCodeRunning, m_akLights, m_bDispose, m_bDoClip, m_bExtract, 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_kXRotate, m_kYRotate, m_kZRotate, m_spkCull, m_spkScene, nearPlane, updateBoundingCubeFields 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
ConstructorsConstructorDescriptionDefault PlaneRender interface.PlaneRenderProstate(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 voidaddVOIPoint(int iX, int iY) private floatareaTwice(float ptAx, float ptAy, float ptBx, float ptBy, float ptCx, float ptCy) Calculates twice the area (cross product of two vectors) of a triangle given three points.private floatavgPix(int iX, int iY) This method calculates the average pixel value based on the four neighbors (N, S, E, W).voidclose()Closes the frame.booleancontains(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) Determines if the supplied point can be found within the points that define the contour.private voidcopyVOI()private voidCreates the TriMesh data structures for the axis arrows.private WildMagic.LibGraphics.SceneGraph.PolylinecreatePolyline(WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iZ) private voidInitializes the display parameters.private voidcreateVOI(int iX, int iY) private voidprivate voidvoiddisplay(com.jogamp.opengl.GLAutoDrawable arg0) voiddisplayChanged(com.jogamp.opengl.GLAutoDrawable arg0, boolean arg1, boolean arg2) voiddisplaySurface(boolean bOn) voidClean memory.voidprivate voiddrawAxes(com.jogamp.opengl.GLAutoDrawable arg0) Called from the display function.private voiddrawVOI()private WildMagic.LibFoundation.Mathematics.Vector3fFileCoordinatesToVOI(WildMagic.LibFoundation.Mathematics.Vector3f volumePt, boolean bScale) protected voidfill(int[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iYMin, int iXMax, int iYMax, int iZ, ModelImage kVolume, boolean bIntersection, int iValue) fill: fill the sculpt outline drawn by the user.private voidfillVolume(int iSlice, WildMagic.LibGraphics.SceneGraph.Polyline kPoly, ModelImage kVolume, boolean bIntersection, int iValue) com.jogamp.opengl.awt.GLCanvasReturns the GLCanvas in the m_pkRenderer object.voidinit(com.jogamp.opengl.GLAutoDrawable arg0) private voidvoidkeyPressed(KeyEvent kKey) keyPressed callback.private voidLocalToPatient(WildMagic.LibFoundation.Mathematics.Vector3f localPt, WildMagic.LibFoundation.Mathematics.Vector3f patientPt) private voidLocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kLocal, WildMagic.LibFoundation.Mathematics.Vector3f kScreen) voidmake3DVOI(boolean bIntersection, ModelImage kVolume, int iValue) voidmouseDragged(MouseEvent kEvent) voidmouseMoved(MouseEvent kEvent) voidmousePressed(MouseEvent kEvent) voidmouseReleased(MouseEvent kEvent) voidprivate voidmoveVOI(int iX, int iY) private voidmoveVOIPoint(int iX, int iY) booleannearLine(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) Tests if a point is near the curve.private booleannearPoint(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) protected voidoutlineRegion(int[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iYMin, int iXMax, int iYMax, WildMagic.LibFoundation.Mathematics.Vector3f[] kVolumePts, ModelImage kVolume) This function computes the set of spans indicated by column crossings for the sculpt outline drawn by the user, by doing a polygon scan conversion in gridded space.private voidpasteVOI(int iSlice) private voidpaths(int iX, int iY, int iZ, int i, float level) Generates the possible paths of the level set and pushes them onto a stack.private voidPatientToLocal(WildMagic.LibFoundation.Mathematics.Vector3f patientPt, WildMagic.LibFoundation.Mathematics.Vector3f localPt) 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 voidprocessRightMouseDrag(MouseEvent kEvent) If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)voidreshape(com.jogamp.opengl.GLAutoDrawable arg0, int iX, int iY, int iWidth, int iHeight) Part of the GLEventListener interface.private voidsaveVOI(int iX, int iY, int iSlice) private voidScreenToLocal(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:private voidselectVOI(int iX, int iY) voidsetBackgroundColor(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.private voidsetIndices(int iX, int iY, int iZ) voidSetModified(boolean bModified) Causes re-display.protected 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.voidsetRadiologicalView(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.voidshowAxes(boolean bShow) Turns displaying the Axis labels on or off:private voidshowSelectedVOI(int iX, int iY) voidshowXHairs(boolean bShow) Turns displaying the X and Y bars on or off:singleLevelSet(float startPtX, float startPtY) Creates a single level set.protected voidsortCrossingPoints(int[] aiList, int iNumElements) Sorts the edge crossing points in place.static booleantestDistance(int x, int x1, int x2, int y, int y1, int y2, double tol) Tests the distance for closeness; finds the length of the normal from (x,y) to the line (x1,y1) (x2,y2).private WildMagic.LibFoundation.Mathematics.Vector3fVOIToFileCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f kVOIPt, boolean bScale) private voidzoom()Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.GPURenderBase
AddNode, checkIfSpaceNavNeedsCalibration, dispose, dispose, drawText, fineMovement, 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, 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, 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 com.jogamp.opengl.GLEventListener
disposeMethods inherited from interface java.awt.event.KeyListener
keyReleased, keyTypedMethods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
m_kParent
Parent user-interface and display frame. -
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_kWinLevel
Window-level interface. -
m_aiLocalImageExtents
private int[] m_aiLocalImageExtentsThe image dimensions in x,y,z:. -
m_aiLocalImageFactors
private int[] m_aiLocalImageFactorsThe image dimension factors in x,y,z:. -
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_bFirstDrag
private boolean m_bFirstDragChange the mouse cursor with the first mouseDrag event -
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_fMouseX
private float m_fMouseXFor zooming with the mouse. -
m_fMouseY
private float m_fMouseY -
m_bShowSurface
private boolean m_bShowSurface -
m_bDrawVOI
private boolean m_bDrawVOI -
m_bDrawRect
private boolean m_bDrawRect -
m_bDrawOval
private boolean m_bDrawOval -
m_bDrawPolyline
private boolean m_bDrawPolyline -
m_bDrawLevelSet
private boolean m_bDrawLevelSet -
m_bUpdateVOI
private boolean m_bUpdateVOI -
m_bPointer
private boolean m_bPointer -
m_bSelected
private boolean m_bSelected -
m_iCirclePts
private final int m_iCirclePts- See Also:
-
m_adCos
private final double[] m_adCos -
m_adSin
private final double[] m_adSin -
m_kBallPoint
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kBallPoint -
m_kZState
private WildMagic.LibGraphics.Rendering.ZBufferState m_kZState -
m_kVOIAttr
private WildMagic.LibGraphics.SceneGraph.Attributes m_kVOIAttr -
m_iCurrentVOIPoint
private int m_iCurrentVOIPoint -
m_kPatientPt
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kPatientPt -
m_kVolumeScale
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScale -
m_kVolumeScaleInv
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kVolumeScaleInv -
m_kCurrentVOI
-
m_kCopyVOI
-
m_kVOIList
-
m_bFirstVOI
private boolean m_bFirstVOI -
m_iVOICount
private int m_iVOICount -
m_kCenter
private final WildMagic.LibFoundation.Mathematics.Vector3f m_kCenter -
levelSetStack
-
map
-
stack
-
m_aucData
private byte[] m_aucData -
m_akSteps
private final WildMagic.LibFoundation.Mathematics.Vector2f[][] m_akSteps -
m_aiIndexValues
private final int[][] m_aiIndexValues -
m_afAverages
private final float[][] m_afAverages -
m_iMM
private final int m_iMM- See Also:
-
m_iM
private final int m_iM- See Also:
-
m_i_
private final int m_i_- See Also:
-
m_iP
private final int m_iP- See Also:
-
m_iPP
private final int m_iPP- See Also:
-
-
Constructor Details
-
PlaneRenderProstate
public PlaneRenderProstate()Default PlaneRender interface. -
PlaneRenderProstate
public PlaneRenderProstate(VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB, int iPlane) - Parameters:
kParent-kAnimator-kVolumeImageA-iPlane-
-
-
Method Details
-
testDistance
public static boolean testDistance(int x, int x1, int x2, int y, int y1, int y2, double tol) Tests the distance for closeness; finds the length of the normal from (x,y) to the line (x1,y1) (x2,y2). Returns true if the distance is shorter than tol.- Parameters:
x- x coordinate of point to be testedx1- x coordinate of first point in linex2- x coordinate of second point in liney- y coordinate of point to be testedy1- y coordinate of first point in liney2- y coordinate of second point in linetol- distance to test against- Returns:
- true if the distance is shorter than tol.
-
addSlices
Adds the VolumeSlices object to the display list for rendering.- Parameters:
kVolumeSlice- .
-
close
public void close()Closes the frame. -
contains
public boolean contains(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) Determines if the supplied point can be found within the points that define the contour.- Returns:
- true if point is within the contour
-
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) -
disposeLocal
public void disposeLocal()Clean memory. -
doVOI
-
GetCanvas
public com.jogamp.opengl.awt.GLCanvas GetCanvas()Description copied from class:GPURenderBaseReturns the GLCanvas in the m_pkRenderer object.- Overrides:
GetCanvasin classGPURenderBase- Returns:
- OpenGLRenderer.GLCanvas
-
init
public void init(com.jogamp.opengl.GLAutoDrawable arg0) - Specified by:
initin interfacecom.jogamp.opengl.GLEventListener
-
keyPressed
keyPressed callback.- Specified by:
keyPressedin interfaceKeyListener- Overrides:
keyPressedin classGPURenderBase- Parameters:
kKey- the KeyEvent triggering the callback.
-
make3DVOI
-
mouseDragged
- Specified by:
mouseDraggedin interfaceMouseMotionListener- Overrides:
mouseDraggedin classWildMagic.LibApplications.OpenGLApplication.JavaApplication3D
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin 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
-
nearLine
public boolean nearLine(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) Tests if a point is near the curve.- Parameters:
x- x coordinate of pointy- y coordinate of pointtol- tolerance indicating the capture range to the line the point.- Returns:
- returns boolean result of test
-
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
-
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.- Parameters:
center- the 3D center in FileCoordinates of the three intersecting ModelImage planes.
-
SetModified
public void SetModified(boolean bModified) Causes re-display.- Parameters:
bModified-
-
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.
-
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
-
fill
protected void fill(int[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iYMin, int iXMax, int iYMax, int iZ, ModelImage kVolume, boolean bIntersection, int iValue) fill: fill the sculpt outline drawn by the user. Pixels are determined to be inside or outside the sculpt region based on the parameters, aaiCrossingPoints and aiNumCrossings, using a scan-conversion algorithm that traverses each row and column of the bounding box of the sculpt region coloring inside points as it goes.- Parameters:
aaiCrossingPoints- DOCUMENT ME!aiNumCrossings- DOCUMENT ME!
-
outlineRegion
protected void outlineRegion(int[][] aaiCrossingPoints, int[] aiNumCrossings, int iXMin, int iYMin, int iXMax, int iYMax, WildMagic.LibFoundation.Mathematics.Vector3f[] kVolumePts, ModelImage kVolume) This function computes the set of spans indicated by column crossings for the sculpt outline drawn by the user, by doing a polygon scan conversion in gridded space. The outline must be closed with last point = first point.- Parameters:
aaiCrossingPoints- DOCUMENT ME!aiNumCrossings- DOCUMENT ME!
-
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.
-
sortCrossingPoints
protected void sortCrossingPoints(int[] aiList, int iNumElements) Sorts the edge crossing points in place.- Parameters:
aiList- list of positionsiNumElements- number of positions.
-
addVOIPoint
private void addVOIPoint(int iX, int iY) -
areaTwice
private float areaTwice(float ptAx, float ptAy, float ptBx, float ptBy, float ptCx, float ptCy) Calculates twice the area (cross product of two vectors) of a triangle given three points. This is a private function only called by the function "contains".- Parameters:
ptAx- x-coordinate of the first point of the triangleptAy- y-coordinate of the first point of the triangleptBx- x-coordinate of the second point of the triangleptBy- y-coordinate of the second point of the triangleptCx- x-coordinate of the third point of the triangleptCy- y-coordinate of the third point of the triangle- Returns:
- twice the area of the triangle if CCw or -2*area if CW
-
copyVOI
private void copyVOI() -
CreateLabels
private void CreateLabels()Creates the TriMesh data structures for the axis arrows. -
createPolyline
private WildMagic.LibGraphics.SceneGraph.Polyline createPolyline(WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer, int iZ) -
CreateScene
private void CreateScene()Initializes the display parameters. -
createVOI
private void createVOI(int iX, int iY) -
deleteAllVOI
private void deleteAllVOI() -
deleteVOI
private void deleteVOI() -
drawAxes
private void drawAxes(com.jogamp.opengl.GLAutoDrawable arg0) Called from the display function. Draws the axis arrows. -
drawVOI
private void drawVOI() -
fillVolume
private void fillVolume(int iSlice, WildMagic.LibGraphics.SceneGraph.Polyline kPoly, ModelImage kVolume, boolean bIntersection, int iValue) -
LocalToPatient
private void LocalToPatient(WildMagic.LibFoundation.Mathematics.Vector3f localPt, WildMagic.LibFoundation.Mathematics.Vector3f patientPt) -
PatientToLocal
private void PatientToLocal(WildMagic.LibFoundation.Mathematics.Vector3f patientPt, WildMagic.LibFoundation.Mathematics.Vector3f localPt) -
moveVOI
private void moveVOI(int iX, int iY) -
moveVOIPoint
private void moveVOIPoint(int iX, int iY) -
nearPoint
private boolean nearPoint(int iX, int iY, WildMagic.LibGraphics.SceneGraph.VertexBuffer kVBuffer) -
pasteVOI
private void pasteVOI(int iSlice) -
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
-
saveVOI
private void saveVOI(int iX, int iY, int iSlice) -
ScreenToLocal
private void 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
-
LocalToScreen
private void LocalToScreen(WildMagic.LibFoundation.Mathematics.Vector3f kLocal, WildMagic.LibFoundation.Mathematics.Vector3f kScreen) -
selectVOI
private void selectVOI(int iX, int iY) -
setSlice
private void setSlice(float fSlice) Sets the local slice value.- Parameters:
fSlice-
-
showSelectedVOI
private void showSelectedVOI(int iX, int iY) -
VOIToFileCoordinates
private WildMagic.LibFoundation.Mathematics.Vector3f VOIToFileCoordinates(WildMagic.LibFoundation.Mathematics.Vector3f kVOIPt, boolean bScale) -
FileCoordinatesToVOI
private WildMagic.LibFoundation.Mathematics.Vector3f FileCoordinatesToVOI(WildMagic.LibFoundation.Mathematics.Vector3f volumePt, boolean bScale) -
zoom
private void zoom() -
avgPix
private float avgPix(int iX, int iY) This method calculates the average pixel value based on the four neighbors (N, S, E, W).- Parameters:
index- the center pixel where the average pixel value is to be calculated.- Returns:
- the average pixel value as a float.
-
paths
private void paths(int iX, int iY, int iZ, int i, float level) Generates the possible paths of the level set and pushes them onto a stack. Looks in the 8 neighborhood directions for the possible paths. -
singleLevelSet
Creates a single level set. Takes a starting point and finds a closed path along the levelset back to the starting point.- Parameters:
startPtX- the start pointstartPtY- the start pointlevel- the level of the level set
-
initDataBuffer
private void initDataBuffer() -
setIndices
private void setIndices(int iX, int iY, int iZ)
-