Class VolumeDTI
- java.lang.Object
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
-
- gov.nih.mipav.view.renderer.WildMagic.Render.VolumeDTI
-
public class VolumeDTI extends VolumeObject
Displays the Diffusion Tensor tracts in the VolumeViewer.- See Also:
VolumeObject.java
,GPUVolumeRender.java
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.HashMap<java.lang.Integer,WildMagic.LibFoundation.Mathematics.ColorRGB>
constantColor
Randomly add group color.private boolean
isUsingVolumeColor
flag to indicate to use volume color or notprivate boolean
m_bDisplayAllGlyphs
When true display the DTI volume with glyphs:private boolean
m_bDisplayArrows
When true display the fiber tracts with arrows instead of lines:private boolean
m_bDisplayCylinders
When true display the fiber tracts with cylinders instead of lines:private boolean
m_bDisplayEllipsoids
When true display the fiber tracts with ellipsoids instead of lines:private boolean
m_bDisplayTubes
When true display the fiber tracts with tubes instead of lines:private float
m_fScale
Ellipsoids scale factor, based on the DTI volume:private int
m_iDimX
The DTI volume extents:private int
m_iDimY
The DTI volume extents:private int
m_iDimZ
The DTI volume extents:private int
m_iEllipsoidMod
In the display all ellipsoids mode the ellipsoids are displayed every m_iEllipsoidMod steps.private int
m_iMaxGroups
maximum number of fiber tracts currently displayed.private WildMagic.LibGraphics.SceneGraph.Node
m_kArrow
arrow glyphsprivate WildMagic.LibFoundation.Mathematics.ColorRGB
m_kColorEllipse
Volume-based color for the ellipsoids:private WildMagic.LibGraphics.SceneGraph.TriMesh
m_kCylinder
Cylinders is a sphere with a non-uniform scale based on the eigen vectors and values.(package private) ModelImage
m_kEigenValue
(package private) ModelImage
m_kEigenVector
EigenVector values for displaying ellipsoids.private WildMagic.LibGraphics.Rendering.MaterialState
m_kEllipseMaterial
Material properties of the ellipsoids.private java.util.HashMap<java.lang.Integer,java.util.Vector<VOIContour>>
m_kGlyphs
Hashmap for multiple fiber bundles:private SurfaceLightingEffect
m_kLightShader
private WildMagic.LibGraphics.Rendering.MaterialState
m_kLinesMaterial
Material properties of the tract lines.private java.util.HashMap<java.lang.Integer,VolumePreRenderEffect[]>
m_kShaders
Hashmap for multiple fiber bundles:private WildMagic.LibGraphics.SceneGraph.TriMesh
m_kSphere
Ellipsoids is a sphere with a non-uniform scale based on the eigen vectors and values.private java.util.HashMap<java.lang.Integer,WildMagic.LibGraphics.SceneGraph.Node>
m_kTracts
Hashmap for multiple fiber bundles:private java.util.HashMap<java.lang.Integer,WildMagic.LibGraphics.SceneGraph.Node>
m_kTubes
Hashmap for multiple tube type fiber bundles:private WildMagic.LibGraphics.Rendering.MaterialState
m_kTubesMaterial
Material properties of the Tubes.-
Fields inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
m_bDisplay, m_bPickable, m_bTransparent, m_fVolumeDiv, m_fVolumeMult, m_fX, m_fY, m_fZ, m_kAlpha, m_kAlphaTransparency, m_kCull, m_kDeleteList, m_kLocalScale, m_kPolygonOffset, m_kResolutions, m_kScene, m_kTranslate, m_kVolumeImageA, m_kVolumeImageB, m_kVolumeScale, m_kVolumeTrans, m_kWireframe, m_kZBuffer, m_kZBufferTransparency
-
-
Constructor Summary
Constructors Constructor Description VolumeDTI(VolumeImage kVolumeImage, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Creates a new VolumeDTI object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPolyline(VOIContour kContour, WildMagic.LibGraphics.SceneGraph.Polyline kLine, int iGroup)
Add a polyline to the display.private void
createScene()
WildMagic.LibGraphics.Surfaces.TubeSurface
createTube(WildMagic.LibGraphics.SceneGraph.Polyline kTract)
Generate the tube streamline from the given polyline.private void
DisplayGlyphs(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)
Display a fiber bundle tract with a Glyph.private void
DisplayTract(WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender, boolean bSolid)
Displays a polyline fiber bundle tract with the given shader attached.private void
DisplayTubes(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)
Displays a tube fiber bundle tract with the given shader attached.void
dispose()
memory cleanup.boolean
GetDisplayTract()
Returns if there are tracts to display.WildMagic.LibFoundation.Mathematics.ColorRGB
getGroupColor(int iGroup)
Get the group color with given group ID.java.util.Vector<VOIContour>
getPolylines(int iGroup)
private void
MakeArrow()
void
removePolyline(int iGroup)
Removes the specified polyline tract group.void
Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.void
setDisplayAllGlyphs(boolean bDisplay)
Turns on/off displaying all the glyphs.void
setDisplayArrows(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with 3d arrows.void
setDisplayCylinders(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with cylinders.void
setDisplayEllipsoids(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with ellipsoids.void
setDisplayTubes(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with tubes.void
setDTIImage(ModelImage kDTIImage, ModelImage kEigenVectorImage, ModelImage kEigenValueImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Sets the DTI Image for displaying the tensors as ellipsoids.void
setEllipseMod(int iMod)
Set the m_iEllipsoidMod value.void
SetLight(java.lang.String kLightType, float[] afType)
Sets the light for the EllipsoidsShader.void
setPolylineColor(int iGroup, WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
Sets the polyline color for the specified fiber bundle tract group.void
setVolumeColor(boolean flag)
Set the flag to using volume color or not-
Methods inherited from class gov.nih.mipav.view.renderer.WildMagic.Render.VolumeObject
Blend, dispose, Dropper, Erase, GetBackface, getDepth, GetDisplay, GetMesh, GetName, GetPickable, GetPolygonMode, GetScene, getTexCoord, GetTranslate, localToScannerCoords, localToVolumeCoords, Paint, PostRender, scale, SetBackface, SetColor, SetDisplay, SetFrontface, setImageB, SetPickable, SetPolygonMode, SetTranslate, Translate, volumeToLocalCoords
-
-
-
-
Field Detail
-
m_kTracts
private java.util.HashMap<java.lang.Integer,WildMagic.LibGraphics.SceneGraph.Node> m_kTracts
Hashmap for multiple fiber bundles:
-
m_kTubes
private java.util.HashMap<java.lang.Integer,WildMagic.LibGraphics.SceneGraph.Node> m_kTubes
Hashmap for multiple tube type fiber bundles:
-
m_kShaders
private java.util.HashMap<java.lang.Integer,VolumePreRenderEffect[]> m_kShaders
Hashmap for multiple fiber bundles:
-
m_kGlyphs
private java.util.HashMap<java.lang.Integer,java.util.Vector<VOIContour>> m_kGlyphs
Hashmap for multiple fiber bundles:
-
m_bDisplayEllipsoids
private boolean m_bDisplayEllipsoids
When true display the fiber tracts with ellipsoids instead of lines:
-
m_bDisplayAllGlyphs
private boolean m_bDisplayAllGlyphs
When true display the DTI volume with glyphs:
-
m_iEllipsoidMod
private int m_iEllipsoidMod
In the display all ellipsoids mode the ellipsoids are displayed every m_iEllipsoidMod steps.
-
m_bDisplayCylinders
private boolean m_bDisplayCylinders
When true display the fiber tracts with cylinders instead of lines:
-
m_bDisplayTubes
private boolean m_bDisplayTubes
When true display the fiber tracts with tubes instead of lines:
-
m_bDisplayArrows
private boolean m_bDisplayArrows
When true display the fiber tracts with arrows instead of lines:
-
m_kLightShader
private SurfaceLightingEffect m_kLightShader
-
m_kEllipseMaterial
private WildMagic.LibGraphics.Rendering.MaterialState m_kEllipseMaterial
Material properties of the ellipsoids.
-
m_kTubesMaterial
private WildMagic.LibGraphics.Rendering.MaterialState m_kTubesMaterial
Material properties of the Tubes.
-
m_kLinesMaterial
private WildMagic.LibGraphics.Rendering.MaterialState m_kLinesMaterial
Material properties of the tract lines.
-
m_kEigenVector
ModelImage m_kEigenVector
EigenVector values for displaying ellipsoids.
-
m_kEigenValue
ModelImage m_kEigenValue
-
m_kSphere
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kSphere
Ellipsoids is a sphere with a non-uniform scale based on the eigen vectors and values.
-
m_kCylinder
private WildMagic.LibGraphics.SceneGraph.TriMesh m_kCylinder
Cylinders is a sphere with a non-uniform scale based on the eigen vectors and values.
-
m_iDimX
private int m_iDimX
The DTI volume extents:
-
m_iDimY
private int m_iDimY
The DTI volume extents:
-
m_iDimZ
private int m_iDimZ
The DTI volume extents:
-
m_fScale
private float m_fScale
Ellipsoids scale factor, based on the DTI volume:
-
m_kColorEllipse
private WildMagic.LibFoundation.Mathematics.ColorRGB m_kColorEllipse
Volume-based color for the ellipsoids:
-
m_iMaxGroups
private int m_iMaxGroups
maximum number of fiber tracts currently displayed.
-
isUsingVolumeColor
private boolean isUsingVolumeColor
flag to indicate to use volume color or not
-
m_kArrow
private WildMagic.LibGraphics.SceneGraph.Node m_kArrow
arrow glyphs
-
constantColor
private java.util.HashMap<java.lang.Integer,WildMagic.LibFoundation.Mathematics.ColorRGB> constantColor
Randomly add group color.
-
-
Constructor Detail
-
VolumeDTI
public VolumeDTI(VolumeImage kVolumeImage, WildMagic.LibFoundation.Mathematics.Vector3f kTranslate, float fX, float fY, float fZ)
Creates a new VolumeDTI object.- Parameters:
kImageA
- the VolumeImage containing shared data and textures for rendering.kTranslate
- translation in the scene-graph for this object.fX
- the size of the volume in the x-dimension (extent * resolutions)fY
- the size of the volume in the y-dimension (extent * resolutions)fZ
- the size of the volume in the z-dimension (extent * resolutions)
-
-
Method Detail
-
addPolyline
public void addPolyline(VOIContour kContour, WildMagic.LibGraphics.SceneGraph.Polyline kLine, int iGroup)
Add a polyline to the display. Used to display an approximation fiber tract bundles.- Parameters:
kLine
- new polyline to display.iGroup
- the group the polyline belongs to.
-
createTube
public WildMagic.LibGraphics.Surfaces.TubeSurface createTube(WildMagic.LibGraphics.SceneGraph.Polyline kTract)
Generate the tube streamline from the given polyline.- Parameters:
kTract
- polyline of the medial path.- Returns:
- kTube Tube surface generated.
-
dispose
public void dispose()
memory cleanup.
-
GetDisplayTract
public boolean GetDisplayTract()
Returns if there are tracts to display.- Returns:
- true if there are tracts currently loaded, false otherwise.
-
getGroupColor
public WildMagic.LibFoundation.Mathematics.ColorRGB getGroupColor(int iGroup)
Get the group color with given group ID.- Parameters:
groupID
- given group id- Returns:
- ColorRGB group color
-
getPolylines
public java.util.Vector<VOIContour> getPolylines(int iGroup)
-
removePolyline
public void removePolyline(int iGroup)
Removes the specified polyline tract group.- Parameters:
iGroup
- the group of polylines to remove.
-
Render
public void Render(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)
Render the object.- Specified by:
Render
in classVolumeObject
- Parameters:
kRenderer
- the OpenGLRenderer object.kCuller
- the Culler object.
-
setDisplayAllGlyphs
public void setDisplayAllGlyphs(boolean bDisplay)
Turns on/off displaying all the glyphs.- Parameters:
bDisplay
- when true display all the glyphs in the volume.
-
setDisplayArrows
public void setDisplayArrows(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with 3d arrows.- Parameters:
bDisplay
- when true display the tracts with arrows.
-
setDisplayCylinders
public void setDisplayCylinders(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with cylinders.- Parameters:
bDisplay
- when true display the tracts with cylinders.
-
setDisplayEllipsoids
public void setDisplayEllipsoids(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with ellipsoids.- Parameters:
bDisplay
- when true display the tracts with ellipsods.
-
setDisplayTubes
public void setDisplayTubes(boolean bDisplay)
Turns on/off displaying the fiber bundle tracts with tubes.- Parameters:
bDisplay
- when true display the tracts with tubes.
-
setDTIImage
public void setDTIImage(ModelImage kDTIImage, ModelImage kEigenVectorImage, ModelImage kEigenValueImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer)
Sets the DTI Image for displaying the tensors as ellipsoids.- Parameters:
kDTIImage
- .
-
createScene
private void createScene()
-
setEllipseMod
public void setEllipseMod(int iMod)
Set the m_iEllipsoidMod value.- Parameters:
iMod
- new m_iEllipsoidMod value.
-
SetLight
public void SetLight(java.lang.String kLightType, float[] afType)
Sets the light for the EllipsoidsShader.- Overrides:
SetLight
in classVolumeObject
- Parameters:
kLightType
- the name of the light to set (Light0, Light1, etc.)afType
- the type of light (Ambient = 0, Directional = 1, Point = 2, Spot = 3).
-
setPolylineColor
public void setPolylineColor(int iGroup, WildMagic.LibFoundation.Mathematics.ColorRGB kColor)
Sets the polyline color for the specified fiber bundle tract group.- Parameters:
iGroup
- the fiber bundle group to set.kColor
- the new polyline color for the specified fiber bundle tract group.
-
setVolumeColor
public void setVolumeColor(boolean flag)
Set the flag to using volume color or not- Parameters:
flag
- true or false
-
DisplayGlyphs
private void DisplayGlyphs(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)
Display a fiber bundle tract with a Glyph.
-
DisplayTract
private void DisplayTract(WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender, boolean bSolid)
Displays a polyline fiber bundle tract with the given shader attached.- Parameters:
kInputStader
- shader to apply to the polyline.
-
DisplayTubes
private void DisplayTubes(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)
Displays a tube fiber bundle tract with the given shader attached.- Parameters:
kInputStader
- shader to apply to the tube.
-
MakeArrow
private void MakeArrow()
-
-