Class VolumeTriPlanarRender

java.lang.Object
WildMagic.LibApplications.OpenGLApplication.Application
WildMagic.LibApplications.OpenGLApplication.JavaApplication
WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
All Implemented Interfaces:
com.jogamp.opengl.GLEventListener, SpaceNavigatorListener, NavigationBehavior.Callback, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, Serializable, EventListener, ChangeListener
Direct Known Subclasses:
VolumeTriPlanerRenderDTI

public class VolumeTriPlanarRender extends VolumeTriPlanarRenderBase implements com.jogamp.opengl.GLEventListener, KeyListener, MouseMotionListener, MouseListener, NavigationBehavior.Callback
See Also:
  • Field Details

  • Constructor Details

    • VolumeTriPlanarRender

      public VolumeTriPlanarRender(VolumeTriPlanarInterface kParent, com.jogamp.opengl.util.Animator kAnimator, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
      Construct the Volume/Surface/Tri-Planar renderer.
      Parameters:
      kParent - parent user-interface and frame.
      kAnimator - animator used to display the canvas.
      kVolumeImageA - volume data and textures for ModelImage A.
      kVolumeImageB - volume data and textures for ModelImage B.
    • VolumeTriPlanarRender

      public VolumeTriPlanarRender(VolumeTriPlanarRender kShared, com.jogamp.opengl.awt.GLCanvas kCanvas, VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
      Construct the Volume/Surface/Tri-Planar renderer.
      Parameters:
      kParent - parent user-interface and frame.
      kVolumeImageA - volume data and textures for ModelImage A.
      kVolumeImageB - volume data and textures for ModelImage B.
      kAnimator - animator used to display the canvas.
    • VolumeTriPlanarRender

      public VolumeTriPlanarRender(VolumeTriPlanarInterface kParent, VolumeImage kVolumeImageA, VolumeImage kVolumeImageB)
      Construct the Volume/Surface/Tri-Planar renderer.
      Parameters:
      kVolumeImageA - volume data and textures for ModelImage A.
      kVolumeImageB - volume data and textures for ModelImage B.
    • VolumeTriPlanarRender

      public VolumeTriPlanarRender(VolumeImage[] images, WildMagic.LibGraphics.Rendering.Texture colormap)
  • Method Details

    • applySculpt

      public boolean applySculpt(boolean bAll)
      Apply the sculpt region to the volume.
      Overrides:
      applySculpt in class VolumeTriPlanarRenderBase
    • display

      public void display(com.jogamp.opengl.GLAutoDrawable arg0)
      Specified by:
      display in interface com.jogamp.opengl.GLEventListener
      Overrides:
      display in class VolumeTriPlanarRenderBase
    • addConfiguredListener

      public void addConfiguredListener(RendererListener listener)
    • dispose

      public void dispose(com.jogamp.opengl.GLAutoDrawable kDrawable)
      Description copied from class: GPURenderBase
      memory cleanup.
      Specified by:
      dispose in interface com.jogamp.opengl.GLEventListener
      Overrides:
      dispose in class VolumeTriPlanarRenderBase
    • setVOILatticeManager

      public void setVOILatticeManager(VOILatticeManagerInterface newVOIInterface)
    • clear3DSelection

      public void clear3DSelection()
    • annotationPrefix

      public String annotationPrefix()
    • doAutomaticLabels

      public boolean doAutomaticLabels()
    • is3DSelectionEnabled

      public boolean is3DSelectionEnabled()
    • isEditAnnotations

      public boolean isEditAnnotations()
    • deleteSelectedPoint

      public void deleteSelectedPoint()
    • moveSelectedPoint

      public void moveSelectedPoint(WildMagic.LibFoundation.Mathematics.Vector3f direction)
    • hasSelectedPoint

      public boolean hasSelectedPoint()
    • keyPressed

      public void keyPressed(KeyEvent e)
      Part of the KeyListener interface. Pressing 'b' toggles displaying the proxy-geometry versus the ray-traced volume.
      Specified by:
      keyPressed in interface KeyListener
      Overrides:
      keyPressed in class VolumeTriPlanarRenderBase
      Parameters:
      e - the key event.
    • keyReleased

      public void keyReleased(KeyEvent e)
      Specified by:
      keyReleased in interface KeyListener
      Overrides:
      keyReleased in class WildMagic.LibApplications.OpenGLApplication.JavaApplication3D
    • mousePressed

      public void mousePressed(MouseEvent e)
      Description copied from class: VolumeTriPlanarRenderBase
      Rotates the object with a virtual trackball:
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class VolumeTriPlanarRenderBase
      Parameters:
      e - the MouseEvent
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Description copied from class: VolumeTriPlanarRenderBase
      Rotates the object with a virtual trackball:
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class VolumeTriPlanarRenderBase
      Parameters:
      e - the MouseEvent
    • setDefaultCursor

      public void setDefaultCursor()
    • select3DMarker

      public boolean select3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt, boolean rightMouse, boolean multiSelect)
    • modify3DMarker

      public boolean modify3DMarker(WildMagic.LibFoundation.Mathematics.Vector3f startPt, WildMagic.LibFoundation.Mathematics.Vector3f endPt, WildMagic.LibFoundation.Mathematics.Vector3f pt)
    • add3DMarker

      public void add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect, boolean isShift)
    • add3DMarker

      public void add3DMarker(VOI textVOI, boolean automaticLabel, boolean multiSelect)
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Rotates the object with a virtual trackball:
      Specified by:
      mouseDragged in interface MouseMotionListener
      Overrides:
      mouseDragged in class VolumeTriPlanarRenderBase
      Parameters:
      e - the MouseEvent
    • processRightMouseDrag

      private void processRightMouseDrag(MouseEvent kEvent)
      If the right mouse button is pressed and dragged. processRightMouseDrag updates the HistoLUT window and level (contrast and brightness)
      Parameters:
      kEvent - the mouse event generated by a mouse drag
    • setWindowLevel

      private void setWindowLevel(float fX, float fY, boolean first)
    • undoSculpt

      public void undoSculpt(boolean bAll)
      Undo applying the sculpt region to the volume.
      Overrides:
      undoSculpt in class VolumeTriPlanarRenderBase
    • CreateScene

      protected void CreateScene()
      Called by the init() function. Creates and initialized the scene-graph.
      Overrides:
      CreateScene in class VolumeTriPlanarRenderBase
    • reCreateScene

      public void reCreateScene(VolumeImage image)
      Description copied from class: VolumeTriPlanarRenderBase
      Called by the init() function. Creates and initialized the scene-graph.
      Overrides:
      reCreateScene in class VolumeTriPlanarRenderBase
    • Pick

      protected void Pick()
      Picking. If a display list object has picking enabled, find the picked polygon based on the mouse position.
      Overrides:
      Pick in class VolumeTriPlanarRenderBase
    • PickVolume3D

      private void PickVolume3D(WildMagic.LibFoundation.Mathematics.Vector3f kPos, WildMagic.LibFoundation.Mathematics.Vector3f kDir, WildMagic.LibFoundation.Mathematics.Vector3f maxPt)
    • PickSlice3D

      private boolean PickSlice3D(WildMagic.LibFoundation.Mathematics.Vector3f kPos, WildMagic.LibFoundation.Mathematics.Vector3f kDir, WildMagic.LibFoundation.Mathematics.Vector3f maxPt)
    • update4D

      protected void update4D(boolean bForward)
      Overrides:
      update4D in class VolumeTriPlanarRenderBase
    • updateVOIs

      public void updateVOIs()
    • updateVOIs

      protected void updateVOIs(VOIVector kVOIs)
      Overrides:
      updateVOIs in class VolumeTriPlanarRenderBase
    • addSphere

      private void addSphere(WildMagic.LibFoundation.Mathematics.Vector3f center, int index)
    • toggleNavigation

      public void toggleNavigation(boolean _isNavigationEnabled)
      Toggle Navigation mode.
      Overrides:
      toggleNavigation in class VolumeTriPlanarRenderBase
      Parameters:
      _isNavigationEnabled - is Navigation checkbox selected or not.
      isNavigationEnabled - is navigation checkbox selected or not.
    • setPathPlanningFlythru

      public void setPathPlanningFlythru(boolean _isPathPlanning)
    • setMouseControlFlythru

      public void setMouseControlFlythru(boolean _isMouseControl)
    • setAnnotationMode

      public void setAnnotationMode(boolean _isAnnotateEnabled)
    • setupNavigationScenegraph

      public void setupNavigationScenegraph()
      Setup the Navigation scene graph view for debugging purpose
    • viewChanged

      public void viewChanged(NavigationBehavior behavior, int iEvent)
      Navigation behavior callback handler
      Specified by:
      viewChanged in interface NavigationBehavior.Callback
      Parameters:
      behavior - reference to this MjFlyPathBehavior in which the view changed.
      iEvent - Bitmask identifies the event(s) which caused the view to change. Bitmask created from OR of EVENT_* defintions.
    • getPositionScaled

      public WildMagic.LibFoundation.Mathematics.Vector3f getPositionScaled(WildMagic.LibFoundation.Mathematics.Vector3f kPoint)
      Scaled coordinates for the current position along the path for viewing.
      Parameters:
      Point - in normalized path coordinates.
      Returns:
      Point3f A new instance created which contains the path position coordinates, scaled to match the TriMesh in JPanelSurface.
    • update4DVOIs

      protected void update4DVOIs(boolean bForward)
      Overrides:
      update4DVOIs in class VolumeTriPlanarRenderBase
    • animateAlgorithm

      private void animateAlgorithm()
    • addAnimationVOIs

      public void addAnimationVOIs(VOIVector vois, JPanelAnnotationAnimation annotationAnimationPanel)
    • addSphereVOIs

      public void addSphereVOIs(VOI annotations)
      Overrides:
      addSphereVOIs in class VolumeTriPlanarRenderBase
    • displayedNeurite

      private boolean displayedNeurite(String neuriteName)
    • updateNeurite

      private void updateNeurite(String neuriteName, String[] names, WildMagic.LibFoundation.Mathematics.ColorRGB color)
    • updateContour

      private void updateContour(VOIContour contour, VOI positions, String[] names)
    • displayNeurite

      public void displayNeurite(String neuriteName, boolean display)
    • setNeuriteColor

      public void setNeuriteColor(String neuriteName, WildMagic.LibFoundation.Mathematics.ColorRGB color)
    • addNeurite

      public void addNeurite(String neuriteName, String[] names, WildMagic.LibFoundation.Mathematics.ColorRGB color)
    • setAnnotationVOIColor

      public void setAnnotationVOIColor(String name, WildMagic.LibFoundation.Mathematics.ColorRGB color)
      Overrides:
      setAnnotationVOIColor in class VolumeTriPlanarRenderBase
    • setDisplayAnnotation

      public void setDisplayAnnotation(String name, boolean display)
    • getAnnotationInfo

      public void getAnnotationInfo(String name, boolean[] display, Color[] color, float[] diameter, boolean[] displayLabel, Color[] labelColor)
    • setAnnotationDiameter

      public void setAnnotationDiameter(String name, float diameter)
    • getSelectedVOI

      public VOI getSelectedVOI(String name)
    • setDisplayAnnotationLabel

      public void setDisplayAnnotationLabel(String name, boolean display)
    • smoothCurve

      private WildMagic.LibFoundation.Curves.NaturalSpline3 smoothCurve(VOIContour curve, float[] time)
    • createTube

      private WildMagic.LibGraphics.Surfaces.TubeSurface createTube(VOIContour neurite)
    • createNeuriteSurface

      private WildMagic.LibGraphics.SceneGraph.TriMesh createNeuriteSurface(VOIContour neurite, WildMagic.LibFoundation.Mathematics.ColorRGB color, float radius)
    • play4DVOIs

      public void play4DVOIs(boolean bOn)
      Overrides:
      play4DVOIs in class VolumeTriPlanarRenderBase
    • writeImage

      public boolean writeImage()
      Description copied from class: GPURenderBase
      Writes a the frame buffer as a .jpg image to disk. The file name is captureImage + the image number.
      Overrides:
      writeImage in class GPURenderBase
      Returns:
      true on successful write.
    • annotationVOIsUpdate

      public void annotationVOIsUpdate(int value)
    • UpdateSceneRotation

      protected void UpdateSceneRotation()
      Description copied from class: GPURenderBase
      Updates the displayed objects based on any user mouse rotation.
      Overrides:
      UpdateSceneRotation in class VolumeTriPlanarRenderBase
    • updateSceneNodePoint

      public void updateSceneNodePoint(String name, WildMagic.LibFoundation.Mathematics.Vector3f position)
      Currently only being used to update the picking point
      Parameters:
      name - surface name
      position - surface location
    • updateSlicesCenter

      public void updateSlicesCenter(WildMagic.LibFoundation.Mathematics.Vector3f loc)
      Update the bottom 3 planar view center
    • setCameraCenter

      public void setCameraCenter(WildMagic.LibFoundation.Mathematics.Vector3f kCenter)
      Update the camera in 3D view window.
      Parameters:
      kCenter - center in image space
    • addAnnotationPoint

      public void addAnnotationPoint(WildMagic.LibFoundation.Mathematics.Vector3f point, WildMagic.LibFoundation.Mathematics.Vector3f scannerPt)
      Add the annotation point
      Parameters:
      point -
    • setCameraViewRotationDegree

      public void setCameraViewRotationDegree(int degree)
      Set camera view rotation degree
      Parameters:
      degree -
    • generatePath

      public void generatePath()
      Generate the path planning path.
    • clearPath

      public void clearPath()
      Clear the annotated path
    • createBranchPathGeometryScaled

      private WildMagic.LibGraphics.SceneGraph.Polyline createBranchPathGeometryScaled(int iBranch)
      Translate the path points from image coordinate to view volume coordinate.
      Parameters:
      iBranch -
      Returns:
    • createAnnotatePoint

      private void createAnnotatePoint(WildMagic.LibFoundation.Mathematics.Vector3f kPosition)
      Create a new Annotation point at the position specified.
      Parameters:
      kPosition - position of new annotation point.