Class RenderViewBase

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
All Implemented Interfaces:
com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback, ViewImageUpdateInterface, ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ChangeListener
Direct Known Subclasses:
MjCorticalAnalysis, SurfacePlotter, SurfaceRender, VolumeRenderer

public abstract class RenderViewBase extends VolumeCanvas3D implements ViewImageUpdateInterface, ActionListener, com.sun.j3d.utils.behaviors.mouse.MouseBehaviorCallback, ChangeListener
This is an abstract class. This class defines the basic functionality of the renders, such as the LUT and bounding box and image rotation, etc. It was extended by the surface render, surface plotter and the volume render.
Version:
0.1 Oct 1, 1998
Author:
Matthew J. McAuliffe, Ph.D.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Use serialVersionUID for interoperability.
      See Also:
    • IMAGE_A

      public static final int IMAGE_A
      Display mode image A.
      See Also:
    • IMAGE_B

      public static final int IMAGE_B
      Display mode image B.
      See Also:
    • m_kZeroVector

      private static final javax.vecmath.Vector3f m_kZeroVector
      Set the zero vector.
    • m_iNumVoxels

      private static int m_iNumVoxels
      Image volume size and x, y, z extents.
    • m_iSizeX

      private static int m_iSizeX
      Image volume size and x, y, z extents.
    • m_iSizeY

      private static int m_iSizeY
      Image volume size and x, y, z extents.
    • m_iSizeZ

      private static int m_iSizeZ
      Image volume size and x, y, z extents.
    • akNormal

      private static javax.vecmath.Vector3f[] akNormal
      normal vector arrayes.
    • bounds

      public javax.media.j3d.BoundingSphere bounds
      A BoundingSphere that contains the entire scene. This bound is used for all scheduling, including lighting and mouse behaviors.
    • background

      protected javax.media.j3d.Background background
      The background node for the canvas.
    • boxFrame

      protected ViewJComponentBoxFrame boxFrame
      The outside box frame.
    • canvas

      protected VolumeCanvas3D canvas
      The Canvas3D object on which the surfaces are drawn and where the picking happens.
    • captureFrame

      protected ViewJFrameRenderCamera captureFrame
      Camera snapshot frame.
    • captureImage

      protected ModelImage captureImage
      The resulting ModelImage of the camera snapshot.
    • config

      protected GraphicsConfiguration config
      The config used to extends the Canvas3D class.
    • displayMode

      protected int displayMode
      Indicates which image is to be acted upon when two images are displayed.
    • imageA

      protected ModelImage imageA
      Reference to the image A of this frame.
    • imageB

      protected ModelImage imageB
      Reference to the image Bof this frame.
    • LUTa

      protected ModelLUT LUTa
      Reference to LUT for image A.
    • LUTb

      protected ModelLUT LUTb
      Reference to LUT for image B.
    • objBehaviorBG

      protected javax.media.j3d.BranchGroup objBehaviorBG
      The BranchGroup to which the standard behaviors are attached, zoom and rotate.
    • objBoxFrameBG

      protected javax.media.j3d.BranchGroup objBoxFrameBG
      Parent of the whole box frame.
    • objRootBG

      protected javax.media.j3d.BranchGroup objRootBG
      The BranchGroup root of the scene managed by the simple universe. The root has a single child, a TransformGroup, that manages all of the actual scene objects.
    • rotationAngle

      protected int rotationAngle
      Rotation angle when the camera takes snapshot.
    • rotationAxis

      protected int rotationAxis
      Rotation axis when the camera takes snapshot.
    • rotationControlPanel

      protected JPanelCamera rotationControlPanel
      Camera control dialog box.
    • rotationTimes

      protected int rotationTimes
      Number of rotation during the camera auto snapshotting.
    • rotationTotal

      protected int rotationTotal
      The total rotation degree, fixing one bug.
    • sceneRootTG

      protected javax.media.j3d.TransformGroup sceneRootTG
      A TransformGroup object to which all the scene objects are attached, including 3D images, surface, behavior, and lights.
    • transRotation

      protected javax.media.j3d.Transform3D transRotation
      transform rotation of the volume image during camera snapshot.
    • transRotationMatrix

      protected javax.media.j3d.Transform3D transRotationMatrix
      Rotation matrix.
    • triPlanarViewBG

      protected javax.media.j3d.BranchGroup triPlanarViewBG
      Triplanar view branch group, which hold the three plane view and the slice box frame view.
    • universe

      protected com.sun.j3d.utils.universe.SimpleUniverse universe
      The SimpleUniverse object which is the parent of everything else in the scene.
    • viewPanel

      protected JPanelView viewPanel
      View dialog associated with surface plotter or renderer.
    • sliderEvents

      protected MouseEventVector sliderEvents
      Slider events used by the mouse recorder.
  • Constructor Details

    • RenderViewBase

      public RenderViewBase(ModelImage _imageA, ModelImage _imageB, GraphicsConfiguration _config)
      Calls the constructor for ViewJFrameBase with the same parameters.
      Parameters:
      _imageA - The current image A.
      _imageB - The current image B, or null if there isn't one.
      _config - The graphics config to use when rendering
  • Method Details

    • getSceneState

      public abstract Object getSceneState()
      Gets the scene state in terms of slices visible, which slice number, etc.
      Returns:
      A private object extension specific to the class that extends this one.
    • setAlphaBlend

      public abstract void setAlphaBlend(int value)
      Sets the alpha blending of parameter for two image displaying.
      Parameters:
      value - amount [0,100] that is the percentage of Image A to be displayed and (1-percentage) of Image B to be displayed
    • setGUI

      public abstract void setGUI(Object scene)
      Used by the JPanelMouse the redisplay the recorded actions.
      Parameters:
      scene - Object
    • setRGBTA

      public abstract void setRGBTA(ModelRGB RGBT)
      Set the RGB table of imageA. Method will be extended in renders.
      Parameters:
      RGBT - the rgb table to use for image A
    • setRGBTB

      public abstract void setRGBTB(ModelRGB RGBT)
      Get the RGB table of imageB. Method will be extended in renders.
      Parameters:
      RGBT - the rgb table to use for image B
    • getNormals

      public static final javax.vecmath.Vector3f[] getNormals()
      Get the normal vector arrays.
      Returns:
      Vector3f[] normal vector array.
    • autoCapture

      public void autoCapture()
      Calculate the rotation matrix when the auto camera caputuring the images.
    • calcImageNormals

      public javax.vecmath.Vector3f[] calcImageNormals()
      Create array of normal vectors corresponding to the voxels in the volume. The normal vector is computed based on the gradient of the volume intensity values.
      Returns:
      DOCUMENT ME!
    • disableCamera

      public void disableCamera()
      Set the captureFrame to null.
    • disposeLocal

      public void disposeLocal()
      Clean memory.
    • getBehaviorGroup

      public javax.media.j3d.BranchGroup getBehaviorGroup()
      Accessor for the branch group that holds the mouse behavior.
      Returns:
      The mouse behavior's branch group.
    • getBound

      public javax.media.j3d.BoundingSphere getBound()
      Accessor for the bounds sphere.
      Returns:
      bounding sphere
    • getBranchGroup

      public javax.media.j3d.BranchGroup getBranchGroup()
      Accessor for the branch group of this 3D object, the parent of the transform group.
      Returns:
      The branch group parent of the scene.
    • getCanvas

      public javax.media.j3d.Canvas3D getCanvas()
      Accessor for the canvas for this 3D object.
      Returns:
      The canvas for the scene.
    • getImageA

      public ModelImage getImageA()
      Accessor that returns the reference to image A.
      Returns:
      Image A.
    • getImageB

      public ModelImage getImageB()
      Accessor that returns the reference to image B.
      Returns:
      Image B.
    • getRGBTA

      public ModelRGB getRGBTA()
      Get the RGB table of imageA. Method will be extended in renders.
      Returns:
      rgb table for image A
    • getRGBTB

      public ModelRGB getRGBTB()
      Get the RGB table of imageB. Method will be extended in renders.
      Returns:
      rgb table for image B
    • getSceneRootTG

      public javax.media.j3d.TransformGroup getSceneRootTG()
      Accessor for the transform group of the scene, which is the parent of everything displayed.
      Returns:
      The transform group of the scene.
    • getTriPlanarViewBG

      public javax.media.j3d.BranchGroup getTriPlanarViewBG()
      Return the triplanar view branch group.
      Returns:
      triPlanarViewBG the triplanar view branch group
    • getUniverse

      public com.sun.j3d.utils.universe.SimpleUniverse getUniverse()
      Accessor for the universe for this 3D object.
      Returns:
      The universe for the scene.
    • resetAxisX

      public void resetAxisX()
      Reset the image volume to the original position.
    • resetAxisY

      public void resetAxisY()
      Reset the image volume to the original position.
    • resetImage

      public void resetImage()
      Reset the image volume to the original position.
    • rotateImage

      public void rotateImage()
      Rotates the image volume when the camera manually takes snapshot.
    • setBackgroundColor

      public void setBackgroundColor(Color color)
      Sets the color of the background.
      Parameters:
      color - Color to set to.
    • setBoxColor

      public void setBoxColor(Color color)
      Sets the color of the box frame.
      Parameters:
      color - Color to set to.
    • setRotationAngle

      public void setRotationAngle(int value)
      Set the rotation angle with the camera takes snapshot.
      Parameters:
      value - angle value
    • setRotationAxis

      public void setRotationAxis(int axis)
      Set the roation axis ( X, Y, Z Axis ) when the camera takes snapshot.
      Parameters:
      axis - X_AXIS, Y_AXIS or Z_AXIS.
    • writeImage

      public boolean writeImage()
      Write the image from the rendering frame into the camera capture frame.
      Returns:
      succeed true means succeed, false means unsucceed.
    • writeImageAuto

      public void writeImageAuto()
      Called when the camera button is clicked. This method brings up the camera control dialog.
    • createBoxFrame

      protected void createBoxFrame(float xBox, float yBox, float zBox)
      Creates a new box frame with the given dimensions.
      Parameters:
      xBox - X dimension of box frame.
      yBox - Y dimension of box frame.
      zBox - Z dimension of box frame.
    • getSliderEvents

      public MouseEventVector getSliderEvents()
    • recordMouse

      public void recordMouse(String name, JPanelMouse myMouseDialog, int mouseMode)
      Unchanged.
      Parameters:
      event - Original mouse event.