Skip to content

3) Visualization of Clustered Tracts

Fan Zhang edited this page Apr 27, 2018 · 6 revisions

First install 3D Slicer from www.slicer.org and SlicerDMRI from http://dmri.slicer.org

Please read diffusion MRI analysis tutorial for instructions of software installation: https://github.com/SlicerDMRI/slicerdmri.github.io/blob/master/docs/tutorials/DiffusionMRIanalysis.pdf

Visualization

  • Load output clustered_tracts.mrml file into Slicer. This will load all clusters into the scene and display a percentage of the fibers in each cluster.
  • To view 100% of the fibers in all clusters (can be slow depending on the number of fibers clustered), load clustered_tracts_display_100_percent.mrml into Slicer.
  • If using a pre-provided anatomically curated atlas, a mrml file that defines which clusters belonging to a certain anatomical tract (e.g. T_AF.mrml) is provided. Copy this mrml file to the output fiber cluster folder and load it into Slicer. This will visualize all clusters belonging to the anatomical tract.
  • Use the 3D Slicer Models module (click "include fibers") to conveniently view clusters.
  • Use the 3D Slicer Tractography Display module to change how individual clusters are displayed (e.g. color by fiber orientation or increase the percentage of fibers displayed).
  • Another complementary and useful way to visualize atlas clusters is by running wm_quality_control_tractography.py on the atlas output directory to create html pages displaying all clusters.
  • The percentage of each fiber bundle (cluster) that is visible in 3D Slicer is controlled by the SubsamplingRatio in the MRML file. If you would like to change this for all tracts at once, the easiest way is to edit the MRML file in a text editor. (Note: the total number of fibers displayed in clustered_tracts.mrml is calculated according to the parameter -mrml_fibers SHOWNFIBERSINSLICER of wm_cluster_atlas.py. This is used to determine an appropriate SubsamplingRatio.)
  • The output clusters are vtkPolyData format and could be viewed with other programs that support vtk.

Organization/Labeling

  • To easily turn on and off all clusters and view individual clusters, use the Models module in Slicer.
  • Click "include fibers" to see tracts in the interface.
  • Organize and group atlas clusters into regions of interest for your study in the Models module by creating a hierarchy.
  • The hierarchy allows measurement from multiple clusters together (e.g. the clusters in the anterior part of the corpus callosum).
  • The hierarchy allows visualization of fiber clusters of interest in the atlas and the same clusters in individual subjects.
  • Right click or Ctrl-click to add a Hierarchy Node, and use drag and drop to add tracts into the hierarchy.
  • Save your hierarchy by saving the scene in Slicer. This will produce a MRML file.
  • (Pick Tracts is an alternative but does not yet support hierarchy creation.)

Commands to test and access the cluster output across subjects:

These commands can help extract and visualize a single cluster across multiple subjects, for studies when this is useful

wm_extract_cluster.py

  • Extract a single cluster from all subjects, into a new directory. (Not commonly used but useful for some studies).
  • This is useful to then run the wm_quality_control in the new directory to compare this cluster across all subjects.
  • It is also useful when you would like to measure from just this one cluster, across subjects.
  • This command prepends the subject ID to each cluster filename (subject_ID_cluster_number.vtp)
  • For example, to extract cluster 170 from all subjects, who were clustered in subdirectories of the all_subjects_clusters directory, and to output the extracted clusters into the new directory cluster_170:
wm_extract_cluster.py 170 all_subjects_clusters cluster_170

wm_create_mrml_file.py

  • Create a mrml file that includes all polydata files in the input directory, for easy loading into the Slicer scene.
  • This file automatically loads tractography as fiber bundles in Slicer, with unique colors.
  • This is helpful for viewing one cluster across subjects, or for any other application where viewing a directory of tractography is needed.
  • For visualizing the output of clustering, it is not necessary to run this script. Please use the mrml files that are generated by the clustering because these assign colors according to the fiber cluster atlas.
wm_create_mrml_file.py tract_directory/

Creation and visualization of atlas image data

  • This step can provide a sum image (proportional to group average image) in the group atlas space.
  • This is useful for visualizing atlas tracts with images, for publications and for anatomical reference when creating tract hierarchies.
  • Only images in each subject's DWI/DTI space should be used (such as FA or b0/baseline images).
  • Load all affine and non-rigid transforms (in ITK format) from the groupwise tractography registration (wm_registermultisubject_faster.py step).
  • Load each subject-specific structural volume (either FA or baseline).
  • Apply and harden each subject transform to subject-specific volumes in Slicer (see Transforms Module documentation)

To create an average brain volume:

  • Open the Cast Scalar Volume module in Slicer.
  • Select the first subject volume as input.
  • Under Output Volume, select Create New Volume As..., and enter Atlas Average
  • For Output Type, select Double.
  • Click Apply.
  • Open the Simple Filters Slicer module (note: requires SimpleITK, which is available by default in release and nightly builds, but may not be available if your Slicer was built from source).
  • For the first Input Volume selector, choose the second subject volume.
  • For the second Input Volume selector, choose Atlas Average.
  • For the Output Volume selector, choose Atlas Average.
  • Click Apply.
  • Now select the third subject volume with the first Input Volume selector, and Apply; select the fourth subject volume, Apply, etc. Continue until all subject volumes have been added.