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

    Fields
    Modifier and Type
    Field
    Description
    private static final int
    DOCUMENT ME!
    private static final int
    Render selected planes in order of increasing/decreasing coordinate.
    private static final int
    Used to represent undefined AXIS_*.
    private static final int
    Render volume YZ planes in order of increasing/decreasing X.
    private static final int
    Render volume ZX planes in order of increasing/decreasing Y.
    private static final int
    Render volume XY planes in order of increasing/decreasing Z.
    private float
    Maximum voxel resolution of X, Y, Z.
    private float
    Voxel resolution in the X direction.
    private float
    Voxel resolution in the Y direction.
    private float
    Voxel resolution in the Z direction.
    private int
    Max Dimension of X, Y, and Z.
    private int
    X Dimension.
    private int
    Y Dimension.
    private int
    Z 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 boolean
    Render the slices by increasing or decreasing coordinate.
    private int
    Keep track of which direction along the currently selected slicing axis has been selected for rendering the slices.
    private int
    Keep track of which axis has been currently selected for slicing the volume for rendering.
    private javax.media.j3d.Appearance
    The same appearance properties used to render each slice.
    private javax.media.j3d.Switch
    This is the only node attached to the TransformGroup.

    Fields inherited from class javax.media.j3d.TransformGroup

    ALLOW_TRANSFORM_READ, ALLOW_TRANSFORM_WRITE

    Fields inherited from class javax.media.j3d.Group

    ALLOW_CHILDREN_EXTEND, ALLOW_CHILDREN_READ, ALLOW_CHILDREN_WRITE, ALLOW_COLLISION_BOUNDS_READ, ALLOW_COLLISION_BOUNDS_WRITE

    Fields 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

    Constructors
    Constructor
    Description
    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 Type
    Method
    Description
    void
    Clean up memory of this class.
    protected void
    Used to call dispose of this class to clean up memory.
    int
    Return which axis has been currently selected for slicing the volume for rendering.
    boolean
    Return the increasing order flag.
    private void
    init(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 void
    selectSlices(int iAxis, boolean bIncreasingOrder)
    Select along which axis and in which direction slicing in the volume is to be performed.
    void
    updateOpacity(int iValue)
    Not used at the moment.
    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.
    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.

    Methods inherited from class javax.media.j3d.TransformGroup

    cloneNode, getTransform, setTransform

    Methods inherited from class javax.media.j3d.Group

    addChild, getAllChildren, getAlternateCollisionTarget, getChild, getCollisionBounds, indexOfChild, insertChild, moveTo, numChildren, removeAllChildren, removeChild, removeChild, setAlternateCollisionTarget, setChild, setCollisionBounds

    Methods 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, setPickable

    Methods inherited from class javax.media.j3d.SceneGraphObject

    clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences

    Methods inherited from class java.lang.Object

    clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • AXIS_UNDEFINED

      private static final int AXIS_UNDEFINED
      Used to represent undefined AXIS_*.
      See Also:
    • AXIS_X

      private static final int AXIS_X
      Render volume YZ planes in order of increasing/decreasing X. Parameter to selectSlices method.
      See Also:
    • AXIS_Y

      private static final int AXIS_Y
      Render volume ZX planes in order of increasing/decreasing Y. Parameter to selectSlices method.
      See Also:
    • AXIS_Z

      private static final int AXIS_Z
      Render volume XY planes in order of increasing/decreasing Z. Parameter to selectSlices method.
      See Also:
    • AXIS_INC

      private static final int AXIS_INC
      Render selected planes in order of increasing/decreasing coordinate.
      See Also:
    • AXIS_DEC

      private static final int AXIS_DEC
      DOCUMENT ME!
      See Also:
    • fMax

      private float fMax
      Maximum voxel resolution of X, Y, Z.
    • fMaxX

      private float fMaxX
      Voxel resolution in the X direction.
    • fMaxY

      private float fMaxY
      Voxel resolution in the Y direction.
    • fMaxZ

      private float fMaxZ
      Voxel resolution in the Z direction.
    • iDimMax

      private int iDimMax
      Max Dimension of X, Y, and Z.
    • iDimX

      private int iDimX
      X Dimension.
    • iDimY

      private int iDimY
      Y Dimension.
    • iDimZ

      private int iDimZ
      Z Dimension.
    • m_aaaiOrderedGroupChildIndexOrder

      private final int[][][] m_aaaiOrderedGroupChildIndexOrder
      This 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_akOrderedGroupNodeSlices
      The 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_bIncreasingOrder
      Render the slices by increasing or decreasing coordinate.
    • m_iAxisDirection

      private int m_iAxisDirection
      Keep track of which direction along the currently selected slicing axis has been selected for rendering the slices.
    • m_iAxisSlice

      private int m_iAxisSlice
      Keep track of which axis has been currently selected for slicing the volume for rendering.
    • m_kAppearance

      private javax.media.j3d.Appearance m_kAppearance
      The same appearance properties used to render each slice.
    • m_kSwitch

      private javax.media.j3d.Switch m_kSwitch
      This 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

      public NodeVolumeTextureRender(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.
      Parameters:
      image - reference to the image volume (data and header information) the same description parameters
      kVolumeTexture - 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 parameters
      kVolumeTexture - 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 slicing
      bIncreasingOrder - 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

      protected void finalize() throws Throwable
      Used to call dispose of this class to clean up memory.
      Overrides:
      finalize in class Object
      Throws:
      Throwable - DOCUMENT ME!
    • init

      private void init(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.
      Parameters:
      image - reference to the image volume (data and header information) the same description parameters
      kVolumeTexture - 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 slicing
      bIncreasingOrder - true to select order of slices by increasing coordinate; false to select decreasing
      Throws:
      IllegalArgumentException - DOCUMENT ME!