Class NodeVolumeTextureRender
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.Node
javax.media.j3d.Group
javax.media.j3d.TransformGroup
gov.nih.mipav.view.renderer.J3D.surfaceview.NodeVolumeTextureRender
- Direct Known Subclasses:
NodeAlignedVolumeTextureRender
public class NodeVolumeTextureRender
extends javax.media.j3d.TransformGroup
Used to generate a scene node item that that represents the rendering of the volume using texture maps.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intDOCUMENT ME!private static final intRender selected planes in order of increasing/decreasing coordinate.private static final intUsed to represent undefined AXIS_*.private static final intRender volume YZ planes in order of increasing/decreasing X.private static final intRender volume ZX planes in order of increasing/decreasing Y.private static final intRender volume XY planes in order of increasing/decreasing Z.private floatMaximum voxel resolution of X, Y, Z.private floatVoxel resolution in the X direction.private floatVoxel resolution in the Y direction.private floatVoxel resolution in the Z direction.private intMax Dimension of X, Y, and Z.private intX Dimension.private intY Dimension.private intZ Dimension.private final int[][][]This contains the childIndexOrder arrays for the axis' OrderedGroup, one for each possible way to slice the volume (by axis and by direction).private final javax.media.j3d.OrderedGroup[]The contents of each slice that can be rendered will be contained in an OrderedGroup node.private booleanRender the slices by increasing or decreasing coordinate.private intKeep track of which direction along the currently selected slicing axis has been selected for rendering the slices.private intKeep track of which axis has been currently selected for slicing the volume for rendering.private javax.media.j3d.AppearanceThe same appearance properties used to render each slice.private javax.media.j3d.SwitchThis is the only node attached to the TransformGroup.Fields inherited from class javax.media.j3d.TransformGroup
ALLOW_TRANSFORM_READ, ALLOW_TRANSFORM_WRITEFields inherited from class javax.media.j3d.Group
ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITEFields inherited from class javax.media.j3d.Node
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING -
Constructor Summary
ConstructorsConstructorDescriptionNodeVolumeTextureRender(ModelImage image, VolumeTexture kVolumeTexture) Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.NodeVolumeTextureRender(ModelImage image, VolumeTexture kVolumeTexture, int iAxis, boolean bIncreasingOrder) Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Clean up memory of this class.protected voidfinalize()Used to call dispose of this class to clean up memory.intReturn which axis has been currently selected for slicing the volume for rendering.booleanReturn the increasing order flag.private voidinit(ModelImage image, VolumeTexture kVolumeTexture) Initialize the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.private voidselectSlices(int iAxis, boolean bIncreasingOrder) Select along which axis and in which direction slicing in the volume is to be performed.voidupdateOpacity(int iValue) Not used at the moment.voidupdateSlicing(javax.vecmath.Vector3d kViewDir) Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.voidupdateView(javax.media.j3d.Transform3D kViewTransform) Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.Methods inherited from class javax.media.j3d.TransformGroup
cloneNode, getTransform, setTransformMethods inherited from class javax.media.j3d.Group
addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBoundsMethods inherited from class javax.media.j3d.Node
cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickableMethods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
Field Details
-
AXIS_UNDEFINED
private static final int AXIS_UNDEFINEDUsed to represent undefined AXIS_*.- See Also:
-
AXIS_X
private static final int AXIS_XRender volume YZ planes in order of increasing/decreasing X. Parameter to selectSlices method.- See Also:
-
AXIS_Y
private static final int AXIS_YRender volume ZX planes in order of increasing/decreasing Y. Parameter to selectSlices method.- See Also:
-
AXIS_Z
private static final int AXIS_ZRender volume XY planes in order of increasing/decreasing Z. Parameter to selectSlices method.- See Also:
-
AXIS_INC
private static final int AXIS_INCRender selected planes in order of increasing/decreasing coordinate.- See Also:
-
AXIS_DEC
private static final int AXIS_DECDOCUMENT ME!- See Also:
-
fMax
private float fMaxMaximum voxel resolution of X, Y, Z. -
fMaxX
private float fMaxXVoxel resolution in the X direction. -
fMaxY
private float fMaxYVoxel resolution in the Y direction. -
fMaxZ
private float fMaxZVoxel resolution in the Z direction. -
iDimMax
private int iDimMaxMax Dimension of X, Y, and Z. -
iDimX
private int iDimXX Dimension. -
iDimY
private int iDimYY Dimension. -
iDimZ
private int iDimZZ Dimension. -
m_aaaiOrderedGroupChildIndexOrder
private final int[][][] m_aaaiOrderedGroupChildIndexOrderThis contains the childIndexOrder arrays for the axis' OrderedGroup, one for each possible way to slice the volume (by axis and by direction). The first array loops over slice axis (AXIS_[XYZ] constants) and the second array loops over direction (increasing or decreasing coordinate based on AXIS_INC or AXIS_DEC constant). the third array contains the childIndexOrder array which has dimension equal to the number of samples in the volume for the corresponding axis (X, Y, or Z). -
m_akOrderedGroupNodeSlices
private final javax.media.j3d.OrderedGroup[] m_akOrderedGroupNodeSlicesThe contents of each slice that can be rendered will be contained in an OrderedGroup node. An OrderedGroup is chosen because it ensures the order which the nodes in the group are rendered. -
m_bIncreasingOrder
private boolean m_bIncreasingOrderRender the slices by increasing or decreasing coordinate. -
m_iAxisDirection
private int m_iAxisDirectionKeep track of which direction along the currently selected slicing axis has been selected for rendering the slices. -
m_iAxisSlice
private int m_iAxisSliceKeep track of which axis has been currently selected for slicing the volume for rendering. -
m_kAppearance
private javax.media.j3d.Appearance m_kAppearanceThe same appearance properties used to render each slice. -
m_kSwitch
private javax.media.j3d.Switch m_kSwitchThis is the only node attached to the TransformGroup. This node is a container of OrderedGroups, one OrderedGroup instance for each axis. Only one child node is selected at any time.
-
-
Constructor Details
-
NodeVolumeTextureRender
Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.- Parameters:
image- reference to the image volume (data and header information) the same description parameterskVolumeTexture- VolumeTexture-derived instance which contains the texture properties. This description parameters for the volume associated with this instance must match the parameters for which this node and its geometry.
-
NodeVolumeTextureRender
public NodeVolumeTextureRender(ModelImage image, VolumeTexture kVolumeTexture, int iAxis, boolean bIncreasingOrder) Create the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.- Parameters:
image- reference to the image volume (data and header information) the same description parameterskVolumeTexture- VolumeTexture-derived instance which contains the texture properties. This description parameters for the volume associated with this instance must match the parameters for which this node and its geometry.iAxis- one of AXIS_X, AXIS_Y, or AXIS_Z which selects the axis of slicingbIncreasingOrder- true to select order of slices by increasing coordinate; false to select decreasing
-
-
Method Details
-
dispose
public void dispose()Clean up memory of this class. -
getAxisSlice
public int getAxisSlice()Return which axis has been currently selected for slicing the volume for rendering.- Returns:
- the current axis for slicing the volume for rendering.
-
getIncreasingOrder
public boolean getIncreasingOrder()Return the increasing order flag.- Returns:
- the increasing/decreasing slice order flag.
-
updateOpacity
public void updateOpacity(int iValue) Not used at the moment. Update the opacity from the relate opacity change slider- Parameters:
iValue- Opacity value from the opacity slider
-
updateSlicing
public void updateSlicing(javax.vecmath.Vector3d kViewDir) Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.- Parameters:
kViewDir- view direction vector in virtual world coordinates
-
updateView
public void updateView(javax.media.j3d.Transform3D kViewTransform) Automatically call selectSlices with the correct axis (X, Y, or Z) and increasing/decreasing coordinate order flag based on the specified view direction vector such that the slices are rendered back to front for the plane which is most parallel to the view plane.- Parameters:
kViewTransform- current view transform in virtual world coordinates
-
finalize
Used to call dispose of this class to clean up memory. -
init
Initialize the scene graph node for the rendering of the volume data, everything except the textures from the volume data to be applied to the slices through the volume.- Parameters:
image- reference to the image volume (data and header information) the same description parameterskVolumeTexture- VolumeTexture-derived instance which contains the texture properties. This description parameters for the volume associated with this instance must match the parameters for which this node and its geometry.
-
selectSlices
private void selectSlices(int iAxis, boolean bIncreasingOrder) Select along which axis and in which direction slicing in the volume is to be performed. THIS METHOD SHOULD BE MADE PRIVATE IN THE FINAL RELEASE.- Parameters:
iAxis- one of AXIS_X, AXIS_Y, or AXIS_Z which selects the axis of slicingbIncreasingOrder- true to select order of slices by increasing coordinate; false to select decreasing- Throws:
IllegalArgumentException- DOCUMENT ME!
-