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) classVolumeRenderer.SceneStateRay 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 ViewJComponentBoxSliceboxSliceXThe frame around the x slice.protected ViewJComponentRenderImagecomponentImageXYComponent holding the texture of the XY plane image.private javax.media.j3d.Transform3DcurrentTransformCurrent transform matrix.private intcurrentTransTypeCurrent transform type.protected int[]extentsExtents of image A, same as xDim, yDim, etc.protected ModelImageimageACurrent image A.protected ModelImageimageBCurrent image B.private booleanisRotateFlag indicating mouse rotation, avoid image disappearing problem.private javax.media.j3d.AppearancekDefaultAppearanceOriginal Appearance obj of the ImageComponent2D texture.private javax.media.j3d.Shape3DkShapeShape object of the volume renderer.protected JPanelLightslightControllight control panel.private booleanm_bMouseListenFlag to turn mouseListener on or off.private booleanm_bTestFrameRateprotected doublem_dAccumulatedTimeFramerate Performance parameters:protected doublem_dFrameRateFramerate Performance parameters:protected doublem_dLastTimeFramerate Performance parameters:protected intm_iAccumulatedFrameCountFramerate Performance parameters:protected intm_iFrameCountFramerate Performance parameters:protected intm_iMaxTimerFramerate Performance parameters:protected intm_iTimerFramerate Performance parameters:private java.awt.image.BufferedImagem_kImageBuffer image for the volume renderer.private javax.media.j3d.ImageComponent2Dm_kImageComponentImage component 2D to hold the volume renderer properties.private SoftwareLightSetm_kSoftwareLightSetSet of lights to use for software-based lighting.private SoftwareMaterialm_kSoftwareMaterialMaterial properties to use for software-based lighting.private javax.media.j3d.Texture2Dm_kTextureXY2D texture of the volume renderer.private floatmaxBoxNumbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected intmaxRenExtentmax Extent of X, Y dimensions.private com.sun.j3d.utils.behaviors.mouse.MouseRotatemouseBehaviorRotateMouse rotate behavior.private com.sun.j3d.utils.behaviors.mouse.MouseTranslatemouseBehaviorTranslateMouse translate behavior.private com.sun.j3d.utils.behaviors.mouse.MouseZoommouseBehaviorZoomMouse zoom behavior.private booleanmouseReleasedFlag to indicate whether the mouseReleased event triggered or not.private javax.media.j3d.BranchGroupobjBoxSliceXParent of the x slice.private javax.media.j3d.TransformGroupobjTransSliceXMember 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.TransformGroupobjTransXYGroup dictating how the XY plane is translated.private javax.media.j3d.BranchGroupobjXYPlaneParent of the XY plane image.protected JPanelRendererBaseoptionsPanelDialog to turn bounding box of surface renderer on and off, and to change the color of the frame.private booleanparallelRotationParallel rotation flag.protected ViewJProgressBarpBarActual bar which fills with color as the percentage of completion increases.protected int[]pixBufferA_XYBuffer that holds image A pixel data for the XY plane, used to build displayable image.protected int[]pixBufferB_XYBuffer that holds image B pixel data for the XY plane, used to build displayable image.private float[]resolsResolutions of image A.private static longserialVersionUIDUse serialVersionUID for interoperability.private javax.media.j3d.BranchGroupshapeBGDOCUMENT ME!private javax.media.j3d.BranchGroupshapeSliceBGDOCUMENT ME!protected javax.swing.JSlidersliderTSliders for the image planes.protected SurfaceRendersurfaceRenderSurface renderer reference.protected inttDimDimensions of image A.protected javax.swing.JTextFieldtextTText fields that display the slice number next to the sliders.protected inttSliceWhich time slice is currently displayed.private int[]unitsUnits of measure of imageA.private booleanupdateWinlevelUpdate the window level flag, call by the plane renderer.private floatxBoxNumbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected intxDimDimensions of image A.private floatyBoxNumbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected intyDimDimensions of image A.private floatzBoxNumbers dicatating the sizes of the planes based on the extents and resolutions of the image.protected intzDimDimensions of image A.protected intzSliceWhich 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 voidactionPerformed(java.awt.event.ActionEvent event)Calls various methods depending on the action.voidautoCapture()Override the parent autoCapture method to capture MIP image volume.voidclose()Closes the frame.voidCMPMode()Invoke the composite rendering mode.private voidconfigureFrame()Constructs main frame structures for 3 image planes.private voidcreateImageSceneGraph()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 voidcreateTexturedImage()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.voiddisposeLocal(boolean flag)Clean memory.voidDRRMode()Invoke the DRR rendering mode.protected voidfinalize()Cleans memory.JPanelCameragetCameraControl()Get the camera control panel.ViewJComponentRenderImagegetComponentImageXY()Accessor that returns the reference to componentImageXY.int[]getExtents()Query information which describes the bounds of the volume.javax.vecmath.Point3fgetEyePoint()Return access to the current eye point in world coordinates.ModelImagegetImageA()Accessor that returns the reference to image A.ModelImagegetImageB()Accessor that returns the reference to image B.javax.media.j3d.ImageComponent2DgetImageComponent()Accessor that returns the reference to m_kImageComponent.JPanelLightsgetLightControlPanel()Get the light control panel.intgetMaxRenExtent()DOCUMENT ME!javax.media.j3d.TransformGroupgetObjTransXY()Accessor that returns the reference to objTransXY.javax.swing.JPanelgetOptions()Get the view control panel.JPanelRendererBasegetOptionsPanel()Get the option control panel.booleangetParallel()Change the camera model.intgetRenderMode()Change the camera model.java.lang.ObjectgetSceneState()Gets the current scene state, in terms of what numbers the slices are on and whether or not they are visible.intgetSpaceSize()Get the ray trace space size.intgetStepSize()Get the ray trace step size.booleanGetTestFrameRate()JPanelVolumeOpacitygetVolOpacity()Get the opacity histrogram control panel.protected voidinit(ViewJProgressBar _pBar, VolumeCanvas3D canvas)Initialize the renderer.protected voidMeasureTime()Measure timevoidMIPMode()Invoke the mip rendering mode.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.voidprocessMouseReleased(java.awt.event.MouseEvent kEvent)When a mouse button is released, the application is finishing a drag operation to rotate the virtual track ball.voidresetAxisX()Override the parent resetImage method to update image volume in the MIP volume renderer.voidresetAxisY()Override the parent resetImage method to update image volume in the MIP volume renderer.voidresetImage()Override the parent resetImage method to update image volume in the MIP volume renderer.voidResetTime()Resets timevoidrotateImage()Override the parent rotateImage method to rotate the MIP image volume.voidsetActiveImage(int image)Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.voidsetAlphaBlend(int value)Sets the alpha blending of parameter for two image displays.Do I need this ??voidsetBackgroundColor(java.awt.Color color)Sets the background color for the frame and rendered image.voidsetEnabled(boolean flag)Controls whether or not the images/VOIs of the frame can be modified.voidsetEnableMouseBehaviors(boolean bEnable)set the MouseBehavior enabled states. this is used to turn on and off the mouse behaviorvoidsetGUI(java.lang.Object scene)Sets the GUI components to their proper state before the action is dispatched from the player.voidsetLUTa(ModelLUT LUT)Accessor that sets the LUT for image A.voidsetLUTb(ModelLUT LUT)Accessor that sets the LUT for image B.voidsetMaterialShininess(float value)Set the texture material shininess value.voidsetMaxRenExtent(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.voidsetParallel(boolean bParallel)Change the camera model.voidsetParallelRotation(boolean flag)Set the parallel rotation flag from the viewJFrameVolumeView.voidsetRenderMode(int renderMode)Change the camera model.voidsetRGBTA(ModelRGB RGBT)Sets the RGB table for image A.voidsetRGBTB(ModelRGB RGBT)Sets the RGB table for image B.voidsetRotationAngle(int value)Set the rotation angle for the camera control.voidsetRotationAxis(int axis)Set the rotation axis for the camera control.voidsetSceneState(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.voidsetSelectedLight(int iLight)Set the light for the given light index.voidsetSlice(int slice)Does nothing but must instantiate for this to be a subclass of ViewJFrameBase.voidsetSpaceSize(int spaceSize)Get the ray trace space size.voidsetStepSize(int stepSize)Change the camera model.voidSetTestFrameRate(boolean bTest)voidsetTimeSlice(int slice)Sets the time slice to be displayed and changes the image planes displayed.voidsetWindlevelUpdate(boolean flag)Set the update win-level flag from the plane render mouse drag, release events.abstract voidstateChanged(javax.swing.event.ChangeEvent e)Sets how the image plane should be displayed depending on value of slider.voidSURFASTMode()Invoke the SURFACEFAST rendering mode.voidSURMode()Invoke the SURFACE rendering mode.voidtransformChanged(int type, javax.media.j3d.Transform3D transform)Tells the mouse dialog that the transform has changed.voidtransformUpdate(int type, javax.media.j3d.Transform3D transform)Tells the mouse dialog that the transform has changed.protected voidUpdateFrameCount()Update frame countbooleanupdateImage()This methods calls the componentImage's update method to redraw the screen.booleanupdateImageExtents()This methods calls the componentImage's REPAINT method to redraw the screen.booleanupdateImages()This methods calls the componentImage's update method to redraw the screen - fastest of the three update methods.booleanupdateImages(boolean forceShow)This methods calls the componentImage's update method to redraw the screen.booleanupdateImages(ModelLUT LUTa, ModelLUT LUTb, boolean forceShow, int interpMode)This methods calls the componentImage's update method to redraw the screen.voidupdateLighting()Setup the specified set of lights to use for rendering.voidupdateScale(javax.media.j3d.Transform3D transform)Called by the volume surface render to update the mouse zoom transform.voidupdateTranslate(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:
stateChangedin 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:
actionPerformedin 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:
autoCapturein 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:
getImageAin classRenderViewBase- Returns:
- Image A.
-
getImageB
public ModelImage getImageB()
Accessor that returns the reference to image B.- Overrides:
getImageBin 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:
getSceneStatein 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:
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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- 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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- 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 member only exists to satisfy the conditions of being a MouseListener. It does nothing when invoked.- 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 member only exists to satisfy the conditions of being a MouseMotionListener. It does nothing when invoked.- 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. 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:
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
-
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:
resetAxisXin classRenderViewBase
-
resetAxisY
public void resetAxisY()
Override the parent resetImage method to update image volume in the MIP volume renderer.- Overrides:
resetAxisYin classRenderViewBase
-
resetImage
public void resetImage()
Override the parent resetImage method to update image volume in the MIP volume renderer.- Overrides:
resetImagein 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:
rotateImagein 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:
setAlphaBlendin 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:
setBackgroundColorin 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:
setEnabledin classjava.awt.Component- Parameters:
flag- Iftruethe image/VOIs can be modified; iffalseimage/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:
setGUIin 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-trueset all the renderer to parallel rotation,falseparallel 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:
setRGBTAin classRenderViewBase- Parameters:
RGBT- New RGB table for image A.
-
setRGBTB
public void setRGBTB(ModelRGB RGBT)
Sets the RGB table for image B.- Specified by:
setRGBTBin classRenderViewBase- Parameters:
RGBT- New RGB table for image B.
-
setRotationAngle
public void setRotationAngle(int value)
Set the rotation angle for the camera control.- Overrides:
setRotationAnglein classRenderViewBase- Parameters:
value- rotation angle
-
setRotationAxis
public void setRotationAxis(int axis)
Set the rotation axis for the camera control.- Overrides:
setRotationAxisin 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:
setSlicein 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:
setTimeSlicein 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:
transformChangedin 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:
updateImageExtentsin 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:
updateImagesin 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:
updateImagesin 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:
updateImagesin 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.ThrowableCleans memory.- Overrides:
finalizein 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:
ResetTimein classVolumeCanvas3D
-
MeasureTime
protected void MeasureTime()
Measure time- Overrides:
MeasureTimein classVolumeCanvas3D
-
UpdateFrameCount
protected void UpdateFrameCount()
Update frame count- Overrides:
UpdateFrameCountin classVolumeCanvas3D
-
SetTestFrameRate
public void SetTestFrameRate(boolean bTest)
- Overrides:
SetTestFrameRatein classVolumeCanvas3D
-
GetTestFrameRate
public boolean GetTestFrameRate()
- Overrides:
GetTestFrameRatein classVolumeCanvas3D
-
-