Package gov.nih.mipav.view.renderer.J3D
Class PlaneRender
java.lang.Object
java.awt.Component
java.awt.Canvas
javax.media.j3d.Canvas3D
gov.nih.mipav.view.renderer.J3D.VolumeCanvas3D
gov.nih.mipav.view.renderer.J3D.PlaneRender
- All Implemented Interfaces:
MouseBehaviorCallback,MouseListener,MouseMotionListener,ImageObserver,MenuContainer,Serializable,EventListener,Accessible
public class PlaneRender
extends VolumeCanvas3D
implements MouseMotionListener, MouseListener, MouseBehaviorCallback
Class PlaneRender: renders a single dimension of the ModelImage data as a
texture-mapped polygon. The PlaneRender class keeps track of whether it is
rendering the Axial, Sagital, or Coronal view of the data.
Surfaces are displayed as the intersection of the ModelTriangleMesh with
the rendered z-slice.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.awt.Canvas
Canvas.AccessibleAWTCanvasNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]The image dimensions in x,y,z:.private javax.vecmath.Color3f[]Set of colors used to draw the X and Y Bars and the Z box:.private javax.media.j3d.ImageComponent2D[]Image component 2D.private booleanwhen true, the axis labels (P-> L-> S->) will be drawnprivate booleanTurns on drawing of the X,Y bars and the Axis labels:.private booleanBoolean to turn on/off the RFA probe entry point selection with mouse:.private booleanChange the mouse cursor with the first mouseDrag eventprivate booleanTrue when the left mouse has been pressed, set to false when the left mouse button is released.private booleanWhether to store all the data in ImageComponent2D array or not:.private booleanActual image orietation.private booleanFlag indicating if the right mouse button is currently pressed down:private floatThe center of the X,Y bar cross hairs, in plane coordinates:.private floatThe center of the X,Y bar cross hairs, in plane coordinates:.private floatNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatlower x-bound of the texture-mapped polygon:private floatupper x-bound of the texture-mapped polygon:private floatNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatWidth of the texture-mapped polygon:private floatX direction mouse translation.private floatlower y-bound of the texture-mapped polygon:private floatupper y-bound of the texture-mapped polygon:private floatNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatHeight of the texture-mapped polygon:private floatY direction mouse translatioin.private floatImage scaling from Zoom:.private 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:private VolumeCanvas3DThe Canvas3D object on which the plane is drawn.private javax.media.j3d.Transform3Dcurrent zoom transformationprivate javax.media.j3d.ImageComponent2DThe current displayed texture, based on the value of m_iSlice.private ModelImageCurrent image A.private ModelImageCurrent image B.private Stringx-axis label:private Stringy-axis label:private MouseTranslationMouse translate behavior.private MouseZoomBehaviorMouse zoom behavior.private javax.media.j3d.BranchGroupThe BranchGroup root of the scene managed by the simple universe.private javax.media.j3d.OrderedGroupRoot order group of the image scene graph.private ViewJFrameVolumeViewReference to the parent frame:.private PatientSlicePatientSlice contains all the Patient Coordinate System view-specific data for rendering this component:private javax.media.j3d.BranchGroupBranch group for the RFA indicator point.private javax.media.j3d.BranchGroupBranch group to hold the texture image.private javax.media.j3d.TransformGroupTransform group to hold the texture images.private javax.media.j3d.Texture2DThe 2D texture for the texture-mapped polygon.private javax.media.j3d.TransformGroupGroup dictating how the plane is translated.private com.sun.j3d.utils.universe.SimpleUniverseThe SimpleUniverse object which is the parent of everything else in the scene.private WindowLevelprivate static final longUse serialVersionUID for interoperability.Fields inherited from class gov.nih.mipav.view.renderer.J3D.VolumeCanvas3D
m_dAccumulatedTime, m_dFrameRate, m_dLastTime, m_iAccumulatedFrameCount, m_iFrameCount, m_iMaxTimer, m_iTimerFields inherited from class javax.media.j3d.Canvas3D
FIELD_ALL, FIELD_LEFT, FIELD_RIGHTFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface gov.nih.mipav.view.renderer.J3D.surfaceview.rfaview.mouse.MouseBehaviorCallback
ORBIT, PROPERTIES, ROTATE, ROTATE_LEFTBUTTON, SELECTION, TRANSLATE, ZOOM -
Constructor Summary
ConstructorsConstructorDescriptionPlaneRender(ViewJFrameVolumeView kParent, ModelImage kImageA, ModelLUT kLUTa, ModelImage kImageB, ModelLUT kLUTb, GraphicsConfiguration kConfig, int iPlane, boolean bMemory) Creates a new PlaneRender object. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the frame.private voidCreates the scene graph, made up of a branch group parent, a transform group under that which applies mouse behaviors to the scene, and a branch groups under the transform group for the texture-mapped polygon.voidClean memory.private voidDraws the Z box, the X bar and the Y bar:.voiddrawRFAPoint(javax.vecmath.Point3f kPoint) Given a point in FileCoordinates, transform the point to local PatientCoordinates, and draw with a red sphere:voidenableTargetPointPicking(boolean bEnable) Enable or disable target point for the RFA probe from within the plane renderer:protected voidfinalize()Cleans memory.Returns the VolumeCanvas3D object.javax.vecmath.Vector3fReturns the current center point of the 3 intersecting ModelImage planes in FileCoordinates.Accessor that returns the reference to image A.Accessor that returns the reference to image B.private voidinit()Creates the scene graph and initializes the SimpleUniverse and the Viewing transformations.private voidinitAxes()Initializes the Axis labels based on the ModelImage orientation.private voidLocalToPatient(WildMagic.LibFoundation.Mathematics.Vector3f localPt, WildMagic.LibFoundation.Mathematics.Vector3f patientPt) voidmouseClicked(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseDragged(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseEntered(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseExited(MouseEvent kEvent) One of the overrides necessary to be a mouselistener.voidmouseMoved(MouseEvent kEvent) One of the overrides necessary to be a MouseMotionListener.voidmousePressed(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.voidmouseReleased(MouseEvent kEvent) One of the overrides necessary to be a MouseListener.private voidPatientToLocal(WildMagic.LibFoundation.Mathematics.Vector3f patientPt, WildMagic.LibFoundation.Mathematics.Vector3f localPt) Convert the position in PatientCoordinates into Local rendering 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 therefor the ZSlice positions of the associated PlaneRender 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)private voidScreenToLocal(int iX, int iY, WildMagic.LibFoundation.Mathematics.Vector3f kLocal, boolean bSetCenter) Calculate the position of the mouse in the Local Coordinates, taking into account zoom and translate:voidsetBackgroundColor(Color color) 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 PlaneRender object, based on the 3D location of the three intersecting ModelImage planes.voidAccessor that sets the LUT for image A.voidAccessor that sets the LUT for image B.private voidBased on the orientaion 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.voidAccessor that sets the RGB lookup table for image A.voidAccessor that sets the RGB lookup table for image B.voidsetSlice(float fSlice) Changes the displayed texture based on the new value for m_iSlice.voidsetSliceHairColor(int iView, javax.vecmath.Color3f kColor) Sets the default color for the SliceHairColor.private voidsetXBar(float fSlice) Sets the new location of the XBar.private voidsetYBar(float fSlice) Sets the new location of the YBar.voidshowAxes(boolean bShow) Turns displaying the Axis labes on or off:voidshowXHairs(boolean bShow) Turns displaying the X and Y bars on or off:voidtransformChanged(int type, javax.media.j3d.Transform3D transform) Tells the mouse dialog that the transform has changed.voidupdate()Causes the labels to be redrawn:.voidCauses new data to be loaded from the ModelImage into the textures and redisplayed on the texture-mapped polygon:voidCauses the data to be redrawn with new LUT values:voidupdateRGBTA(ModelRGB RGBT) Causes the data to be redrawn with new RGBTA values:voidupdateRGBTB(ModelRGB RGBT) Causes the data to be redrawn with new RGBTA values:private voidupdateViewScreenScale(javax.media.j3d.Transform3D kTransform) This function calculates the scale factor for zooming in parallel projection.private voidwriteTexture(boolean bForceShow) Stores the ModelImage data as an array of texture maps, with LUT or RGBA color lookup:.Methods inherited from class gov.nih.mipav.view.renderer.J3D.VolumeCanvas3D
GetTestFrameRate, MeasureTime, paint, postSwap, ResetTime, SetTestFrameRate, supportsTexture3D, update, UpdateFrameCountMethods inherited from class javax.media.j3d.Canvas3D
addNotify, getCenterEyeInImagePlate, getDoubleBufferAvailable, getDoubleBufferEnable, getGraphics2D, getGraphicsContext3D, getImagePlateToVworld, getInverseVworldProjection, getLeftEyeInImagePlate, getLeftManualEyeInImagePlate, getLocationOnScreen, getMonoscopicViewPolicy, getOffScreenBuffer, getOffScreenLocation, getOffScreenLocation, getPhysicalHeight, getPhysicalWidth, getPixelLocationFromImagePlate, getPixelLocationInImagePlate, getPixelLocationInImagePlate, getRightEyeInImagePlate, getRightManualEyeInImagePlate, getSceneAntialiasingAvailable, getScreen3D, getStereoAvailable, getStereoEnable, getView, getVworldProjection, getVworldToImagePlate, isOffScreen, isRendererRunning, isShadingLanguageSupported, postRender, preRender, queryProperties, removeNotify, renderField, renderOffScreenBuffer, setDoubleBufferEnable, setLeftManualEyeInImagePlate, setMonoscopicViewPolicy, setOffScreenBuffer, setOffScreenLocation, setOffScreenLocation, setRightManualEyeInImagePlate, setStereoEnable, startRenderer, stopRenderer, swap, waitForOffScreenRenderingMethods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategyMethods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setMixingCutoutShape, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDUse serialVersionUID for interoperability.- See Also:
-
m_aiLocalImageExtents
private int[] m_aiLocalImageExtentsThe image dimensions in x,y,z:. -
m_akImageComponent
private javax.media.j3d.ImageComponent2D[] m_akImageComponentImage component 2D. Used to store the ModelImage data as textures. -
m_akColors
private javax.vecmath.Color3f[] m_akColorsSet of colors used to draw the X and Y Bars and the Z box:. -
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_bEntryPointSelect
private boolean m_bEntryPointSelectBoolean to turn on/off the RFA probe entry point selection with mouse:. -
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_bMemoryUsage
private boolean m_bMemoryUsageWhether to store all the data in ImageComponent2D array or not:. -
m_bPatientOrientation
private boolean m_bPatientOrientationActual image orietation. -
m_bRightMousePressed
private boolean m_bRightMousePressedFlag indicating if the right mouse button is currently pressed down: -
m_fCenterX
private float m_fCenterXThe center of the X,Y bar cross hairs, in plane coordinates:. -
m_fCenterY
private float m_fCenterYThe center of the X,Y bar cross hairs, in plane coordinates:. -
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 dicatating the size of the plane based on the extents and resolutions of the image. -
m_fYBox
private float m_fYBoxNumbers dicatating the size of the plane based on the extents and resolutions of the image. -
m_fMaxBox
private float m_fMaxBoxNumbers dicatating 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_fXTranslate
private float m_fXTranslateX direction mouse translation. -
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_fYTranslate
private float m_fYTranslateY direction mouse translatioin. -
m_fZoomScale
private float m_fZoomScaleImage scaling from Zoom:. -
m_iPlaneOrientation
private int m_iPlaneOrientationWhich dimension of the ModelImage to render. -
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_kCanvas
The Canvas3D object on which the plane is drawn. -
m_kCurrentTransform
private javax.media.j3d.Transform3D m_kCurrentTransformcurrent zoom transformation -
m_kDisplayedImage
private javax.media.j3d.ImageComponent2D m_kDisplayedImageThe current displayed texture, based on the value of m_iSlice. -
m_kImageA
Current image A. -
m_kImageB
Current image B. -
m_kLabelX
x-axis label: -
m_kLabelY
y-axis label: -
m_kMouseTranslate
Mouse translate behavior. -
m_kMouseZoom
Mouse zoom behavior. -
m_kObjRootBG
private javax.media.j3d.BranchGroup m_kObjRootBGThe BranchGroup root of the scene managed by the simple universe. The root has a single child, a TransformGroup, that manages all of the actual objects. -
m_kOrderedGroup
private javax.media.j3d.OrderedGroup m_kOrderedGroupRoot order group of the image scene graph. -
m_kParent
Reference to the parent frame:. -
m_kRFA_BranchGroup
private javax.media.j3d.BranchGroup m_kRFA_BranchGroupBranch group for the RFA indicator point. -
m_kTextBranchGroup
private javax.media.j3d.BranchGroup m_kTextBranchGroupBranch group to hold the texture image. -
m_kTextTransformGroup
private javax.media.j3d.TransformGroup m_kTextTransformGroupTransform group to hold the texture images. -
m_kTexture
private javax.media.j3d.Texture2D m_kTextureThe 2D texture for the texture-mapped polygon. -
m_kTranslationTG
private javax.media.j3d.TransformGroup m_kTranslationTGGroup dictating how the plane is translated. -
m_kUniverse
private com.sun.j3d.utils.universe.SimpleUniverse m_kUniverseThe SimpleUniverse object which is the parent of everything else in the scene. -
m_kPatientSlice
PatientSlice contains all the Patient Coordinate System view-specific data for rendering this component: -
m_kWinLevel
-
-
Constructor Details
-
PlaneRender
public PlaneRender(ViewJFrameVolumeView kParent, ModelImage kImageA, ModelLUT kLUTa, ModelImage kImageB, ModelLUT kLUTb, GraphicsConfiguration kConfig, int iPlane, boolean bMemory) Creates a new PlaneRender object.- Parameters:
kParent- ViewJFrameVolumeView - reference to parent frame.kImageA- First image to display, cannot be null.kLUTa- LUT of the imageA (if null grayscale LUT is constructed).kImageB- Second loaded image, may be null.kLUTb- LUT of the imageB, may be null.kConfig- GraphicsConfigurationiPlane- Image dimension to be displayed.bMemory- when true store all the data in memory, when false, write textues as the slices change
-
-
Method Details
-
close
public void close()Closes the frame. -
disposeLocal
public void disposeLocal()Clean memory. -
drawRFAPoint
public void drawRFAPoint(javax.vecmath.Point3f kPoint) Given a point in FileCoordinates, transform the point to local PatientCoordinates, and draw with a red sphere:- Parameters:
kPoint- RFA indicator point coordinate
-
enableTargetPointPicking
public void enableTargetPointPicking(boolean bEnable) Enable or disable target point for the RFA probe from within the plane renderer:- Parameters:
bEnable- true enable target point, false not.
-
getCanvas
Returns the VolumeCanvas3D object.- Returns:
- the volume canvas
-
getImageA
Accessor that returns the reference to image A.- Returns:
- Image A.
-
getImageB
Accessor that returns the reference to image B.- Returns:
- Image B.
-
mouseClicked
One of the overrides necessary to be a MouseListener. This function is called when there is a double-click event.- Specified by:
mouseClickedin interfaceMouseListener- Parameters:
kEvent- the mouse event generated by a mouse clicked
-
mouseDragged
One of the overrides necessary to be a MouseListener. This function is invoked when a mouse button is held down and the mouse is dragged in the active window area.- Specified by:
mouseDraggedin interfaceMouseMotionListener- Parameters:
kEvent- the mouse event generated by a mouse drag
-
mouseEntered
One of the overrides necessary to be a MouseListener. This function is called when the mouse enters the active area.- Specified by:
mouseEnteredin interfaceMouseListener- Parameters:
kEvent- the mouse event generated by a mouse entered
-
mouseExited
One of the overrides necessary to be a mouselistener. This function is called when the mouse leaves the active area.- Specified by:
mouseExitedin interfaceMouseListener- Parameters:
kEvent- the mouse event generated by a mouse exit
-
mouseMoved
One of the overrides necessary to be a MouseMotionListener. This function is called when the mouse is moved (without holding any buttons down).- Specified by:
mouseMovedin interfaceMouseMotionListener- Parameters:
kEvent- the event generated by a mouse movement
-
mousePressed
One of the overrides necessary to be a MouseListener.If the left mouse button is pressed, the function sets the m_bLeftMousePressed to be true, and records the current canvas width and height.
- Specified by:
mousePressedin interfaceMouseListener- Parameters:
kEvent- the mouse event generated by a mouse press
-
mouseReleased
One of the overrides necessary to be a MouseListener.- Specified by:
mouseReleasedin interfaceMouseListener- Parameters:
kEvent- the mouse event generated by a mouse release
-
setBackgroundColor
Sets the background color for the frame and rendered image.- Parameters:
color- RGBA color to use as the background color.
-
setLUTa
Accessor that sets the LUT for image A.- Parameters:
LUT- The LUT.
-
setLUTb
Accessor that sets the LUT for image B.- Parameters:
LUT- The LUT.
-
setRGBTA
Accessor that sets the RGB lookup table for image A.- Parameters:
RGBT- the new ModelRGB for PatientSlice.imageA
-
setRGBTB
Accessor that sets the RGB lookup table for image B.- Parameters:
RGBT- the new ModelRGB for PatientSlice.imageB
-
setSlice
public void setSlice(float fSlice) Changes the displayed texture based on the new value for m_iSlice.- Parameters:
fSlice- The relative position along the actual m_aiLocalImageExtents[2] dimension of the new slice.
-
setXBar
private void setXBar(float fSlice) Sets the new location of the XBar.- Parameters:
fSlice- The new position of the XBar in plane coordinates:
-
setSliceHairColor
public void setSliceHairColor(int iView, javax.vecmath.Color3f kColor) Sets the default color for the SliceHairColor.- Parameters:
kColor- set the hair color to this color
-
setYBar
private void setYBar(float fSlice) Sets the new location of the YBar.- Parameters:
fSlice- The new position of the YBar in plane coordinates:
-
showAxes
public void showAxes(boolean bShow) Turns displaying the Axis labes on or off:- Parameters:
bShow- when true display the axis lables, 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
-
transformChanged
public void transformChanged(int type, javax.media.j3d.Transform3D transform) Tells the mouse dialog that the transform has changed.- Specified by:
transformChangedin interfaceMouseBehaviorCallback- Parameters:
type- Type of transform.transform- Transform that was changed to.
-
update
public void update()Causes the labels to be redrawn:. -
updateData
public void updateData()Causes new data to be loaded from the ModelImage into the textures and redisplayed on the texture-mapped polygon: -
updateLut
Causes the data to be redrawn with new LUT values:- Parameters:
LUTa- imageA LUTLUTb- imageB LUT
-
updateRGBTA
Causes the data to be redrawn with new RGBTA values:- Parameters:
RGBT- imageA ModelRGB
-
updateRGBTB
Causes the data to be redrawn with new RGBTA values:- Parameters:
RGBT- imageB ModelRGB
-
finalize
Cleans memory. -
createImageSceneGraph
private void createImageSceneGraph()Creates the scene graph, made up of a branch group parent, a transform group under that which applies mouse behaviors to the scene, and a branch groups under the transform group for the texture-mapped polygon. -
drawLabels
private void drawLabels()Draws the Z box, the X bar and the Y bar:. -
ScreenToLocal
private void ScreenToLocal(int iX, int iY, WildMagic.LibFoundation.Mathematics.Vector3f kLocal, boolean bSetCenter) 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 CoordinatesbSetCenter- if true updates the position for rendering the x-bar and y-bar colored axes (for left mouse drag)
-
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) Convert the position in PatientCoordinates into Local rendering coordinates:- Parameters:
patientPt- the current point in PatientCoordinateslocalPt- the transformed point in LocalCoordinates
-
init
private void init()Creates the scene graph and initializes the SimpleUniverse and the Viewing transformations. -
initAxes
private void initAxes()Initializes the Axis labels based on the ModelImage orientation. Axes are displayed with 3D text objects and arrows drawn as polygons. They are colored and labeled to match the axes they represent. -
processLeftMouseDrag
Dragging the mouse with the left-mouse button held down changes the positions of the X and Y cross bars, and therefor the ZSlice positions of the associated PlaneRender 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
-
setCenter
public void setCenter(WildMagic.LibFoundation.Mathematics.Vector3f center) setCenter sets the cursor and slice position for this PlaneRender 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.
-
getCenter
public javax.vecmath.Vector3f getCenter()Returns the current center point of the 3 intersecting ModelImage planes in FileCoordinates.- Returns:
- the current volume center point in FileCoordinates
-
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
-
setOrientation
private void setOrientation()Based on the orientaion 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.
-
updateViewScreenScale
private void updateViewScreenScale(javax.media.j3d.Transform3D kTransform) This function calculates the scale factor for zooming in parallel projection. The scenario is to calculate the distance between the origin boxframe center and tranformed boxframe center. This distance is used to compute the screen scale factor.- Parameters:
kTransform- The tranformation matrix from tranformChanged().
-
writeTexture
private void writeTexture(boolean bForceShow) Stores the ModelImage data as an array of texture maps, with LUT or RGBA color lookup:.
-