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>constantColorRandomly add group color.private booleanisUsingVolumeColorflag to indicate to use volume color or notprivate booleanm_bDisplayAllGlyphsWhen true display the DTI volume with glyphs:private booleanm_bDisplayArrowsWhen true display the fiber tracts with arrows instead of lines:private booleanm_bDisplayCylindersWhen true display the fiber tracts with cylinders instead of lines:private booleanm_bDisplayEllipsoidsWhen true display the fiber tracts with ellipsoids instead of lines:private booleanm_bDisplayTubesWhen true display the fiber tracts with tubes instead of lines:private floatm_fScaleEllipsoids scale factor, based on the DTI volume:private intm_iDimXThe DTI volume extents:private intm_iDimYThe DTI volume extents:private intm_iDimZThe DTI volume extents:private intm_iEllipsoidModIn the display all ellipsoids mode the ellipsoids are displayed every m_iEllipsoidMod steps.private intm_iMaxGroupsmaximum number of fiber tracts currently displayed.private WildMagic.LibGraphics.SceneGraph.Nodem_kArrowarrow glyphsprivate WildMagic.LibFoundation.Mathematics.ColorRGBm_kColorEllipseVolume-based color for the ellipsoids:private WildMagic.LibGraphics.SceneGraph.TriMeshm_kCylinderCylinders is a sphere with a non-uniform scale based on the eigen vectors and values.(package private) ModelImagem_kEigenValue(package private) ModelImagem_kEigenVectorEigenVector values for displaying ellipsoids.private WildMagic.LibGraphics.Rendering.MaterialStatem_kEllipseMaterialMaterial properties of the ellipsoids.private java.util.HashMap<java.lang.Integer,java.util.Vector<VOIContour>>m_kGlyphsHashmap for multiple fiber bundles:private SurfaceLightingEffectm_kLightShaderprivate WildMagic.LibGraphics.Rendering.MaterialStatem_kLinesMaterialMaterial properties of the tract lines.private java.util.HashMap<java.lang.Integer,VolumePreRenderEffect[]>m_kShadersHashmap for multiple fiber bundles:private WildMagic.LibGraphics.SceneGraph.TriMeshm_kSphereEllipsoids 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_kTractsHashmap for multiple fiber bundles:private java.util.HashMap<java.lang.Integer,WildMagic.LibGraphics.SceneGraph.Node>m_kTubesHashmap for multiple tube type fiber bundles:private WildMagic.LibGraphics.Rendering.MaterialStatem_kTubesMaterialMaterial 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 voidaddPolyline(VOIContour kContour, WildMagic.LibGraphics.SceneGraph.Polyline kLine, int iGroup)Add a polyline to the display.private voidcreateScene()WildMagic.LibGraphics.Surfaces.TubeSurfacecreateTube(WildMagic.LibGraphics.SceneGraph.Polyline kTract)Generate the tube streamline from the given polyline.private voidDisplayGlyphs(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)Display a fiber bundle tract with a Glyph.private voidDisplayTract(WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender, boolean bSolid)Displays a polyline fiber bundle tract with the given shader attached.private voidDisplayTubes(ModelImage kImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer, boolean bPreRender)Displays a tube fiber bundle tract with the given shader attached.voiddispose()memory cleanup.booleanGetDisplayTract()Returns if there are tracts to display.WildMagic.LibFoundation.Mathematics.ColorRGBgetGroupColor(int iGroup)Get the group color with given group ID.java.util.Vector<VOIContour>getPolylines(int iGroup)private voidMakeArrow()voidremovePolyline(int iGroup)Removes the specified polyline tract group.voidRender(WildMagic.LibGraphics.Rendering.Renderer kRenderer, WildMagic.LibGraphics.SceneGraph.Culler kCuller, boolean bPreRender, boolean bSolid)Render the object.voidsetDisplayAllGlyphs(boolean bDisplay)Turns on/off displaying all the glyphs.voidsetDisplayArrows(boolean bDisplay)Turns on/off displaying the fiber bundle tracts with 3d arrows.voidsetDisplayCylinders(boolean bDisplay)Turns on/off displaying the fiber bundle tracts with cylinders.voidsetDisplayEllipsoids(boolean bDisplay)Turns on/off displaying the fiber bundle tracts with ellipsoids.voidsetDisplayTubes(boolean bDisplay)Turns on/off displaying the fiber bundle tracts with tubes.voidsetDTIImage(ModelImage kDTIImage, ModelImage kEigenVectorImage, ModelImage kEigenValueImage, WildMagic.LibGraphics.Rendering.Renderer kRenderer)Sets the DTI Image for displaying the tensors as ellipsoids.voidsetEllipseMod(int iMod)Set the m_iEllipsoidMod value.voidSetLight(java.lang.String kLightType, float[] afType)Sets the light for the EllipsoidsShader.voidsetPolylineColor(int iGroup, WildMagic.LibFoundation.Mathematics.ColorRGB kColor)Sets the polyline color for the specified fiber bundle tract group.voidsetVolumeColor(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:
Renderin 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:
SetLightin 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()
-
-