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,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,java.util.EventListener,javax.accessibility.Accessible
public class PlaneRender extends VolumeCanvas3D implements java.awt.event.MouseMotionListener, java.awt.event.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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private int[]m_aiLocalImageExtentsThe image dimensions in x,y,z:.private javax.vecmath.Color3f[]m_akColorsSet of colors used to draw the X and Y Bars and the Z box:.private javax.media.j3d.ImageComponent2D[]m_akImageComponentImage component 2D.private booleanm_bDrawAxeswhen true, the axis labels (P-> L-> S->) will be drawnprivate booleanm_bDrawXHairsTurns on drawing of the X,Y bars and the Axis labels:.private booleanm_bEntryPointSelectBoolean to turn on/off the RFA probe entry point selection with mouse:.private booleanm_bFirstDragChange the mouse cursor with the first mouseDrag eventprivate booleanm_bLeftMousePressedTrue when the left mouse has been pressed, set to false when the left mouse button is released.private booleanm_bMemoryUsageWhether to store all the data in ImageComponent2D array or not:.private booleanm_bPatientOrientationActual image orietation.private booleanm_bRightMousePressedFlag indicating if the right mouse button is currently pressed down:private floatm_fCenterXThe center of the X,Y bar cross hairs, in plane coordinates:.private floatm_fCenterYThe center of the X,Y bar cross hairs, in plane coordinates:.private floatm_fMaxBoxNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatm_fX0lower x-bound of the texture-mapped polygon:private floatm_fX1upper x-bound of the texture-mapped polygon:private floatm_fXBoxNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatm_fXRangeWidth of the texture-mapped polygon:private floatm_fXTranslateX direction mouse translation.private floatm_fY0lower y-bound of the texture-mapped polygon:private floatm_fY1upper y-bound of the texture-mapped polygon:private floatm_fYBoxNumbers dicatating the size of the plane based on the extents and resolutions of the image.private floatm_fYRangeHeight of the texture-mapped polygon:private floatm_fYTranslateY direction mouse translatioin.private floatm_fZoomScaleImage scaling from Zoom:.private intm_iPlaneOrientationWhich dimension of the ModelImage to render.private intm_iSliceWhich slice is currently displayed in the XY plane.private ModelImagem_kActiveImageCurrent active image for manipulating the LUT by dragging with the right-mouse down.private ModelStorageBasem_kActiveLookupTableThe current active lookup table:private VolumeCanvas3Dm_kCanvasThe Canvas3D object on which the plane is drawn.private javax.media.j3d.Transform3Dm_kCurrentTransformcurrent zoom transformationprivate javax.media.j3d.ImageComponent2Dm_kDisplayedImageThe current displayed texture, based on the value of m_iSlice.private ModelImagem_kImageACurrent image A.private ModelImagem_kImageBCurrent image B.private java.lang.Stringm_kLabelXx-axis label:private java.lang.Stringm_kLabelYy-axis label:private MouseTranslationm_kMouseTranslateMouse translate behavior.private MouseZoomBehaviorm_kMouseZoomMouse zoom behavior.private javax.media.j3d.BranchGroupm_kObjRootBGThe BranchGroup root of the scene managed by the simple universe.private javax.media.j3d.OrderedGroupm_kOrderedGroupRoot order group of the image scene graph.private ViewJFrameVolumeViewm_kParentReference to the parent frame:.private PatientSlicem_kPatientSlicePatientSlice contains all the Patient Coordinate System view-specific data for rendering this component:private javax.media.j3d.BranchGroupm_kRFA_BranchGroupBranch group for the RFA indicator point.private javax.media.j3d.BranchGroupm_kTextBranchGroupBranch group to hold the texture image.private javax.media.j3d.TransformGroupm_kTextTransformGroupTransform group to hold the texture images.private javax.media.j3d.Texture2Dm_kTextureThe 2D texture for the texture-mapped polygon.private javax.media.j3d.TransformGroupm_kTranslationTGGroup dictating how the plane is translated.private com.sun.j3d.utils.universe.SimpleUniversem_kUniverseThe SimpleUniverse object which is the parent of everything else in the scene.private WindowLevelm_kWinLevelprivate static longserialVersionUIDUse 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_iTimer
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Fields inherited from interface gov.nih.mipav.view.renderer.J3D.surfaceview.rfaview.mouse.MouseBehaviorCallback
ORBIT, PROPERTIES, ROTATE, ROTATE_LEFTBUTTON, SELECTION, TRANSLATE, ZOOM
-
-
Constructor Summary
Constructors Constructor Description PlaneRender(ViewJFrameVolumeView kParent, ModelImage kImageA, ModelLUT kLUTa, ModelImage kImageB, ModelLUT kLUTb, java.awt.GraphicsConfiguration kConfig, int iPlane, boolean bMemory)Creates a new PlaneRender object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the frame.private voidcreateImageSceneGraph()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.voiddisposeLocal()Clean memory.private voiddrawLabels()Draws 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.VolumeCanvas3DgetCanvas()Returns the VolumeCanvas3D object.javax.vecmath.Vector3fgetCenter()Returns the current center point of the 3 intersecting ModelImage planes in FileCoordinates.ModelImagegetImageA()Accessor that returns the reference to image A.ModelImagegetImageB()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(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a MouseListener.voidmouseDragged(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a MouseListener.voidmouseEntered(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a MouseListener.voidmouseExited(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a mouselistener.voidmouseMoved(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a MouseMotionListener.voidmousePressed(java.awt.event.MouseEvent kEvent)One of the overrides necessary to be a MouseListener.voidmouseReleased(java.awt.event.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(java.awt.event.MouseEvent kEvent)Dragging the mouse with the left-mouse button held down changes the positions of the X and Y cross bars, and therefor the ZSlice positions of the associated PlaneRender objects and the TriPlanar Surface.private voidprocessRightMouseDrag(java.awt.event.MouseEvent kEvent)If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)private 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(java.awt.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.voidsetLUTa(ModelLUT LUT)Accessor that sets the LUT for image A.voidsetLUTb(ModelLUT LUT)Accessor that sets the LUT for image B.private voidsetOrientation()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.voidsetRGBTA(ModelRGB RGBT)Accessor that sets the RGB lookup table for image A.voidsetRGBTB(ModelRGB RGBT)Accessor 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:.voidupdateData()Causes new data to be loaded from the ModelImage into the textures and redisplayed on the texture-mapped polygon:voidupdateLut(ModelLUT LUTa, ModelLUT LUTb)Causes 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, UpdateFrameCount
-
Methods 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, waitForOffScreenRendering
-
Methods inherited from class java.awt.Canvas
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy
-
Methods 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 Detail
-
serialVersionUID
private static final long serialVersionUID
Use serialVersionUID for interoperability.- See Also:
- Constant Field Values
-
m_aiLocalImageExtents
private int[] m_aiLocalImageExtents
The image dimensions in x,y,z:.
-
m_akImageComponent
private javax.media.j3d.ImageComponent2D[] m_akImageComponent
Image component 2D. Used to store the ModelImage data as textures.
-
m_akColors
private javax.vecmath.Color3f[] m_akColors
Set of colors used to draw the X and Y Bars and the Z box:.
-
m_bDrawAxes
private boolean m_bDrawAxes
when true, the axis labels (P-> L-> S->) will be drawn
-
m_bDrawXHairs
private boolean m_bDrawXHairs
Turns on drawing of the X,Y bars and the Axis labels:.
-
m_bEntryPointSelect
private boolean m_bEntryPointSelect
Boolean to turn on/off the RFA probe entry point selection with mouse:.
-
m_bFirstDrag
private boolean m_bFirstDrag
Change the mouse cursor with the first mouseDrag event
-
m_bLeftMousePressed
private boolean m_bLeftMousePressed
True when the left mouse has been pressed, set to false when the left mouse button is released.
-
m_bMemoryUsage
private boolean m_bMemoryUsage
Whether to store all the data in ImageComponent2D array or not:.
-
m_bPatientOrientation
private boolean m_bPatientOrientation
Actual image orietation.
-
m_bRightMousePressed
private boolean m_bRightMousePressed
Flag indicating if the right mouse button is currently pressed down:
-
m_fCenterX
private float m_fCenterX
The center of the X,Y bar cross hairs, in plane coordinates:.
-
m_fCenterY
private float m_fCenterY
The center of the X,Y bar cross hairs, in plane coordinates:.
-
m_kActiveLookupTable
private ModelStorageBase m_kActiveLookupTable
The current active lookup table:
-
m_fX0
private float m_fX0
lower x-bound of the texture-mapped polygon:
-
m_fX1
private float m_fX1
upper x-bound of the texture-mapped polygon:
-
m_fXBox
private float m_fXBox
Numbers dicatating the size of the plane based on the extents and resolutions of the image.
-
m_fYBox
private float m_fYBox
Numbers dicatating the size of the plane based on the extents and resolutions of the image.
-
m_fMaxBox
private float m_fMaxBox
Numbers dicatating the size of the plane based on the extents and resolutions of the image.
-
m_fXRange
private float m_fXRange
Width of the texture-mapped polygon:
-
m_fXTranslate
private float m_fXTranslate
X direction mouse translation.
-
m_fY0
private float m_fY0
lower y-bound of the texture-mapped polygon:
-
m_fY1
private float m_fY1
upper y-bound of the texture-mapped polygon:
-
m_fYRange
private float m_fYRange
Height of the texture-mapped polygon:
-
m_fYTranslate
private float m_fYTranslate
Y direction mouse translatioin.
-
m_fZoomScale
private float m_fZoomScale
Image scaling from Zoom:.
-
m_iPlaneOrientation
private int m_iPlaneOrientation
Which dimension of the ModelImage to render.
-
m_iSlice
private int m_iSlice
Which slice is currently displayed in the XY plane.
-
m_kActiveImage
private ModelImage m_kActiveImage
Current active image for manipulating the LUT by dragging with the right-mouse down.
-
m_kCanvas
private VolumeCanvas3D m_kCanvas
The Canvas3D object on which the plane is drawn.
-
m_kCurrentTransform
private javax.media.j3d.Transform3D m_kCurrentTransform
current zoom transformation
-
m_kDisplayedImage
private javax.media.j3d.ImageComponent2D m_kDisplayedImage
The current displayed texture, based on the value of m_iSlice.
-
m_kImageA
private ModelImage m_kImageA
Current image A.
-
m_kImageB
private ModelImage m_kImageB
Current image B.
-
m_kLabelX
private java.lang.String m_kLabelX
x-axis label:
-
m_kLabelY
private java.lang.String m_kLabelY
y-axis label:
-
m_kMouseTranslate
private MouseTranslation m_kMouseTranslate
Mouse translate behavior.
-
m_kMouseZoom
private MouseZoomBehavior m_kMouseZoom
Mouse zoom behavior.
-
m_kObjRootBG
private javax.media.j3d.BranchGroup m_kObjRootBG
The 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_kOrderedGroup
Root order group of the image scene graph.
-
m_kParent
private ViewJFrameVolumeView m_kParent
Reference to the parent frame:.
-
m_kRFA_BranchGroup
private javax.media.j3d.BranchGroup m_kRFA_BranchGroup
Branch group for the RFA indicator point.
-
m_kTextBranchGroup
private javax.media.j3d.BranchGroup m_kTextBranchGroup
Branch group to hold the texture image.
-
m_kTextTransformGroup
private javax.media.j3d.TransformGroup m_kTextTransformGroup
Transform group to hold the texture images.
-
m_kTexture
private javax.media.j3d.Texture2D m_kTexture
The 2D texture for the texture-mapped polygon.
-
m_kTranslationTG
private javax.media.j3d.TransformGroup m_kTranslationTG
Group dictating how the plane is translated.
-
m_kUniverse
private com.sun.j3d.utils.universe.SimpleUniverse m_kUniverse
The SimpleUniverse object which is the parent of everything else in the scene.
-
m_kPatientSlice
private PatientSlice m_kPatientSlice
PatientSlice contains all the Patient Coordinate System view-specific data for rendering this component:
-
m_kWinLevel
private WindowLevel m_kWinLevel
-
-
Constructor Detail
-
PlaneRender
public PlaneRender(ViewJFrameVolumeView kParent, ModelImage kImageA, ModelLUT kLUTa, ModelImage kImageB, ModelLUT kLUTb, java.awt.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 Detail
-
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
public VolumeCanvas3D getCanvas()
Returns the VolumeCanvas3D object.- Returns:
- the volume canvas
-
getImageA
public ModelImage getImageA()
Accessor that returns the reference to image A.- Returns:
- Image A.
-
getImageB
public ModelImage getImageB()
Accessor that returns the reference to image B.- Returns:
- Image B.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener. This function is called when there is a double-click event.- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener- Parameters:
kEvent- the mouse event generated by a mouse clicked
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent kEvent)
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 interfacejava.awt.event.MouseMotionListener- Parameters:
kEvent- the mouse event generated by a mouse drag
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener. This function is called when the mouse enters the active area.- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener- Parameters:
kEvent- the mouse event generated by a mouse entered
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a mouselistener. This function is called when the mouse leaves the active area.- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener- Parameters:
kEvent- the mouse event generated by a mouse exit
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent kEvent)
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 interfacejava.awt.event.MouseMotionListener- Parameters:
kEvent- the event generated by a mouse movement
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent kEvent)
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 interfacejava.awt.event.MouseListener- Parameters:
kEvent- the mouse event generated by a mouse press
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener- Parameters:
kEvent- the mouse event generated by a mouse release
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Sets the background color for the frame and rendered image.- Parameters:
color- RGBA color to use as the background color.
-
setLUTa
public void setLUTa(ModelLUT LUT)
Accessor that sets the LUT for image A.- Parameters:
LUT- The LUT.
-
setLUTb
public void setLUTb(ModelLUT LUT)
Accessor that sets the LUT for image B.- Parameters:
LUT- The LUT.
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
Accessor that sets the RGB lookup table for image A.- Parameters:
RGBT- the new ModelRGB for PatientSlice.imageA
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
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
public void updateLut(ModelLUT LUTa, ModelLUT LUTb)
Causes the data to be redrawn with new LUT values:- Parameters:
LUTa- imageA LUTLUTb- imageB LUT
-
updateRGBTA
public void updateRGBTA(ModelRGB RGBT)
Causes the data to be redrawn with new RGBTA values:- Parameters:
RGBT- imageA ModelRGB
-
updateRGBTB
public void updateRGBTB(ModelRGB RGBT)
Causes the data to be redrawn with new RGBTA values:- Parameters:
RGBT- imageB ModelRGB
-
finalize
protected void finalize() throws java.lang.ThrowableCleans memory.- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable- if there is a problem encountered during memory clean-up
-
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
private void processLeftMouseDrag(java.awt.event.MouseEvent kEvent)
Dragging the mouse with the left-mouse button held down changes the positions of the X and Y cross bars, and 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
private void processRightMouseDrag(java.awt.event.MouseEvent kEvent)
If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)- Parameters:
kEvent- the mouse event generated by a mouse drag
-
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:.
-
-