Class FlythruRender
- 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.surfaceview.SurfaceRender
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.flythruview.FlythruRender
-
- All Implemented Interfaces:
com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback
,FlyThroughRenderInterface
,FlyPathBehavior.Callback
,ViewImageUpdateInterface
,java.awt.event.ActionListener
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.event.ChangeListener
public class FlythruRender extends SurfaceRender implements FlyThroughRenderInterface, FlyPathBehavior.Callback, com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener
Virtual colonoscopy viewer. This class contains the static 'main' method to launch the application. This class is an Applet which means that it can be embedded in a browser or it can be attached to a MainFrame when executed as an application. The Applet contains a Canvas3D used for the 3D rendering of the colon surface data and for using the mouse and keyboard for maneuvering the view of the colon while moving through it.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
FlythruRender.MouseRotateExt
Extend the MouseRotate class so that we can override the processMouseEvent method to ignore any events which occur while the shift key is down.(package private) class
FlythruRender.MouseWheel
Mouse middle button wheel roller event handler.(package private) class
FlythruRender.RightMouse
RightMouse press event handler.(package private) class
FlythruRender.RightMouseDragged
Right mouse button press down and drag event handler.static class
FlythruRender.SetupOptions
DOCUMENT ME!-
Nested classes/interfaces inherited from class gov.nih.mipav.view.renderer.J3D.RenderViewBase
RenderViewBase.Matrix
-
-
Field Summary
Fields Modifier and Type Field Description (package private) short[]
buffer
DOCUMENT ME!(package private) int
capScreenHeight
DOCUMENT ME!(package private) int
capScreenWidth
DOCUMENT ME!(package private) long
currEventTime
Current mouse press event time stamp.(package private) java.lang.String
directory
DOCUMENT ME!(package private) int[]
extents
DOCUMENT ME!(package private) java.lang.String
fileType
DOCUMENT ME!private int
imageCounter
DOCUMENT ME!(package private) JpegImagesToMovie
imageToMovie
DOCUMENT ME!private VolumeCanvas3D
kCanvas
DOCUMENT ME!private ModelImage
kImage
DOCUMENT ME!static int
lookdown
static int
lookleft
static int
lookright
static int
lookup
private int[]
m_aiBranchIndexUnvisitedMax
DOCUMENT ME!private int[]
m_aiBranchIndexUnvisitedMin
This is the range of path samples for each branch that are unvisited.private int[]
m_aiMeshConnectivity
DOCUMENT ME!private int
m_iLastSelectedBranchIndex
Keep track of the last branch that was selected (at a branch point).private FlyPathAnnotateList
m_kAnnotateList
This is for the collection of annotation points.private javax.media.j3d.Group
m_kAnnotatePointGroup
DOCUMENT ME!private javax.media.j3d.Shape3D
m_kBranchConnectShape
DOCUMENT ME!private javax.media.j3d.Shape3D
m_kBranchPathShape
This is the Java3D geometry for the path.private JPanelVirtualEndoscopySetup
m_kControlFrame
This is the control frame which may need to be updated as the view changes.private FlyPathBehavior
m_kFlyPathBehavior
Keep track of the FlyPathBehavior because it knows about the view from the path.private FlyPathGraphCurve
m_kFlyPathGraphCurve
DOCUMENT ME!private FlyPathGraphSamples
m_kFlyPathGraphSamples
This is the path extracted from the skeletonization.private javax.media.j3d.Group
m_kGeodesicGroup
DOCUMENT ME!private ModelLUT
m_kMeanCurvaturesLUT
DOCUMENT ME!private ModelTriangleMeshCurvatures
m_kMeshCurvatures
DOCUMENT ME!private com.sun.j3d.utils.behaviors.mouse.MouseRotate
m_kMouseRotateBehavior
DOCUMENT ME!private javax.vecmath.Color3f
m_kNormalColorPathUnvisited
DOCUMENT ME!private javax.vecmath.Color3f
m_kNormalColorPathVisited
These are the colors to use when rendering the normal/selected branch that is unvisited/visited.private FlythruRender.SetupOptions
m_kOptions
These are the setup options passed to the constructor which we need to keep track of in case we need to use them outside the constructor.private com.sun.j3d.utils.picking.PickCanvas
m_kPickCanvas
Used for picking.private javax.media.j3d.PointLight
m_kPointLight
DOCUMENT ME!private javax.media.j3d.BranchGroup
m_kSceneRoot
These are part of the scene and view.private javax.vecmath.Color3f
m_kSelectColorPathUnvisited
DOCUMENT ME!private javax.vecmath.Color3f
m_kSelectColorPathVisited
DOCUMENT ME!private Skeleton3D
m_kSkeleton
This it skeletonization of the binary volume.private ModelTriangleMesh
m_kSurface
This is the surface geometry and its properties.private ModelTriangleMeshCurveSegments
m_kSurfaceCurveSegments
DOCUMENT ME!private javax.media.j3d.IndexedGeometryArray
m_kSurfaceGeometry
DOCUMENT ME!private com.sun.j3d.utils.geometry.GeometryInfo
m_kSurfaceGeometryInfo
This is the Java3D geometry for the surface.private ModelTriangleMesh
m_kSurfaceMesh
DOCUMENT ME!private javax.media.j3d.Shape3D
m_kSurfaceShape
DOCUMENT ME!private com.sun.j3d.utils.universe.SimpleUniverse
m_kUniverse
The simple universe contains a single canvas, a viewing platform, and a scene graph.private ModelImage3DLayout
m_kVolumeLayout
Describes the organization of the volume data in a linear array.(package private) MovieMaker
movieMake
DOCUMENT ME!private ViewJFrameVolumeView
parentFrame
DOCUMENT ME!(package private) int[]
pixels
DOCUMENT ME!private boolean
pressed
If any of the mouse move button pressed.(package private) long
prevEventTime
Previous mouse press event time stamp.(package private) javax.swing.JProgressBar
rendererProgressBar
A local reference to the volume renderer frame's progress bar.(package private) java.awt.Robot
robot
DOCUMENT ME!private int
saveCounter
DOCUMENT ME!private static long
serialVersionUID
Use serialVersionUID for interoperability.private long
time
Time to wait for the next mouse event.-
Fields inherited from class gov.nih.mipav.view.renderer.J3D.surfaceview.SurfaceRender
ARTERIAL_SEG, BONE_SEG, ENTRY_POINT, isViewTextureAligned, rayBasedRender, TUMOR_SEG, VASCULATURE_SEG, VEINOUS_SEG
-
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 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
-
-
Constructor Summary
Constructors Constructor Description FlythruRender(ModelImage _kImage, java.awt.GraphicsConfiguration _config, ViewJFrameVolumeView _parentFrame)
View which renders virtual endoscopy fly through of a binarized volume.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)
ReplaceMesh is used by the Geodesic when a mesh is cut.void
autoRun()
Causes the FlyPathBehavior to fly down the current path from start to finish and back again.private javax.media.j3d.LineArray
createBranchConnectGeometry(int iBranch)
Get the geometry to be used for rendering the connection of the specified branch to its parent branch.private javax.media.j3d.LineStripArray
createBranchPathGeometry(int iBranch)
Get the geometry to be used for rendering the path of the specified branch.private javax.media.j3d.LineStripArray
createBranchPathGeometryScaled(int iBranch)
Get the geometry to be used for rendering the path of the specified branch.private void
createDirectory()
Create flythru directory to save the captured images from AVI recorder.void
dispose()
Override called when window is closed.javax.media.j3d.Shape3D
getBranchPathShape()
For displaying the Path in the surface renderer:java.lang.Object
getBranchState()
javax.media.j3d.Canvas3D
getCanvas()
Accessor for the canvas for this 3D object.int
getCounter()
javax.media.j3d.Group
getGeodesicGroup()
Return access to the Group data member m_kGeodesicGroup so Geodesic object can draw on the triangle mesh:int
getHeight()
ModelImage
getImage()
ModelLUT
getMeanCurvaturesLUT()
Access the pseudocolor mapping specified to use when rendering the computed mean curvatures values for the specified surface.float
getPathDist()
DOCUMENT ME!com.sun.j3d.utils.picking.PickCanvas
getPickCanvas()
Get the pick canvas.javax.vecmath.Point3f
getPositionScaled()
Scaled coordinates for the current position along the path for viewing.javax.vecmath.Point3f
getSamplePosition()
Return the interpolated sample coordinates in the volume of the current position along the path for viewing.ModelTriangleMesh
getSurface()
Access the surface to be rendered when moving along the path.javax.swing.JPanel
getSurfaceControl()
DOCUMENT ME!ModelTriangleMeshCurvatures
getSurfaceCurvatures()
Access the computed curvatures for the specified triangle mesh surface.int
getWidth()
void
makeMove(java.lang.String cmd)
Passes move command from the JPanelFlythruMove to the FlyPathBehavior class.void
mouseClicked(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.void
mouseDragged(java.awt.event.MouseEvent event)
The mouseDragged event is used when the right mouse button press down and dragged to adjust the camera viewing direction.void
mouseEntered(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.void
mouseExited(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.void
mouseMoved(java.awt.event.MouseEvent kMouseEvent)
void
mousePressed(java.awt.event.MouseEvent event)
Implement MouseInterface abstract method.void
mouseReleased(java.awt.event.MouseEvent event)
Implement MouseInterface abstract method.void
mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Mouse wheel event invoked from the middle mouse button roller.boolean
readImage()
DOCUMENT ME!void
record(boolean bOn)
Turn recording frames on/off.void
replaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)
ReplaceMesh is used by the Geodesic when a mesh is cut.void
resetCounter()
DOCUMENT ME!void
resetRenderAnnotateList()
DOCUMENT ME!protected void
resetRenderBranchConnect()
Called any time a change has been made to a new branch so that the connection between the branch and its parent can be rendered.protected void
resetRenderBranchPath()
Called any time the position along the current curve changes and the color of the curve needs to change to show what has been visited.protected void
resetRenderScene()
Called any time the scene needs to be regenerated.protected void
resetRenderSurface()
Called whenever any of the rendering properties of the surface are modified.protected void
resetRenderSurfaceColors()
If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.protected void
resetRenderSurfaceConnectivity()
Resets the portion of the surface to be rendered based on the current triangle connectivity information.void
setCurrentState(java.lang.Object _state)
Set the current traversing branch.void
setMeanCurvaturesLUT(ModelLUT kMeanCurvaturesLUT)
Use the specified pseudocolors to render the computed mean curvatures for the previously specified mesh surface.void
setRenderSurfaceColors(java.awt.Color _color)
If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.void
setSurface(ModelTriangleMesh kSurface)
Add the specified surface to the rendering.void
setupRender(ModelImage _kImage, FlythruRender.SetupOptions kOptions)
Setup flythru renderer.void
setupRenderControl(JPanelVirtualEndoscopySetup _control)
DOCUMENT ME!void
toggleWireframe()
Toggle between wireframe and filled polygon mode:void
transformChanged(int iType, javax.media.j3d.Transform3D kTransform)
MouseBehaviorCallback override.void
viewChanged(FlyPathBehavior kFlyPathBehavior, int iEvent)
Implementation of the FlyPathBehavior.Callback interface.boolean
writeImage()
Write the image from the rendering frame into the camera capture frame.-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.surfaceview.SurfaceRender
actionPerformed, addCubicControl, autoCapture, cleanMouseRecorder, close, configureVolumeFrame, cropClipVolume, detachVolRender, disableClipping, dispatchSavedEvent, disposeLocal, drawRFAPoint, enableEntryPoint, enableObjBehavior, getCameraControl, getClipDialog, getDisplayDialog, getDisplayMode3D, getGeodesicPanel, getImageA, getImageB, getMouseDialog, getMouseMode, getObjBoxSlice_BG, getObjPlane_BG, getOriginalScreenScale, getParentFrame, getProbeDialog, getResolutions, getSceneState, getSculptorPanel, getSegmentationImage, getSlicePanel, getSliceSpacingCoarse, getSliceSpacingFine, getSurfaceDialog, getSurfaceTexture, getSurfaceTexturePanel, getViewDialog, getVolOpacityPanel, getVolRenderBG, getVolRenderOG, getVolumeTexture, getVolumeTextureCopy, hideBoxFrame, invokeClipping, isVolViewMode, keyPressed, keyReleased, keyTyped, ModelToScreen, propertyChange, reConfigureVolumeFrame, removeBoxSlice, removeCubicControl, resetAxisX, resetAxisY, resetImage, rotateImage, saveCropVolume, setAlphaBlend, setCenter, setCompositeMode, setDisplayMode3D, setGUI, setLightingMode, setLUTa, setLUTb, setMaterialShininess, setMouseMode, setMouseRotateEnable, setParallelRotation, setProbeTG, setRayBasedRender, setRenderPerspective, setRGBTA, setRGBTB, setSegmentationImage, setSlice, setSliceColor, setSliceSpacingCoarse, setSliceSpacingFine, setTimeSlice, setViewTextureAligned, setVolumeDisplayMode, setVolView, showBoxFrame, showBoxSlice, stateChanged, switchToSliceView, switchToVolView, transformUpdate, undoCropVolume, update3DTriplanar, updateBoxSlicePos, updateBoxSlices, updateCubicTransform, updateCubicTransform, updateData, updateImageExtents, updateImageFromRotation, updateImages, updateImages, updateImages, updateLighting, updateOpacityOfOthrogPlanes, updateParent, updateProbe, updateProbePos, updateRaycastRender, updateShininess, updateTransform, updateVolume, useSliceSpacingCoarse, useSliceSpacingFine, whichTissue
-
Methods inherited from class gov.nih.mipav.view.renderer.J3D.RenderViewBase
calcImageNormals, createBoxFrame, disableCamera, disposeLocal, getBehaviorGroup, getBound, getBranchGroup, getNormals, getRGBTA, getRGBTB, getSceneRootTG, getSliderEvents, getTriPlanarViewBG, getUniverse, recordMouse, setBackgroundColor, setBoxColor, setRotationAngle, setRotationAxis, writeImageAuto
-
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, 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, 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
-
buffer
short[] buffer
DOCUMENT ME!
-
capScreenWidth
int capScreenWidth
DOCUMENT ME!
-
capScreenHeight
int capScreenHeight
DOCUMENT ME!
-
directory
java.lang.String directory
DOCUMENT ME!
-
extents
int[] extents
DOCUMENT ME!
-
fileType
java.lang.String fileType
DOCUMENT ME!
-
imageToMovie
JpegImagesToMovie imageToMovie
DOCUMENT ME!
-
movieMake
MovieMaker movieMake
DOCUMENT ME!
-
pixels
int[] pixels
DOCUMENT ME!
-
rendererProgressBar
javax.swing.JProgressBar rendererProgressBar
A local reference to the volume renderer frame's progress bar.
-
robot
java.awt.Robot robot
DOCUMENT ME!
-
imageCounter
private int imageCounter
DOCUMENT ME!
-
kCanvas
private VolumeCanvas3D kCanvas
DOCUMENT ME!
-
kImage
private ModelImage kImage
DOCUMENT ME!
-
m_aiBranchIndexUnvisitedMax
private int[] m_aiBranchIndexUnvisitedMax
DOCUMENT ME!
-
m_aiBranchIndexUnvisitedMin
private int[] m_aiBranchIndexUnvisitedMin
This is the range of path samples for each branch that are unvisited.
-
m_aiMeshConnectivity
private int[] m_aiMeshConnectivity
DOCUMENT ME!
-
m_iLastSelectedBranchIndex
private int m_iLastSelectedBranchIndex
Keep track of the last branch that was selected (at a branch point).
-
m_kAnnotateList
private FlyPathAnnotateList m_kAnnotateList
This is for the collection of annotation points.
-
m_kAnnotatePointGroup
private javax.media.j3d.Group m_kAnnotatePointGroup
DOCUMENT ME!
-
m_kBranchConnectShape
private javax.media.j3d.Shape3D m_kBranchConnectShape
DOCUMENT ME!
-
m_kBranchPathShape
private javax.media.j3d.Shape3D m_kBranchPathShape
This is the Java3D geometry for the path.
-
m_kControlFrame
private JPanelVirtualEndoscopySetup m_kControlFrame
This is the control frame which may need to be updated as the view changes.
-
m_kFlyPathBehavior
private FlyPathBehavior m_kFlyPathBehavior
Keep track of the FlyPathBehavior because it knows about the view from the path.
-
m_kFlyPathGraphCurve
private FlyPathGraphCurve m_kFlyPathGraphCurve
DOCUMENT ME!
-
m_kFlyPathGraphSamples
private FlyPathGraphSamples m_kFlyPathGraphSamples
This is the path extracted from the skeletonization.
-
m_kGeodesicGroup
private javax.media.j3d.Group m_kGeodesicGroup
DOCUMENT ME!
-
m_kMeanCurvaturesLUT
private ModelLUT m_kMeanCurvaturesLUT
DOCUMENT ME!
-
m_kMeshCurvatures
private ModelTriangleMeshCurvatures m_kMeshCurvatures
DOCUMENT ME!
-
m_kMouseRotateBehavior
private com.sun.j3d.utils.behaviors.mouse.MouseRotate m_kMouseRotateBehavior
DOCUMENT ME!
-
m_kNormalColorPathUnvisited
private javax.vecmath.Color3f m_kNormalColorPathUnvisited
DOCUMENT ME!
-
m_kNormalColorPathVisited
private javax.vecmath.Color3f m_kNormalColorPathVisited
These are the colors to use when rendering the normal/selected branch that is unvisited/visited.
-
m_kOptions
private FlythruRender.SetupOptions m_kOptions
These are the setup options passed to the constructor which we need to keep track of in case we need to use them outside the constructor.
-
m_kPickCanvas
private com.sun.j3d.utils.picking.PickCanvas m_kPickCanvas
Used for picking.
-
m_kPointLight
private javax.media.j3d.PointLight m_kPointLight
DOCUMENT ME!
-
m_kSceneRoot
private javax.media.j3d.BranchGroup m_kSceneRoot
These are part of the scene and view.
-
m_kSelectColorPathUnvisited
private javax.vecmath.Color3f m_kSelectColorPathUnvisited
DOCUMENT ME!
-
m_kSelectColorPathVisited
private javax.vecmath.Color3f m_kSelectColorPathVisited
DOCUMENT ME!
-
m_kSkeleton
private Skeleton3D m_kSkeleton
This it skeletonization of the binary volume.
-
m_kSurface
private ModelTriangleMesh m_kSurface
This is the surface geometry and its properties.
-
m_kSurfaceCurveSegments
private ModelTriangleMeshCurveSegments m_kSurfaceCurveSegments
DOCUMENT ME!
-
m_kSurfaceGeometry
private javax.media.j3d.IndexedGeometryArray m_kSurfaceGeometry
DOCUMENT ME!
-
m_kSurfaceGeometryInfo
private com.sun.j3d.utils.geometry.GeometryInfo m_kSurfaceGeometryInfo
This is the Java3D geometry for the surface.
-
m_kSurfaceMesh
private ModelTriangleMesh m_kSurfaceMesh
DOCUMENT ME!
-
m_kSurfaceShape
private javax.media.j3d.Shape3D m_kSurfaceShape
DOCUMENT ME!
-
m_kUniverse
private com.sun.j3d.utils.universe.SimpleUniverse m_kUniverse
The simple universe contains a single canvas, a viewing platform, and a scene graph. The scene graph will contain all objects involved in the rendering.
-
m_kVolumeLayout
private ModelImage3DLayout m_kVolumeLayout
Describes the organization of the volume data in a linear array.
-
parentFrame
private ViewJFrameVolumeView parentFrame
DOCUMENT ME!
-
saveCounter
private int saveCounter
DOCUMENT ME!
-
currEventTime
long currEventTime
Current mouse press event time stamp.
-
prevEventTime
long prevEventTime
Previous mouse press event time stamp.
-
pressed
private boolean pressed
If any of the mouse move button pressed.
-
time
private long time
Time to wait for the next mouse event.
-
lookup
public static int lookup
-
lookdown
public static int lookdown
-
lookright
public static int lookright
-
lookleft
public static int lookleft
-
-
Constructor Detail
-
FlythruRender
public FlythruRender(ModelImage _kImage, java.awt.GraphicsConfiguration _config, ViewJFrameVolumeView _parentFrame)
View which renders virtual endoscopy fly through of a binarized volume.- Parameters:
_kImage
- ModelImage Contains the image data and its properties._config
- Graphics configuration reference._parentFrame
- ViewJFrameVolumeView reference. initial virtual endoscopy view.
-
-
Method Detail
-
addMesh
public void addMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)
ReplaceMesh is used by the Geodesic when a mesh is cut. The original mesh is changed, but not deleted and no new mesh is added. The orginal mesh, kOld, is replced by the new mesh, kNew:- Parameters:
kOld
- DOCUMENT ME!kNew
- DOCUMENT ME!
-
autoRun
public void autoRun()
Description copied from interface:FlyThroughRenderInterface
Causes the FlyPathBehavior to fly down the current path from start to finish and back again.- Specified by:
autoRun
in interfaceFlyThroughRenderInterface
-
dispose
public void dispose()
Override called when window is closed.
-
getBranchPathShape
public javax.media.j3d.Shape3D getBranchPathShape()
For displaying the Path in the surface renderer:- Returns:
- Shape3D, the scaled FlyPath
-
getBranchState
public java.lang.Object getBranchState()
- Specified by:
getBranchState
in interfaceFlyThroughRenderInterface
- Returns:
- the current BranchState from the FlyPatheBehavior class.
-
getCanvas
public javax.media.j3d.Canvas3D getCanvas()
Description copied from class:RenderViewBase
Accessor for the canvas for this 3D object.- Specified by:
getCanvas
in interfaceFlyThroughRenderInterface
- Overrides:
getCanvas
in classRenderViewBase
- Returns:
- The canvas for the scene.
-
getGeodesicGroup
public javax.media.j3d.Group getGeodesicGroup()
Return access to the Group data member m_kGeodesicGroup so Geodesic object can draw on the triangle mesh:- Returns:
- DOCUMENT ME!
-
getMeanCurvaturesLUT
public ModelLUT getMeanCurvaturesLUT()
Access the pseudocolor mapping specified to use when rendering the computed mean curvatures values for the specified surface.- Returns:
- ModelLUT Defines the mapping of mean curvatures values to pseudocolor values.
-
getPathDist
public float getPathDist()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getPickCanvas
public com.sun.j3d.utils.picking.PickCanvas getPickCanvas()
Get the pick canvas.- Returns:
- pickCanvas pick canvas.
-
getPositionScaled
public javax.vecmath.Point3f getPositionScaled()
Scaled coordinates for the current position along the path for viewing.- Returns:
- Point3f A new instance created which contains the path position coordinates, scaled to match the ModelTriangleMesh in JPanelSurface.
-
getSamplePosition
public javax.vecmath.Point3f getSamplePosition()
Return the interpolated sample coordinates in the volume of the current position along the path for viewing.- Returns:
- Point3f A new instance created which contains the interpolated sample coordinates.
-
getSurface
public ModelTriangleMesh getSurface()
Access the surface to be rendered when moving along the path.- Returns:
- ModelTriangleMesh Instance of the surface represented as a triangle mesh as specified in the setSurface method.
-
getSurfaceControl
public javax.swing.JPanel getSurfaceControl()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getSurfaceCurvatures
public ModelTriangleMeshCurvatures getSurfaceCurvatures()
Access the computed curvatures for the specified triangle mesh surface.- Returns:
- ModelTriangleMeshCurvatures Instance of the computed curvatures associated with the triangle mesh specifed in the setSurface method.
-
makeMove
public void makeMove(java.lang.String cmd)
Description copied from interface:FlyThroughRenderInterface
Passes move command from the JPanelFlythruMove to the FlyPathBehavior class.- Specified by:
makeMove
in interfaceFlyThroughRenderInterface
- Parameters:
cmd
- move command.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.- Specified by:
mouseClicked
in interfacejava.awt.event.MouseListener
- Parameters:
kMouseEvent
- MouseEvent Contains information about the particular mouse event.
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.- Specified by:
mouseEntered
in interfacejava.awt.event.MouseListener
- Parameters:
kMouseEvent
- MouseEvent Contains information about the particular mouse event.
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.- Specified by:
mouseExited
in interfacejava.awt.event.MouseListener
- Parameters:
kMouseEvent
- MouseEvent Contains information about the particular mouse event.
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent event)
Implement MouseInterface abstract method.- Specified by:
mousePressed
in interfacejava.awt.event.MouseListener
- Parameters:
kMouseEvent
- MouseEvent Contains information about the particular mouse event.
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent event)
The mouseDragged event is used when the right mouse button press down and dragged to adjust the camera viewing direction.- Specified by:
mouseDragged
in interfacejava.awt.event.MouseMotionListener
- Parameters:
event
- MouseEvent right mouse button press down and drag
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent kMouseEvent)
- Specified by:
mouseMoved
in interfacejava.awt.event.MouseMotionListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
Implement MouseInterface abstract method.- Specified by:
mouseReleased
in interfacejava.awt.event.MouseListener
- Parameters:
kMouseEvent
- MouseEvent Contains information about the particular mouse event.
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Mouse wheel event invoked from the middle mouse button roller. Rolling forward to track the fly-thru path in forward direction. Rolling backward to track the fly-thru path in backward direction.- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Parameters:
event
- mouse middle mouse roller event.
-
readImage
public boolean readImage()
DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
replaceMesh
public void replaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)
ReplaceMesh is used by the Geodesic when a mesh is cut. The original mesh is changed, but not deleted and no new mesh is added. The orginal mesh, kOld, is replced by the new mesh, kNew:- Parameters:
kOld
- DOCUMENT ME!kNew
- DOCUMENT ME!
-
resetCounter
public void resetCounter()
DOCUMENT ME!
-
resetRenderAnnotateList
public void resetRenderAnnotateList()
DOCUMENT ME!
-
setCurrentState
public void setCurrentState(java.lang.Object _state)
Set the current traversing branch.- Specified by:
setCurrentState
in interfaceFlyThroughRenderInterface
- Parameters:
_state
- Object
-
setMeanCurvaturesLUT
public void setMeanCurvaturesLUT(ModelLUT kMeanCurvaturesLUT)
Use the specified pseudocolors to render the computed mean curvatures for the previously specified mesh surface.- Parameters:
kMeanCurvaturesLUT
- ModelLUT Defines the mapping of mean curvatures values to pseudocolor values. This may be null which is used to indicated that the mean curvatures are not to be rendered.
-
setRenderSurfaceColors
public void setRenderSurfaceColors(java.awt.Color _color)
If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.- Parameters:
_color
- DOCUMENT ME!
-
setSurface
public void setSurface(ModelTriangleMesh kSurface)
Add the specified surface to the rendering.- Parameters:
kSurface
- ModelTriangleMesh Surface represented as a triagle mesh.
-
setupRender
public void setupRender(ModelImage _kImage, FlythruRender.SetupOptions kOptions)
Setup flythru renderer.- Parameters:
_kImage
- original model image reference.kOptions
- setup options reference.
-
setupRenderControl
public void setupRenderControl(JPanelVirtualEndoscopySetup _control)
DOCUMENT ME!- Parameters:
_control
- DOCUMENT ME!
-
toggleWireframe
public void toggleWireframe()
Toggle between wireframe and filled polygon mode:
-
transformChanged
public void transformChanged(int iType, javax.media.j3d.Transform3D kTransform)
MouseBehaviorCallback override. This method is called whenever any MouseBehavior-derived class causes a change to the transformation which it is controlling.- Specified by:
transformChanged
in interfacecom.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback
- Overrides:
transformChanged
in classSurfaceRender
- Parameters:
iType
- will be one of ROTATE, TRANSLATE or ZOOMkTransform
- the updated Transform3D controlled by the MouseBehavior
-
viewChanged
public void viewChanged(FlyPathBehavior kFlyPathBehavior, int iEvent)
Implementation of the FlyPathBehavior.Callback interface.- Specified by:
viewChanged
in interfaceFlyPathBehavior.Callback
- Parameters:
kFlyPathBehavior
- reference to the MjFlyPathBehavior for which the view changed.iEvent
- Bitmask identifies the event(s) which caused the view to change. Bitmask created from OR of EVENT_* defintions.
-
writeImage
public boolean writeImage()
Description copied from class:RenderViewBase
Write the image from the rendering frame into the camera capture frame.- Specified by:
writeImage
in interfaceFlyThroughRenderInterface
- Overrides:
writeImage
in classRenderViewBase
- Returns:
- succeed
true
means succeed,false
means unsucceed.
-
getCounter
public int getCounter()
- Specified by:
getCounter
in interfaceFlyThroughRenderInterface
- Returns:
- the current frame counter.
-
getHeight
public int getHeight()
- Specified by:
getHeight
in interfaceFlyThroughRenderInterface
- Overrides:
getHeight
in classjava.awt.Component
- Returns:
- the frame height.
-
getWidth
public int getWidth()
- Specified by:
getWidth
in interfaceFlyThroughRenderInterface
- Overrides:
getWidth
in classjava.awt.Component
- Returns:
- the frame width.
-
resetRenderBranchConnect
protected void resetRenderBranchConnect()
Called any time a change has been made to a new branch so that the connection between the branch and its parent can be rendered.
-
resetRenderBranchPath
protected void resetRenderBranchPath()
Called any time the position along the current curve changes and the color of the curve needs to change to show what has been visited.
-
resetRenderScene
protected void resetRenderScene()
Called any time the scene needs to be regenerated.
-
resetRenderSurface
protected void resetRenderSurface()
Called whenever any of the rendering properties of the surface are modified.
-
resetRenderSurfaceColors
protected void resetRenderSurfaceColors()
If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.
-
resetRenderSurfaceConnectivity
protected void resetRenderSurfaceConnectivity()
Resets the portion of the surface to be rendered based on the current triangle connectivity information.
-
createBranchConnectGeometry
private javax.media.j3d.LineArray createBranchConnectGeometry(int iBranch)
Get the geometry to be used for rendering the connection of the specified branch to its parent branch.- Parameters:
iBranch
- Index which identifies the branch.- Returns:
- LineArray instance that can be attached to a Shape3D node for rendering
-
createBranchPathGeometry
private javax.media.j3d.LineStripArray createBranchPathGeometry(int iBranch)
Get the geometry to be used for rendering the path of the specified branch.- Parameters:
iBranch
- Index which identifies the branch.- Returns:
- LineStripArray instance that can be attached to a Shape3D node for rendering
-
createBranchPathGeometryScaled
private javax.media.j3d.LineStripArray createBranchPathGeometryScaled(int iBranch)
Get the geometry to be used for rendering the path of the specified branch.- Parameters:
iBranch
- Index which identifies the branch.- Returns:
- LineStripArray instance that can be attached to a Shape3D node for rendering.
The LineStripArray coordinates are scaled to match the ModelTriangleMesh in JPanelSurface.
-
createDirectory
private void createDirectory()
Create flythru directory to save the captured images from AVI recorder.
-
record
public void record(boolean bOn)
Description copied from interface:FlyThroughRenderInterface
Turn recording frames on/off.- Specified by:
record
in interfaceFlyThroughRenderInterface
-
getImage
public ModelImage getImage()
- Specified by:
getImage
in interfaceFlyThroughRenderInterface
- Returns:
- access to the ModelImage mask image used by the Fly-through renderer.
-
-