You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/documentation/bundle_analysis/create_population_template.rst
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ Creating a bundle template from a chosen population
5
5
6
6
Scilpy scripts enable users to create a WM bundle population template, such as described in figure 3 in our upcoming paper. Such a pipeline includes:
7
7
8
-
1) segmenting the bundle of interest in each subject’s tractogram. The segmentation of bundles can be based on ROIs of inclusion / exclusion (`scil_tractogram_segment_with_ROI_and_score` or `scil_tractogram_filter_by_roi`) or based on the general shape of the streamlines (`scil_tractogram_segment_with_recobundles`, `scil_tractogram_segment_with_bundleseg`). See :ref:`page_tractogram_segmentation` for more information on this.
8
+
1) segmenting the bundle of interest in each subject’s tractogram. The segmentation of bundles can be based on ROIs of inclusion / exclusion (:ref:`scil_tractogram_segment_with_ROI_and_score` or :ref:`scil_tractogram_filter_by_roi`) or based on the general shape of the streamlines (:ref:`scil_tractogram_segment_with_recobundles`, :ref:`scil_tractogram_segment_with_bundleseg`). See :ref:`page_tractogram_segmentation` for more information on this.
9
9
10
10
2) registering the bundles to a reference space (e.g., MNI space) and analysing the inter-subject variability,
11
11
@@ -23,7 +23,7 @@ Then, registration can be performed (see :ref:`page_tractogram_registration`). T
23
23
Preparing data for this tutorial
24
24
********************************
25
25
26
-
To download data for this tutorial, see page :ref:`page_getting_started`_. Then do:
26
+
To download data for this tutorial, see page :ref:`page_getting_started`. Then do:
27
27
28
28
.. code-block:: bash
29
29
@@ -34,10 +34,10 @@ To download data for this tutorial, see page :ref:`page_getting_started`_. Then
The labels come from a Freesurfer segmentation (https://surfer.nmr.mgh.harvard.edu/ ), and the labels that it contains are found here: https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT .
37
+
The labels come from a `Freesurfer <https://surfer.nmr.mgh.harvard.edu/>`_ segmentation, and the labels that it contains are found `in the FsWiki's Color Look-up Table (LUT) <https://surfer.nmr.mgh.harvard.edu/fswiki/FsTutorial/AnatomicalROI/FreeSurferColorLUT>`_ .
38
38
39
39
.. tip::
40
-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/bundle_analysis/create_population_template.sh>`_.
40
+
You may download the complete bash script to run the whole tutorial in one step `⭳ here <../../_static/bash/bundle_analysis/create_population_template.sh>`_.
41
41
42
42
43
43
Step A. Prepare the bundle of interest in each subject
Copy file name to clipboardExpand all lines: docs/source/documentation/bundle_analysis/profilometry.rst
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,20 +3,22 @@
3
3
Profilometry (statistics on bundles)
4
4
====================================
5
5
6
+
Defining profilometry
7
+
*********************
8
+
6
9
Using a clean bundle from a single subject, scilpy allows performing a profilometry [1]_ analysis, which is the analysis of the evolution of any dMRI metrics along its subsections. A simple example is shown in Figure 4, and for further examples of such processes, users can refer to Tractometry-flow (https://github.com/scilus/tractometry_flow), a nextflow process using many scilpy scripts, or to the study by Cousineau et. al [2]_.
7
10
8
-
The creation of the bundles required tractogram segmentation (:ref:`page_tractogram_segmentation`).
11
+
The creation of the bundles requires tractogram segmentation (:ref:`page_tractogram_segmentation`).
9
12
10
13
The profilometry analysis requires segmenting the bundles into as many subsections as desired. This is not straightforward, as the division of sections can be performed arbitrarily. We generally cut the section perpendicularly to the direction of the bundle, measured from a centroid, a single streamline-like shape representing the average of all streamlines in the bundle (`scil_bundle_compute_centroid`, `scil_bundle_label_map`). Then, any metric can be associated with the subsections. Figure 4 shows the example of the sections’ volume and diameter, or mean underlying value of any given map, such as the FA map. The resulting json file’s values can be plotted with scil_plot_stats_per_point.
11
14
12
15
Beyond profilometry, other analysis steps could also be performed on the whole bundle. For instance, it is possible to compute the map of the head and tail of a bundle (the starting and ending regions of the bundle, assuming all streamlines are aligned in the same direction) with scil_bundle_uniformize_endpoints and scil_bundle_compute_endpoints_map. It is also possible to extract various information with `scil_bundle_shape_measures`.
Copy file name to clipboardExpand all lines: docs/source/documentation/bundle_analysis/tractogram_segmentation.rst
-5Lines changed: 0 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,3 @@ Tractogram Segmentation into bundles
6
6
Scilpy scripts offer many options to segment a tractogram into bundles.
7
7
8
8
The resulting bundles can be cleaned more thoroughly than whole-brain tractograms, considering that their shapes should be quite uniform, and spurious streamlines can be discarded automatically with scil_bundle_reject_outliers or visually with `scil_bundle_clean_qbx_clusters`. The bundle could also be cut or trimmed using a binary mask, allowing it to focus on a specific region, using scil_tractogram_cut_streamlines. Optionally, metrics and statistics can be measured for each individual subject using our various scripts for bundle analysis, such as presented in :ref:`profilometry`.
9
-
10
-
Examples of usage
11
-
-----------------
12
-
13
-
- Creating a template. See :ref:`page_population_template`.
Copy file name to clipboardExpand all lines: docs/source/documentation/reconstruction/aodf_scripts.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,10 +32,10 @@ Suggestion. For a faster processing of this tutorial data, you could crop the fo
32
32
}
33
33
34
34
.. tip::
35
-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/aodf_scripts.sh>`_.
35
+
You may download the complete bash script to run the whole tutorial in one step `⭳ here <../../_static/bash/reconst/aodf_scripts.sh>`_.
36
36
37
-
Creating the aodf
38
-
*****************
37
+
1. Creating the aodf
38
+
********************
39
39
40
40
Although there is an automatic way to set the parameters, it is not yet implemented in scilpy. We recommend that you experiment with the parameters to find the best configuration for your data. Here, we use the smallest sphere available in Dipy, for a fast test. You can run the command as follows:
41
41
@@ -52,8 +52,8 @@ The default script runs a pure python implementation, which is slow. To speed up
52
52
53
53
The script will output the asymmetric ODF image (``afodf.nii.gz``) in the current directory. At the difference of a symmetric ODF image, which is represented using a symmetric spherical harmonics basis, the asymmetric ODF image is represented using a full spherical harmonics basis. Therefore, the output image will have more SH coefficients than the input image. For instance, for a maximum SH order of 8, the input image will have 45 coefficients per voxel, while the output image will have 81 coefficients per voxel.
54
54
55
-
Computing metrics
56
-
*****************
55
+
2. Computing metrics
56
+
********************
57
57
58
58
From the estimated AODF, we can compute a bunch of metrics using the script :ref:`scil_aodf_metrics`:.
.. [memst] P. Karan et al., Bridging the gap between constrained spherical deconvolution and diffusional variance decomposition via tensor-valued diffusion MRI. Medical Image Analysis (2022)
The script will output one FRF per tissue type: white matter (WM), gray matter (GM), cerebrospinal fluid (CSF), in three text files (wm_frf.txt, gm_frf.txt and csf_frf.txt) that will be used in the next step. Each line in those files correspond to the response function of a b-value (in decreasing order from top to bottom). The first three numbers in each line are the parallel diffusivity and the perpendicular diffusivity (written twice) of the corresponding tissue type and b-value. These should typically be around 1.2-2.0 x 10^-3 mm^2/s and 0.25-0.5 x 10^-3 mm^2/s for WM, 0.6-1.0 x 10^-3 mm^2/s and 0.5-0.8 x 10^-3 mm^2/s for GM, and 1.5-3.0 x 10^-3 mm^2/s and 1.5-3.0 x 10^-3 mm^2/s for CSF, respectively. The last number is the average value of the b0 signal of the corresponding tissue type. If the FRFs look very different from these values or if you get an error from the script, you might be able to resolve the issue by changing some parameters and making sure the inputed tissue masks are correct. Indeed, the script works better with a mask for each tissue type (WM, GM and CSF) in addition to the brain mask. Moreover, you can change the FA and MD thresholds of used to refine the tissue masks, using the ``--fa_thr_wm``, ``--fa_thr_gm``, ``--fa_thr_csf``, ``--md_thr_wm``, ``--md_thr_gm`` and ``--md_thr_csf`` options. You can also change the minimum number of voxels required to compute each FRF using the ``--min_nvox`` option (default is 100). This is particularly helpful in the case of small images. In such cases, the ``--roi_radii`` and ``--roi_center`` options can also be used to specify regions of interest (ROIs) in each tissue type. In any case, the ``-v`` (verbose) option can be used to get more information about the process. Once you have computed the FRFs, you can proceed to compute the fODFs.
43
+
The script will output one FRF per tissue type: white matter (WM), gray matter (GM), cerebrospinal fluid (CSF), in three text files (wm_frf.txt, gm_frf.txt and csf_frf.txt) that will be used in the next step. Each line in those files correspond to the response function of a b-value (in decreasing order from top to bottom). The first three numbers in each line are the parallel diffusivity and the perpendicular diffusivity (written twice) of the corresponding tissue type and b-value. These should typically be respectively around
44
+
45
+
- :math:`1.2\text{ to } 2.0\times10^{-3}\ \text{mm}^2/\text{s}`, and :math:`0.25\text{ to } 0.5\times10^{-3}\ \text{mm}^2/\text{s}` for WM
46
+
- :math:`0.6\text{ to } 1.0\times10^{-3}\ \text{mm}^2/\text{s}`, and :math:`0.5\text{ to } 0.8\times10^{-3}\ \text{mm}^2/\text{s}` for GM
47
+
- :math:`1.5\text{ to } 3.0\times10^{-3}\ \text{mm}^2/\text{s}`, and :math:`1.5\text{ to } 3.0\times10^{-3}\ \text{mm}^2/\text{s}` for CSF
48
+
49
+
The last number is the average value of the b0 signal of the corresponding tissue type. If the FRFs look very different from these values or if you get an error from the script, you might be able to resolve the issue by changing some parameters and making sure the inputed tissue masks are correct. Indeed, the script works better with a mask for each tissue type (WM, GM and CSF) in addition to the brain mask. Moreover, you can change the FA and MD thresholds of used to refine the tissue masks, using the ``--fa_thr_wm``, ``--fa_thr_gm``, ``--fa_thr_csf``, ``--md_thr_wm``, ``--md_thr_gm`` and ``--md_thr_csf`` options. You can also change the minimum number of voxels required to compute each FRF using the ``--min_nvox`` option (default is 100). This is particularly helpful in the case of small images. In such cases, the ``--roi_radii`` and ``--roi_center`` options can also be used to specify regions of interest (ROIs) in each tissue type. In any case, the ``-v`` (verbose) option can be used to get more information about the process. Once you have computed the FRFs, you can proceed to compute the fODFs.
44
50
45
51
46
52
2. Computing the fODF
@@ -55,7 +61,7 @@ The second step is to perform multi-shell multi-tissue CSD (msmt-CSD) using :ref
55
61
56
62
The script will output one fODFs file per tissue type, in nifti format (wm_fodf.nii.gz, gm_fodf.nii.gz and csf_fodf.nii.gz). The only optional arguments are the ``--sh_order`` option (default is 8) to set the maximum spherical harmonics order used to represent the fODFs and the ``--sh_basis`` option (default is 'descoteaux07') to set the spherical harmonics basis. The ``--processes`` option is used to speed up the computation by using multiple CPU cores. By default, the script will also output the volume fractions map (in default and RGB versions), with names vf.nii.gz and vf_rgb.nii.gz. To change any of the output names and paths or output only a selection of files, use the ``--not_all`` option along with the ``--wm_out_fODF``, ``--gm_out_fODF``, ``--csf_out_fODF``, ``--vf`` and ``--vf_rgb`` arguments. To visualize the fODFs, you can use :ref:`scil_viz_fodf`.
57
63
58
-
.. [multitissueCSD] Jeurissen et al. NeuroImage 2014, "Multi-tissue constrained spherical deconvolution for improved analysis of multi-shell diffusion MRI data".
0 commit comments