Class VolumeRenderer
- 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.RenderViewBase
-
- gov.nih.mipav.view.renderer.J3D.volumeview.VolumeRenderer
-
- All Implemented Interfaces:
com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback
,ViewImageUpdateInterface
,java.awt.event.ActionListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.event.ChangeListener
- Direct Known Subclasses:
VolumeRendererRayCast
,VolumeRendererShearWarp
public abstract class VolumeRenderer extends RenderViewBase implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener
Common interface for all volume renderers. Code common to the RayCastVolumeRender and ShearWarpVolumeRender classes was factored into this, the parent class on 11/14/04.- Author:
- Matthew J. McAuliffe, Ph.D.
- See Also:
ViewJFrameSurface
, Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
VolumeRenderer.SceneState
Ray cast Scene State.-
Nested classes/interfaces inherited from class gov.nih.mipav.view.renderer.J3D.RenderViewBase
RenderViewBase.Matrix
-
-
Field Summary
Fields Modifier and Type Field Description private ViewJComponentBoxSlice
boxSliceX
The frame around the x slice.protected ViewJComponentRenderImage
componentImageXY
Component holding the texture of the XY plane image.private javax.media.j3d.Transform3D
currentTransform
Current transform matrix.private int
currentTransType
Current transform type.protected int[]
extents
Extents of image A, same as xDim, yDim, etc.protected ModelImage
imageA
Current image A.protected ModelImage
imageB
Current image B.private boolean
isRotate
Flag indicating mouse rotation, avoid image disappearing problem.private javax.media.j3d.Appearance
kDefaultAppearance
Original Appearance obj of the ImageComponent2D texture.private javax.media.j3d.Shape3D
kShape
Shape object of the volume renderer.protected JPanelLights
lightControl
light control panel.private boolean
m_bMouseListen
Flag to turn mouseListener on or off.private boolean
m_bTestFrameRate
protected double
m_dAccumulatedTime
Framerate Performance parameters:protected double
m_dFrameRate
Framerate Performance parameters:protected double
m_dLastTime
Framerate Performance parameters:protected int
m_iAccumulatedFrameCount
Framerate Performance parameters:protected int
m_iFrameCount
Framerate Performance parameters:protected int
m_iMaxTimer
Framerate Performance parameters:protected int
m_iTimer
Framerate Performance parameters:private java.awt.image.BufferedImage
m_kImage
Buffer image for the volume renderer.private javax.media.j3d.ImageComponent2D
m_kImageComponent
Image component 2D to hold the volume renderer properties.private SoftwareLightSet
m_kSoftwareLightSet
Set of lights to use for software-based lighting.private SoftwareMaterial
m_kSoftwareMaterial
Material properties to use for software-based lighting.private javax.media.j3d.Texture2D
m_kTextureXY
2D texture of the volume renderer.private float
maxBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected int
maxRenExtent
max Extent of X, Y dimensions.private com.sun.j3d.utils.behaviors.mouse.MouseRotate
mouseBehaviorRotate
Mouse rotate behavior.private com.sun.j3d.utils.behaviors.mouse.MouseTranslate
mouseBehaviorTranslate
Mouse translate behavior.private com.sun.j3d.utils.behaviors.mouse.MouseZoom
mouseBehaviorZoom
Mouse zoom behavior.private boolean
mouseReleased
Flag to indicate whether the mouseReleased event triggered or not.private javax.media.j3d.BranchGroup
objBoxSliceX
Parent of the x slice.private javax.media.j3d.TransformGroup
objTransSliceX
Member variables used to display the rendered image on the texture-mapped polygon, stored so that they can be updated as the render target image size is changed by the user-interface:.private javax.media.j3d.TransformGroup
objTransXY
Group dictating how the XY plane is translated.private javax.media.j3d.BranchGroup
objXYPlane
Parent of the XY plane image.protected JPanelRendererBase
optionsPanel
Dialog to turn bounding box of surface renderer on and off, and to change the color of the frame.private boolean
parallelRotation
Parallel rotation flag.protected ViewJProgressBar
pBar
Actual bar which fills with color as the percentage of completion increases.protected int[]
pixBufferA_XY
Buffer that holds image A pixel data for the XY plane, used to build displayable image.protected int[]
pixBufferB_XY
Buffer that holds image B pixel data for the XY plane, used to build displayable image.private float[]
resols
Resolutions of image A.private static long
serialVersionUID
Use serialVersionUID for interoperability.private javax.media.j3d.BranchGroup
shapeBG
DOCUMENT ME!private javax.media.j3d.BranchGroup
shapeSliceBG
DOCUMENT ME!protected javax.swing.JSlider
sliderT
Sliders for the image planes.protected SurfaceRender
surfaceRender
Surface renderer reference.protected int
tDim
Dimensions of image A.protected javax.swing.JTextField
textT
Text fields that display the slice number next to the sliders.protected int
tSlice
Which time slice is currently displayed.private int[]
units
Units of measure of imageA.private boolean
updateWinlevel
Update the window level flag, call by the plane renderer.private float
xBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected int
xDim
Dimensions of image A.private float
yBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected int
yDim
Dimensions of image A.private float
zBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected int
zDim
Dimensions of image A.protected int
zSlice
Which slice is currently displayed in the XY plane.-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.RenderViewBase
background, bounds, boxFrame, canvas, captureFrame, captureImage, config, displayMode, IMAGE_A, IMAGE_B, LUTa, LUTb, objBehaviorBG, objBoxFrameBG, objRootBG, rotationAngle, rotationAxis, rotationControlPanel, rotationTimes, rotationTotal, sceneRootTG, sliderEvents, transRotation, transRotationMatrix, triPlanarViewBG, universe, viewPanel
-
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description VolumeRenderer(ModelImage _imageA, ModelImage _imageB, java.awt.GraphicsConfiguration _config)
Creates a new VolumeRenderer object.VolumeRenderer(ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, SurfaceRender surfaceRender, java.awt.GraphicsConfiguration _config, ViewJProgressBar _pBar)
Makes a frame and puts the three image planes into it.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent event)
Calls various methods depending on the action.void
autoCapture()
Override the parent autoCapture method to capture MIP image volume.void
close()
Closes the frame.void
CMPMode()
Invoke the composite rendering mode.private void
configureFrame()
Constructs main frame structures for 3 image planes.private void
createImageSceneGraph()
Creates the scene graph, made up of a branch group parent, a transform group under that which applies mouse behavior and lights to the scene, and three branch groups under the transform group for each of the three image planes.private void
createTexturedImage()
createTexturedImage is added so that the size of the texture used to display the rendered image on the texture-mapped polygon can be changed dynamically.void
disposeLocal(boolean flag)
Clean memory.void
DRRMode()
Invoke the DRR rendering mode.protected void
finalize()
Cleans memory.JPanelCamera
getCameraControl()
Get the camera control panel.ViewJComponentRenderImage
getComponentImageXY()
Accessor that returns the reference to componentImageXY.int[]
getExtents()
Query information which describes the bounds of the volume.javax.vecmath.Point3f
getEyePoint()
Return access to the current eye point in world coordinates.ModelImage
getImageA()
Accessor that returns the reference to image A.ModelImage
getImageB()
Accessor that returns the reference to image B.javax.media.j3d.ImageComponent2D
getImageComponent()
Accessor that returns the reference to m_kImageComponent.JPanelLights
getLightControlPanel()
Get the light control panel.int
getMaxRenExtent()
DOCUMENT ME!javax.media.j3d.TransformGroup
getObjTransXY()
Accessor that returns the reference to objTransXY.javax.swing.JPanel
getOptions()
Get the view control panel.JPanelRendererBase
getOptionsPanel()
Get the option control panel.boolean
getParallel()
Change the camera model.int
getRenderMode()
Change the camera model.java.lang.Object
getSceneState()
Gets the current scene state, in terms of what numbers the slices are on and whether or not they are visible.int
getSpaceSize()
Get the ray trace space size.int
getStepSize()
Get the ray trace step size.boolean
GetTestFrameRate()
JPanelVolumeOpacity
getVolOpacity()
Get the opacity histrogram control panel.protected void
init(ViewJProgressBar _pBar, VolumeCanvas3D canvas)
Initialize the renderer.protected void
MeasureTime()
Measure timevoid
MIPMode()
Invoke the mip rendering mode.void
mouseClicked(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
mouseDragged(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
mouseEntered(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
mouseExited(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
mouseMoved(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseMotionListener.void
mousePressed(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
mouseReleased(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener.void
processMouseReleased(java.awt.event.MouseEvent kEvent)
When a mouse button is released, the application is finishing a drag operation to rotate the virtual track ball.void
resetAxisX()
Override the parent resetImage method to update image volume in the MIP volume renderer.void
resetAxisY()
Override the parent resetImage method to update image volume in the MIP volume renderer.void
resetImage()
Override the parent resetImage method to update image volume in the MIP volume renderer.void
ResetTime()
Resets timevoid
rotateImage()
Override the parent rotateImage method to rotate the MIP image volume.void
setActiveImage(int image)
Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.void
setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displays.Do I need this ??void
setBackgroundColor(java.awt.Color color)
Sets the background color for the frame and rendered image.void
setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.void
setEnableMouseBehaviors(boolean bEnable)
set the MouseBehavior enabled states. this is used to turn on and off the mouse behaviorvoid
setGUI(java.lang.Object scene)
Sets the GUI components to their proper state before the action is dispatched from the player.void
setLUTa(ModelLUT LUT)
Accessor that sets the LUT for image A.void
setLUTb(ModelLUT LUT)
Accessor that sets the LUT for image B.void
setMaterialShininess(float value)
Set the texture material shininess value.void
setMaxRenExtent(int iExtent)
setMaxRenExtent changes the render target image by changing the pixBufferA_XY size and by changing the render target image of the componentImageXY member variable. createTexturedImage (local) is called to reinitialize the size of the texture displayed on the texture-mapped polygon.void
setParallel(boolean bParallel)
Change the camera model.void
setParallelRotation(boolean flag)
Set the parallel rotation flag from the viewJFrameVolumeView.void
setRenderMode(int renderMode)
Change the camera model.void
setRGBTA(ModelRGB RGBT)
Sets the RGB table for image A.void
setRGBTB(ModelRGB RGBT)
Sets the RGB table for image B.void
setRotationAngle(int value)
Set the rotation angle for the camera control.void
setRotationAxis(int axis)
Set the rotation axis for the camera control.void
setSceneState(java.lang.Object scene)
Sets the scene state appropriately, so that the slices that are supposed to be visible are showing, the ones that aren't are hidden, and the sliders are starting at the appropriate value.void
setSelectedLight(int iLight)
Set the light for the given light index.void
setSlice(int slice)
Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.void
setSpaceSize(int spaceSize)
Get the ray trace space size.void
setStepSize(int stepSize)
Change the camera model.void
SetTestFrameRate(boolean bTest)
void
setTimeSlice(int slice)
Sets the time slice to be displayed and changes the image planes displayed.void
setWindlevelUpdate(boolean flag)
Set the update win-level flag from the plane render mouse drag, release events.abstract void
stateChanged(javax.swing.event.ChangeEvent e)
Sets how the image plane should be displayed depending on value of slider.void
SURFASTMode()
Invoke the SURFACEFAST rendering mode.void
SURMode()
Invoke the SURFACE rendering mode.void
transformChanged(int type, javax.media.j3d.Transform3D transform)
Tells the mouse dialog that the transform has changed.void
transformUpdate(int type, javax.media.j3d.Transform3D transform)
Tells the mouse dialog that the transform has changed.protected void
UpdateFrameCount()
Update frame countboolean
updateImage()
This methods calls the componentImage's update method to redraw the screen.boolean
updateImageExtents()
This methods calls the componentImage's REPAINT method to redraw the screen.boolean
updateImages()
This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.boolean
updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen.boolean
updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.void
updateLighting()
Setup the specified set of lights to use for rendering.void
updateScale(javax.media.j3d.Transform3D transform)
Called by the volume surface render to update the mouse zoom transform.void
updateTranslate(javax.media.j3d.Transform3D transform)
Called by the surface volume render to update the tranlation behavior.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.RenderViewBase
calcImageNormals, createBoxFrame, disableCamera, disposeLocal, getBehaviorGroup, getBound, getBranchGroup, getCanvas, getNormals, getRGBTA, getRGBTB, getSceneRootTG, getSliderEvents, getTriPlanarViewBG, getUniverse, recordMouse, setBoxColor, writeImage, writeImageAuto
-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.VolumeCanvas3D
paint, postSwap, supportsTexture3D, update
-
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, 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
-
componentImageXY
protected ViewJComponentRenderImage componentImageXY
Component holding the texture of the XY plane image.
-
extents
protected int[] extents
Extents of image A, same as xDim, yDim, etc.
-
imageA
protected ModelImage imageA
Current image A.
-
imageB
protected ModelImage imageB
Current image B.
-
lightControl
protected JPanelLights lightControl
light control panel.
-
maxRenExtent
protected int maxRenExtent
max Extent of X, Y dimensions.
-
optionsPanel
protected JPanelRendererBase optionsPanel
Dialog to turn bounding box of surface renderer on and off, and to change the color of the frame.
-
pBar
protected ViewJProgressBar pBar
Actual bar which fills with color as the percentage of completion increases.
-
pixBufferA_XY
protected int[] pixBufferA_XY
Buffer that holds image A pixel data for the XY plane, used to build displayable image.
-
pixBufferB_XY
protected int[] pixBufferB_XY
Buffer that holds image B pixel data for the XY plane, used to build displayable image.
-
sliderT
protected javax.swing.JSlider sliderT
Sliders for the image planes.
-
surfaceRender
protected SurfaceRender surfaceRender
Surface renderer reference.
-
textT
protected javax.swing.JTextField textT
Text fields that display the slice number next to the sliders.
-
tSlice
protected int tSlice
Which time slice is currently displayed.
-
xDim
protected int xDim
Dimensions of image A.
-
yDim
protected int yDim
Dimensions of image A.
-
zDim
protected int zDim
Dimensions of image A.
-
tDim
protected int tDim
Dimensions of image A.
-
zSlice
protected int zSlice
Which slice is currently displayed in the XY plane.
-
mouseBehaviorRotate
private com.sun.j3d.utils.behaviors.mouse.MouseRotate mouseBehaviorRotate
Mouse rotate behavior.
-
mouseBehaviorTranslate
private com.sun.j3d.utils.behaviors.mouse.MouseTranslate mouseBehaviorTranslate
Mouse translate behavior.
-
mouseBehaviorZoom
private com.sun.j3d.utils.behaviors.mouse.MouseZoom mouseBehaviorZoom
Mouse zoom behavior.
-
boxSliceX
private ViewJComponentBoxSlice boxSliceX
The frame around the x slice.
-
currentTransform
private javax.media.j3d.Transform3D currentTransform
Current transform matrix.
-
currentTransType
private int currentTransType
Current transform type.
-
isRotate
private boolean isRotate
Flag indicating mouse rotation, avoid image disappearing problem.
-
kDefaultAppearance
private javax.media.j3d.Appearance kDefaultAppearance
Original Appearance obj of the ImageComponent2D texture.
-
kShape
private javax.media.j3d.Shape3D kShape
Shape object of the volume renderer.
-
m_bMouseListen
private boolean m_bMouseListen
Flag to turn mouseListener on or off.
-
m_kImage
private java.awt.image.BufferedImage m_kImage
Buffer image for the volume renderer.
-
m_kImageComponent
private javax.media.j3d.ImageComponent2D m_kImageComponent
Image component 2D to hold the volume renderer properties.
-
m_kSoftwareLightSet
private SoftwareLightSet m_kSoftwareLightSet
Set of lights to use for software-based lighting.
-
m_kSoftwareMaterial
private SoftwareMaterial m_kSoftwareMaterial
Material properties to use for software-based lighting.
-
m_kTextureXY
private javax.media.j3d.Texture2D m_kTextureXY
2D texture of the volume renderer.
-
mouseReleased
private boolean mouseReleased
Flag to indicate whether the mouseReleased event triggered or not.
-
objBoxSliceX
private javax.media.j3d.BranchGroup objBoxSliceX
Parent of the x slice.
-
objTransSliceX
private javax.media.j3d.TransformGroup objTransSliceX
Member variables used to display the rendered image on the texture-mapped polygon, stored so that they can be updated as the render target image size is changed by the user-interface:.
-
objTransXY
private javax.media.j3d.TransformGroup objTransXY
Group dictating how the XY plane is translated.
-
objXYPlane
private javax.media.j3d.BranchGroup objXYPlane
Parent of the XY plane image.
-
parallelRotation
private boolean parallelRotation
Parallel rotation flag.
-
resols
private float[] resols
Resolutions of image A.
-
shapeBG
private javax.media.j3d.BranchGroup shapeBG
DOCUMENT ME!
-
shapeSliceBG
private javax.media.j3d.BranchGroup shapeSliceBG
DOCUMENT ME!
-
units
private int[] units
Units of measure of imageA.
-
updateWinlevel
private boolean updateWinlevel
Update the window level flag, call by the plane renderer.
-
xBox
private float xBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.
-
yBox
private float yBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.
-
zBox
private float zBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.
-
maxBox
private float maxBox
Numbers dicatating the sizes of the planes based on the extents and resolutions of the image.
-
m_bTestFrameRate
private boolean m_bTestFrameRate
-
m_dLastTime
protected double m_dLastTime
Framerate Performance parameters:
-
m_dAccumulatedTime
protected double m_dAccumulatedTime
Framerate Performance parameters:
-
m_dFrameRate
protected double m_dFrameRate
Framerate Performance parameters:
-
m_iFrameCount
protected int m_iFrameCount
Framerate Performance parameters:
-
m_iAccumulatedFrameCount
protected int m_iAccumulatedFrameCount
Framerate Performance parameters:
-
m_iTimer
protected int m_iTimer
Framerate Performance parameters:
-
m_iMaxTimer
protected int m_iMaxTimer
Framerate Performance parameters:
-
-
Constructor Detail
-
VolumeRenderer
public VolumeRenderer(ModelImage _imageA, ModelImage _imageB, java.awt.GraphicsConfiguration _config)
Creates a new VolumeRenderer object.- Parameters:
_imageA
- First image to display, cannot be null._imageB
- Second loaded image, may be null._config
- Graphics configuration reference.
-
VolumeRenderer
public VolumeRenderer(ModelImage _imageA, ModelLUT _LUTa, ModelImage _imageB, ModelLUT _LUTb, SurfaceRender surfaceRender, java.awt.GraphicsConfiguration _config, ViewJProgressBar _pBar)
Makes a frame and puts the three image planes into it. Creates the scene graph which dictates the behavior of the image planes and surfaces. Initializes the surface dialog and the mouse recorder dialog, so that this original view is saved. When the user opens these dialogs, they have already been created; they are just set to visible.- Parameters:
_imageA
- First image to display, cannot be null._LUTa
- LUT of the imageA (if null grayscale LUT is constructed)._imageB
- Second loaded image, may be null._LUTb
- LUT of the imageB, may be null.surfaceRender
- Surface render reference._config
- Graphics configuration reference._pBar
- Build volume render progress bar reference.
-
-
Method Detail
-
stateChanged
public abstract void stateChanged(javax.swing.event.ChangeEvent e)
Sets how the image plane should be displayed depending on value of slider.- Specified by:
stateChanged
in interfacejavax.swing.event.ChangeListener
- Parameters:
e
- Event that triggered this function.
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent event)
Calls various methods depending on the action.- Surface - opens the surface dialog
- View - opens the view control dialog
- Mouse - opens the mouse recorder dialog
- About - displays a message about this renderer
- MIPmode - MIP rendering mode
- DDRmode - DDR rendering mode
- CMPmode - CMP rendering mode
- SURmode - SUR rendering mode
- Exit - sets variables to null and disposes of this frame
- X, Y, Z checkboxes - toggles the appropriate image planes on or off
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
- Parameters:
event
- Event that triggered function.
-
autoCapture
public void autoCapture()
Override the parent autoCapture method to capture MIP image volume.- Overrides:
autoCapture
in classRenderViewBase
-
close
public void close()
Closes the frame.
-
CMPMode
public void CMPMode()
Invoke the composite rendering mode.
-
disposeLocal
public void disposeLocal(boolean flag)
Clean memory.- Parameters:
flag
- is true call the super.disposeLocal
-
DRRMode
public void DRRMode()
Invoke the DRR rendering mode.
-
getCameraControl
public JPanelCamera getCameraControl()
Get the camera control panel.- Returns:
- JPanelCamera camera control panel
-
getComponentImageXY
public ViewJComponentRenderImage getComponentImageXY()
Accessor that returns the reference to componentImageXY.- Returns:
- DOCUMENT ME!
-
getExtents
public int[] getExtents()
Query information which describes the bounds of the volume.- Returns:
- int[] Array of three values containing the X, Y, and Z dimensions respectively.
-
getEyePoint
public javax.vecmath.Point3f getEyePoint()
Return access to the current eye point in world coordinates.- Returns:
- Point3f current eye point in world coordinates.
-
getImageA
public ModelImage getImageA()
Accessor that returns the reference to image A.- Overrides:
getImageA
in classRenderViewBase
- Returns:
- Image A.
-
getImageB
public ModelImage getImageB()
Accessor that returns the reference to image B.- Overrides:
getImageB
in classRenderViewBase
- Returns:
- Image B.
-
getImageComponent
public javax.media.j3d.ImageComponent2D getImageComponent()
Accessor that returns the reference to m_kImageComponent.- Returns:
- DOCUMENT ME!
-
getLightControlPanel
public JPanelLights getLightControlPanel()
Get the light control panel.- Returns:
- JPanel the light control panel
-
getMaxRenExtent
public int getMaxRenExtent()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getObjTransXY
public javax.media.j3d.TransformGroup getObjTransXY()
Accessor that returns the reference to objTransXY.- Returns:
- DOCUMENT ME!
-
getOptions
public javax.swing.JPanel getOptions()
Get the view control panel.- Returns:
- JPanel view control panel
-
getOptionsPanel
public JPanelRendererBase getOptionsPanel()
Get the option control panel.- Returns:
- optionsPanel JPanelShearWarpRenderOptions options panel
-
getParallel
public boolean getParallel()
Change the camera model.- Returns:
- bParallel true for a parallel camera, false for a perspective camera
-
getRenderMode
public int getRenderMode()
Change the camera model.- Returns:
- renderMode MIP, DDR, SUR
-
getSceneState
public java.lang.Object getSceneState()
Gets the current scene state, in terms of what numbers the slices are on and whether or not they are visible.- Specified by:
getSceneState
in classRenderViewBase
- Returns:
- A SceneState object with the variables set appropriately.
-
getSpaceSize
public int getSpaceSize()
Get the ray trace space size.- Returns:
- componentImageXY.getSpaceSize() space size
-
getStepSize
public int getStepSize()
Get the ray trace step size.- Returns:
- componentImageXY.getStepSize() step size
-
getVolOpacity
public JPanelVolumeOpacity getVolOpacity()
Get the opacity histrogram control panel.- Returns:
- JPanelVolOpacity Opacity panel
-
MIPMode
public void MIPMode()
Invoke the mip rendering mode.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent kEvent)
One of the overrides necessary to be a MouseListener. This member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseClicked
in 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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseDragged
in 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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseEntered
in 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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- Specified by:
mouseExited
in 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 member only exists to satisfy the conditions of being a MouseMotionListener. It does nothing when invoked.- Specified by:
mouseMoved
in 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. When a mouse button is pressed, the application is starting a drag operation to rotate the virtual track ball. The initial mouse location is recorded for use by 'moveTrackBall', stored as a point (x0,y0) in [-1,1]^2.- Specified by:
mousePressed
in 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:
mouseReleased
in interfacejava.awt.event.MouseListener
- Parameters:
kEvent
- the mouse event generated by a mouse release
-
processMouseReleased
public void processMouseReleased(java.awt.event.MouseEvent kEvent)
When a mouse button is released, the application is finishing a drag operation to rotate the virtual track ball. The final mouse location is recorded for use by 'moveTrackBall', stored as a point (x1,y1) in [-1,1]^2. The virtual track ball is moved into its final position and a ray trace is performed at highest resolution.- Parameters:
kEvent
- the mouse event generated by a mouse release
-
resetAxisX
public void resetAxisX()
Override the parent resetImage method to update image volume in the MIP volume renderer.- Overrides:
resetAxisX
in classRenderViewBase
-
resetAxisY
public void resetAxisY()
Override the parent resetImage method to update image volume in the MIP volume renderer.- Overrides:
resetAxisY
in classRenderViewBase
-
resetImage
public void resetImage()
Override the parent resetImage method to update image volume in the MIP volume renderer.- Overrides:
resetImage
in classRenderViewBase
-
rotateImage
public void rotateImage()
Override the parent rotateImage method to rotate the MIP image volume. This method manully rotate the image volume during the camera snapshooting.- Overrides:
rotateImage
in classRenderViewBase
-
setActiveImage
public void setActiveImage(int image)
Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.- Parameters:
image
- DOCUMENT ME!
-
setAlphaBlend
public void setAlphaBlend(int value)
Sets the alpha blending of parameter for two image displays.Do I need this ??- Specified by:
setAlphaBlend
in classRenderViewBase
- Parameters:
value
- Amount [0,100] that is the percentage of Image A to be displayed.
-
setBackgroundColor
public void setBackgroundColor(java.awt.Color color)
Sets the background color for the frame and rendered image.- Overrides:
setBackgroundColor
in classRenderViewBase
- Parameters:
color
- Color RGBA color to use as the background color.
-
setEnabled
public void setEnabled(boolean flag)
Controls whether or not the images/VOIs of the frame can be modified.- Overrides:
setEnabled
in classjava.awt.Component
- Parameters:
flag
- Iftrue
the image/VOIs can be modified; iffalse
image/VOIs can NOT be modified.
-
setEnableMouseBehaviors
public void setEnableMouseBehaviors(boolean bEnable)
set the MouseBehavior enabled states. this is used to turn on and off the mouse behavior- Parameters:
bEnable
- boolean bEnable to turn mouseListening on or off.
-
setGUI
public void setGUI(java.lang.Object scene)
Sets the GUI components to their proper state before the action is dispatched from the player.- Specified by:
setGUI
in classRenderViewBase
- Parameters:
scene
- The state of the scene.
-
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
-
setMaterialShininess
public void setMaterialShininess(float value)
Set the texture material shininess value.- Parameters:
value
- shininess value.
-
setMaxRenExtent
public void setMaxRenExtent(int iExtent)
setMaxRenExtent changes the render target image by changing the pixBufferA_XY size and by changing the render target image of the componentImageXY member variable. createTexturedImage (local) is called to reinitialize the size of the texture displayed on the texture-mapped polygon.- Parameters:
iExtent
- DOCUMENT ME!
-
setParallel
public void setParallel(boolean bParallel)
Change the camera model.- Parameters:
bParallel
- true for a parallel camera, false for a perspective camera
-
setParallelRotation
public void setParallelRotation(boolean flag)
Set the parallel rotation flag from the viewJFrameVolumeView.- Parameters:
flag
-true
set all the renderer to parallel rotation,false
parallel rotation mode off.
-
setRenderMode
public void setRenderMode(int renderMode)
Change the camera model.- Parameters:
renderMode
- MIP, DDR, SUR
-
setRGBTA
public void setRGBTA(ModelRGB RGBT)
Sets the RGB table for image A.- Specified by:
setRGBTA
in classRenderViewBase
- Parameters:
RGBT
- New RGB table for image A.
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
Sets the RGB table for image B.- Specified by:
setRGBTB
in classRenderViewBase
- Parameters:
RGBT
- New RGB table for image B.
-
setRotationAngle
public void setRotationAngle(int value)
Set the rotation angle for the camera control.- Overrides:
setRotationAngle
in classRenderViewBase
- Parameters:
value
- rotation angle
-
setRotationAxis
public void setRotationAxis(int axis)
Set the rotation axis for the camera control.- Overrides:
setRotationAxis
in classRenderViewBase
- Parameters:
axis
- rotation axis
-
setSceneState
public void setSceneState(java.lang.Object scene)
Sets the scene state appropriately, so that the slices that are supposed to be visible are showing, the ones that aren't are hidden, and the sliders are starting at the appropriate value.- Parameters:
scene
- The state of the scene.
-
setSelectedLight
public void setSelectedLight(int iLight)
Set the light for the given light index.- Parameters:
iLight
- int
-
setSlice
public void setSlice(int slice)
Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.- Specified by:
setSlice
in interfaceViewImageUpdateInterface
- Parameters:
slice
- DOCUMENT ME!
-
setSpaceSize
public void setSpaceSize(int spaceSize)
Get the ray trace space size.- Parameters:
spaceSize
- Raytracing region space size.
-
setStepSize
public void setStepSize(int stepSize)
Change the camera model.- Parameters:
stepSize
- RayTracint step size.
-
setTimeSlice
public void setTimeSlice(int slice)
Sets the time slice to be displayed and changes the image planes displayed.- Specified by:
setTimeSlice
in interfaceViewImageUpdateInterface
- Parameters:
slice
- Indicates image time-slice (4th dimension) to be displayed.
-
setWindlevelUpdate
public void setWindlevelUpdate(boolean flag)
Set the update win-level flag from the plane render mouse drag, release events.- Parameters:
flag
- true update window level, false not update.
-
SURFASTMode
public void SURFASTMode()
Invoke the SURFACEFAST rendering mode.
-
SURMode
public void SURMode()
Invoke the SURFACE rendering mode.
-
transformChanged
public void transformChanged(int type, javax.media.j3d.Transform3D transform)
Tells the mouse dialog that the transform has changed. Does not use the type parameter.- Specified by:
transformChanged
in interfacecom.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback
- Parameters:
type
- Type of transform.transform
- Transform that was changed to.
-
transformUpdate
public void transformUpdate(int type, javax.media.j3d.Transform3D transform)
Tells the mouse dialog that the transform has changed. Does not use the type parameter.- Parameters:
type
- Type of transform.transform
- Transform that was changed to.
-
updateImage
public boolean updateImage()
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Returns:
- Confirms successful update.
-
updateImageExtents
public boolean updateImageExtents()
This methods calls the componentImage's REPAINT method to redraw the screen. The extents on this image have changed, so the extents need to be read in again and menus, panes and slide bars adjusted accordingly.- Specified by:
updateImageExtents
in interfaceViewImageUpdateInterface
- Returns:
- DOCUMENT ME!
-
updateImages
public final boolean updateImages()
This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Returns:
- Confirms successful update.
-
updateImages
public final boolean updateImages(boolean forceShow)
This methods calls the componentImage's update method to redraw the screen. Without LUT changes.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Parameters:
forceShow
- Forces show to reimport image and calculate java image.- Returns:
- Confirms successful update.
-
updateImages
public final boolean updateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)
This methods calls the componentImage's update method to redraw the screen.- Specified by:
updateImages
in interfaceViewImageUpdateInterface
- Parameters:
LUTa
- LUT used to update imageA.LUTb
- LUT used to update imageB.forceShow
- Forces show to reimport image and calculate java image.interpMode
- Image interpolation method (Nearest or Smooth).- Returns:
- Confirms successful update.
-
updateLighting
public void updateLighting()
Setup the specified set of lights to use for rendering.
-
updateScale
public void updateScale(javax.media.j3d.Transform3D transform)
Called by the volume surface render to update the mouse zoom transform. Set the tranform matrix to scale matrix.- Parameters:
transform
- Zoom transform.
-
updateTranslate
public void updateTranslate(javax.media.j3d.Transform3D transform)
Called by the surface volume render to update the tranlation behavior. Set the transform matrix to translate matrix.- Parameters:
transform
- Translate tranform
-
finalize
protected void finalize() throws java.lang.Throwable
Cleans memory.- Overrides:
finalize
in classjava.lang.Object
- Throws:
java.lang.Throwable
- DOCUMENT ME!
-
init
protected void init(ViewJProgressBar _pBar, VolumeCanvas3D canvas)
Initialize the renderer.- Parameters:
_pBar
- ViewJProgressBarcanvas
- VolumeCanvas3D
-
configureFrame
private void configureFrame()
Constructs main frame structures for 3 image planes. Makes the LUT if necessary, then sets up the buffer arrays appropriately and calls the constructors for the three image planes.
-
createImageSceneGraph
private void createImageSceneGraph()
Creates the scene graph, made up of a branch group parent, a transform group under that which applies mouse behavior and lights to the scene, and three branch groups under the transform group for each of the three image planes. The surfaces that can be added would * be children of the transform group. Each image plane has a transform group associated with it * and beneath that, a box shape where the texture maps are applied. The shape is what is actually * displayed.
-
createTexturedImage
private void createTexturedImage()
createTexturedImage is added so that the size of the texture used to display the rendered image on the texture-mapped polygon can be changed dynamically. Instead of recreating the scene graph, this function re-initializes the texture-size dependent components of the scene graph and can be accessed dynamically through the user-interface.
-
ResetTime
public void ResetTime()
Resets time- Overrides:
ResetTime
in classVolumeCanvas3D
-
MeasureTime
protected void MeasureTime()
Measure time- Overrides:
MeasureTime
in classVolumeCanvas3D
-
UpdateFrameCount
protected void UpdateFrameCount()
Update frame count- Overrides:
UpdateFrameCount
in classVolumeCanvas3D
-
SetTestFrameRate
public void SetTestFrameRate(boolean bTest)
- Overrides:
SetTestFrameRate
in classVolumeCanvas3D
-
GetTestFrameRate
public boolean GetTestFrameRate()
- Overrides:
GetTestFrameRate
in classVolumeCanvas3D
-
-