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 classFlythruRender.MouseRotateExtExtend 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) classFlythruRender.MouseWheelMouse middle button wheel roller event handler.(package private) classFlythruRender.RightMouseRightMouse press event handler.(package private) classFlythruRender.RightMouseDraggedRight mouse button press down and drag event handler.static classFlythruRender.SetupOptionsDOCUMENT 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[]bufferDOCUMENT ME!(package private) intcapScreenHeightDOCUMENT ME!(package private) intcapScreenWidthDOCUMENT ME!(package private) longcurrEventTimeCurrent mouse press event time stamp.(package private) java.lang.StringdirectoryDOCUMENT ME!(package private) int[]extentsDOCUMENT ME!(package private) java.lang.StringfileTypeDOCUMENT ME!private intimageCounterDOCUMENT ME!(package private) JpegImagesToMovieimageToMovieDOCUMENT ME!private VolumeCanvas3DkCanvasDOCUMENT ME!private ModelImagekImageDOCUMENT ME!static intlookdownstatic intlookleftstatic intlookrightstatic intlookupprivate int[]m_aiBranchIndexUnvisitedMaxDOCUMENT ME!private int[]m_aiBranchIndexUnvisitedMinThis is the range of path samples for each branch that are unvisited.private int[]m_aiMeshConnectivityDOCUMENT ME!private intm_iLastSelectedBranchIndexKeep track of the last branch that was selected (at a branch point).private FlyPathAnnotateListm_kAnnotateListThis is for the collection of annotation points.private javax.media.j3d.Groupm_kAnnotatePointGroupDOCUMENT ME!private javax.media.j3d.Shape3Dm_kBranchConnectShapeDOCUMENT ME!private javax.media.j3d.Shape3Dm_kBranchPathShapeThis is the Java3D geometry for the path.private JPanelVirtualEndoscopySetupm_kControlFrameThis is the control frame which may need to be updated as the view changes.private FlyPathBehaviorm_kFlyPathBehaviorKeep track of the FlyPathBehavior because it knows about the view from the path.private FlyPathGraphCurvem_kFlyPathGraphCurveDOCUMENT ME!private FlyPathGraphSamplesm_kFlyPathGraphSamplesThis is the path extracted from the skeletonization.private javax.media.j3d.Groupm_kGeodesicGroupDOCUMENT ME!private ModelLUTm_kMeanCurvaturesLUTDOCUMENT ME!private ModelTriangleMeshCurvaturesm_kMeshCurvaturesDOCUMENT ME!private com.sun.j3d.utils.behaviors.mouse.MouseRotatem_kMouseRotateBehaviorDOCUMENT ME!private javax.vecmath.Color3fm_kNormalColorPathUnvisitedDOCUMENT ME!private javax.vecmath.Color3fm_kNormalColorPathVisitedThese are the colors to use when rendering the normal/selected branch that is unvisited/visited.private FlythruRender.SetupOptionsm_kOptionsThese 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.PickCanvasm_kPickCanvasUsed for picking.private javax.media.j3d.PointLightm_kPointLightDOCUMENT ME!private javax.media.j3d.BranchGroupm_kSceneRootThese are part of the scene and view.private javax.vecmath.Color3fm_kSelectColorPathUnvisitedDOCUMENT ME!private javax.vecmath.Color3fm_kSelectColorPathVisitedDOCUMENT ME!private Skeleton3Dm_kSkeletonThis it skeletonization of the binary volume.private ModelTriangleMeshm_kSurfaceThis is the surface geometry and its properties.private ModelTriangleMeshCurveSegmentsm_kSurfaceCurveSegmentsDOCUMENT ME!private javax.media.j3d.IndexedGeometryArraym_kSurfaceGeometryDOCUMENT ME!private com.sun.j3d.utils.geometry.GeometryInfom_kSurfaceGeometryInfoThis is the Java3D geometry for the surface.private ModelTriangleMeshm_kSurfaceMeshDOCUMENT ME!private javax.media.j3d.Shape3Dm_kSurfaceShapeDOCUMENT ME!private com.sun.j3d.utils.universe.SimpleUniversem_kUniverseThe simple universe contains a single canvas, a viewing platform, and a scene graph.private ModelImage3DLayoutm_kVolumeLayoutDescribes the organization of the volume data in a linear array.(package private) MovieMakermovieMakeDOCUMENT ME!private ViewJFrameVolumeViewparentFrameDOCUMENT ME!(package private) int[]pixelsDOCUMENT ME!private booleanpressedIf any of the mouse move button pressed.(package private) longprevEventTimePrevious mouse press event time stamp.(package private) javax.swing.JProgressBarrendererProgressBarA local reference to the volume renderer frame's progress bar.(package private) java.awt.RobotrobotDOCUMENT ME!private intsaveCounterDOCUMENT ME!private static longserialVersionUIDUse serialVersionUID for interoperability.private longtimeTime 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 voidaddMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)ReplaceMesh is used by the Geodesic when a mesh is cut.voidautoRun()Causes the FlyPathBehavior to fly down the current path from start to finish and back again.private javax.media.j3d.LineArraycreateBranchConnectGeometry(int iBranch)Get the geometry to be used for rendering the connection of the specified branch to its parent branch.private javax.media.j3d.LineStripArraycreateBranchPathGeometry(int iBranch)Get the geometry to be used for rendering the path of the specified branch.private javax.media.j3d.LineStripArraycreateBranchPathGeometryScaled(int iBranch)Get the geometry to be used for rendering the path of the specified branch.private voidcreateDirectory()Create flythru directory to save the captured images from AVI recorder.voiddispose()Override called when window is closed.javax.media.j3d.Shape3DgetBranchPathShape()For displaying the Path in the surface renderer:java.lang.ObjectgetBranchState()javax.media.j3d.Canvas3DgetCanvas()Accessor for the canvas for this 3D object.intgetCounter()javax.media.j3d.GroupgetGeodesicGroup()Return access to the Group data member m_kGeodesicGroup so Geodesic object can draw on the triangle mesh:intgetHeight()ModelImagegetImage()ModelLUTgetMeanCurvaturesLUT()Access the pseudocolor mapping specified to use when rendering the computed mean curvatures values for the specified surface.floatgetPathDist()DOCUMENT ME!com.sun.j3d.utils.picking.PickCanvasgetPickCanvas()Get the pick canvas.javax.vecmath.Point3fgetPositionScaled()Scaled coordinates for the current position along the path for viewing.javax.vecmath.Point3fgetSamplePosition()Return the interpolated sample coordinates in the volume of the current position along the path for viewing.ModelTriangleMeshgetSurface()Access the surface to be rendered when moving along the path.javax.swing.JPanelgetSurfaceControl()DOCUMENT ME!ModelTriangleMeshCurvaturesgetSurfaceCurvatures()Access the computed curvatures for the specified triangle mesh surface.intgetWidth()voidmakeMove(java.lang.String cmd)Passes move command from the JPanelFlythruMove to the FlyPathBehavior class.voidmouseClicked(java.awt.event.MouseEvent kMouseEvent)Implement MouseInterface abstract method.voidmouseDragged(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.voidmouseEntered(java.awt.event.MouseEvent kMouseEvent)Implement MouseInterface abstract method.voidmouseExited(java.awt.event.MouseEvent kMouseEvent)Implement MouseInterface abstract method.voidmouseMoved(java.awt.event.MouseEvent kMouseEvent)voidmousePressed(java.awt.event.MouseEvent event)Implement MouseInterface abstract method.voidmouseReleased(java.awt.event.MouseEvent event)Implement MouseInterface abstract method.voidmouseWheelMoved(java.awt.event.MouseWheelEvent event)Mouse wheel event invoked from the middle mouse button roller.booleanreadImage()DOCUMENT ME!voidrecord(boolean bOn)Turn recording frames on/off.voidreplaceMesh(ModelTriangleMesh kOld, ModelTriangleMesh kNew)ReplaceMesh is used by the Geodesic when a mesh is cut.voidresetCounter()DOCUMENT ME!voidresetRenderAnnotateList()DOCUMENT ME!protected voidresetRenderBranchConnect()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 voidresetRenderBranchPath()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 voidresetRenderScene()Called any time the scene needs to be regenerated.protected voidresetRenderSurface()Called whenever any of the rendering properties of the surface are modified.protected voidresetRenderSurfaceColors()If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.protected voidresetRenderSurfaceConnectivity()Resets the portion of the surface to be rendered based on the current triangle connectivity information.voidsetCurrentState(java.lang.Object _state)Set the current traversing branch.voidsetMeanCurvaturesLUT(ModelLUT kMeanCurvaturesLUT)Use the specified pseudocolors to render the computed mean curvatures for the previously specified mesh surface.voidsetRenderSurfaceColors(java.awt.Color _color)If the color LUT defined for mean curvature pseudocolor mapping is defined, then use it to reset the colors.voidsetSurface(ModelTriangleMesh kSurface)Add the specified surface to the rendering.voidsetupRender(ModelImage _kImage, FlythruRender.SetupOptions kOptions)Setup flythru renderer.voidsetupRenderControl(JPanelVirtualEndoscopySetup _control)DOCUMENT ME!voidtoggleWireframe()Toggle between wireframe and filled polygon mode:voidtransformChanged(int iType, javax.media.j3d.Transform3D kTransform)MouseBehaviorCallback override.voidviewChanged(FlyPathBehavior kFlyPathBehavior, int iEvent)Implementation of the FlyPathBehavior.Callback interface.booleanwriteImage()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:FlyThroughRenderInterfaceCauses the FlyPathBehavior to fly down the current path from start to finish and back again.- Specified by:
autoRunin 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:
getBranchStatein interfaceFlyThroughRenderInterface- Returns:
- the current BranchState from the FlyPatheBehavior class.
-
getCanvas
public javax.media.j3d.Canvas3D getCanvas()
Description copied from class:RenderViewBaseAccessor for the canvas for this 3D object.- Specified by:
getCanvasin interfaceFlyThroughRenderInterface- Overrides:
getCanvasin 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:FlyThroughRenderInterfacePasses move command from the JPanelFlythruMove to the FlyPathBehavior class.- Specified by:
makeMovein interfaceFlyThroughRenderInterface- Parameters:
cmd- move command.
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent kMouseEvent)
Implement MouseInterface abstract method.- Specified by:
mouseClickedin 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:
mouseEnteredin 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:
mouseExitedin 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:
mousePressedin 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:
mouseDraggedin 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:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent event)
Implement MouseInterface abstract method.- Specified by:
mouseReleasedin 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:
mouseWheelMovedin 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:
setCurrentStatein 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:
transformChangedin interfacecom.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback- Overrides:
transformChangedin 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:
viewChangedin 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:RenderViewBaseWrite the image from the rendering frame into the camera capture frame.- Specified by:
writeImagein interfaceFlyThroughRenderInterface- Overrides:
writeImagein classRenderViewBase- Returns:
- succeed
truemeans succeed,falsemeans unsucceed.
-
getCounter
public int getCounter()
- Specified by:
getCounterin interfaceFlyThroughRenderInterface- Returns:
- the current frame counter.
-
getHeight
public int getHeight()
- Specified by:
getHeightin interfaceFlyThroughRenderInterface- Overrides:
getHeightin classjava.awt.Component- Returns:
- the frame height.
-
getWidth
public int getWidth()
- Specified by:
getWidthin interfaceFlyThroughRenderInterface- Overrides:
getWidthin 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:FlyThroughRenderInterfaceTurn recording frames on/off.- Specified by:
recordin interfaceFlyThroughRenderInterface
-
getImage
public ModelImage getImage()
- Specified by:
getImagein interfaceFlyThroughRenderInterface- Returns:
- access to the ModelImage mask image used by the Fly-through renderer.
-
-