Skip to content

Commit 095637c

Browse files
authored
Merge pull request #1273 from EmmaRenauld/fix_documentation
Fix documentation
2 parents d2c462f + 4d53a16 commit 095637c

File tree

16 files changed

+93
-68
lines changed

16 files changed

+93
-68
lines changed

docs/source/_static/my_style.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@
1515
/* Make citations use full page width instead of narrow blocks */
1616
div.citation {
1717
display: flex !important;
18+
}
19+
20+
/* Default font size is 0.9rem. A bit small. Making it bigger. */
21+
div.citation a, p {
22+
font-size: 1rem !important;
23+
}
24+
25+
/* Making links from :ref: gray. With blue, it was becoming heavy */
26+
.internal {
27+
color: #878787;
1828
}

docs/source/documentation/bundle_analysis/create_population_template.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Creating a bundle template from a chosen population
55

66
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:
77

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.
99

1010
2) registering the bundles to a reference space (e.g., MNI space) and analysing the inter-subject variability,
1111

@@ -23,7 +23,7 @@ Then, registration can be performed (see :ref:`page_tractogram_registration`). T
2323
Preparing data for this tutorial
2424
********************************
2525

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:
2727

2828
.. code-block:: bash
2929
@@ -34,10 +34,10 @@ To download data for this tutorial, see page :ref:`page_getting_started`_. Then
3434
--data_type int16 -f $in_dir/sub-01/sub-01__wmparc.nii.gz
3535
3636
37-
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>`_ .
3838

3939
.. 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>`_.
4141

4242

4343
Step A. Prepare the bundle of interest in each subject

docs/source/documentation/bundle_analysis/profilometry.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,22 @@
33
Profilometry (statistics on bundles)
44
====================================
55

6+
Defining profilometry
7+
*********************
8+
69
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]_.
710

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`).
912

1013
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.
1114

1215
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`.
1316

14-
Example: reproducing figure 4 in scilpy paper
15-
---------------------------------------------
16-
1717
.. image:: /_static/images/scilpy_paper_figure4.png
1818
:alt: Figure 4 in upcoming paper.
1919

20+
References
21+
**********
2022

2123
.. [1] Yeatman JD, Dougherty RF, Myall NJ, Wandell BA, Feldman HM. Tract Profiles of White Matter Properties: Automating Fiber-Tract Quantification. PLOS ONE. 2012;7(11):e49790. doi:10.1371/journal.pone.0049790
2224

docs/source/documentation/bundle_analysis/tractogram_segmentation.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@ Tractogram Segmentation into bundles
66
Scilpy scripts offer many options to segment a tractogram into bundles.
77

88
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`.

docs/source/documentation/reconstruction/aodf_scripts.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Suggestion. For a faster processing of this tutorial data, you could crop the fo
3232
}
3333
3434
.. 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>`_.
3636

37-
Creating the aodf
38-
*****************
37+
1. Creating the aodf
38+
********************
3939

4040
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:
4141

@@ -52,8 +52,8 @@ The default script runs a pure python implementation, which is slow. To speed up
5252
5353
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.
5454

55-
Computing metrics
56-
*****************
55+
2. Computing metrics
56+
********************
5757

5858
From the estimated AODF, we can compute a bunch of metrics using the script :ref:`scil_aodf_metrics`:.
5959

docs/source/documentation/reconstruction/btensor_scripts.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ To run lines below, you need a various volumes, b-vector information and masks.
1919
cp $HOME/.scilpy/btensor_testdata/* $in_dir/
2020

2121
.. tip::
22-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/btensor_scripts.sh>`_.
22+
You may download the complete bash script to run the whole tutorial in one step `here <../../_static/bash/reconst/btensor_scripts.sh>`_.
2323

2424
1. Computing the frf
2525
********************
@@ -64,4 +64,7 @@ If you want to do DIVIDE with b-tensor data, you should use the following comman
6464
--in_bvecs $in_dir/linear.bvecs $in_dir/planar.bvecs $in_dir/spherical.bvecs \
6565
--in_bdeltas 1 -0.5 0 --fa $in_dir/fa.nii.gz --processes 8 --mask $in_dir/mask.nii.gz
6666
67+
References
68+
**********
69+
6770
.. [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)

docs/source/documentation/reconstruction/msmt_fodf.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ To run lines below, you need a various volumes, b-vector information and masks.
2222
cp $HOME/.scilpy/commit_amico/* $in_dir/
2323

2424
.. tip::
25-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/msmt_scripts.sh>`_.
25+
You may download the complete bash script to run the whole tutorial in one step `here <../../_static/bash/reconst/msmt_fodf.sh>`_.
2626

2727
1. Computing the frf
2828
********************
@@ -40,7 +40,13 @@ When available, it is possible to add following options (not available with curr
4040
4141
--mask_wm $in_dir/wm_mask.nii.gz --mask_gm $in_dir/gm_mask.nii.gz --mask_csf $in_dir/csf_mask.nii.gz
4242
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 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 \times 10^{-3}\ \text{mm}^2/\text{s}`, and :math:`0.25 \text{ to } 0.5 \times 10^{-3}\ \text{mm}^2/\text{s}` for WM
46+
- :math:`0.6 \text{ to } 1.0 \times 10^{-3}\ \text{mm}^2/\text{s}`, and :math:`0.5 \text{ to } 0.8 \times 10^{-3}\ \text{mm}^2/\text{s}` for GM
47+
- :math:`1.5 \text{ to } 3.0 \times 10^{-3}\ \text{mm}^2/\text{s}`, and :math:`1.5 \text{ to } 3.0 \times 10^{-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.
4450

4551

4652
2. Computing the fODF
@@ -55,7 +61,7 @@ The second step is to perform multi-shell multi-tissue CSD (msmt-CSD) using :ref
5561
5662
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`.
5763

58-
.. [multitissueCSD] Jeurissen et al. NeuroImage 2014, "Multi-tissue constrained spherical deconvolution for improved analysis of multi-shell diffusion MRI data".
64+
References
65+
**********
5966

60-
61-
`The complete b-tensor scripts tutorial bash script <msmt_fodf.sh>`_.
67+
.. [multitissueCSD] Jeurissen et al. NeuroImage 2014, "Multi-tissue constrained spherical deconvolution for improved analysis of multi-shell diffusion MRI data".

docs/source/documentation/reconstruction/mti_scripts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Overall, we have data for a subject, containing:
112112

113113

114114
.. tip::
115-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/mti_scripts.sh>`_.
115+
You may download the complete bash script to run the whole tutorial in one step `here <../../_static/bash/reconst/mti_scripts.sh>`_.
116116

117117
Step-by-step processing
118118
***********************
@@ -267,7 +267,7 @@ This workflow handles conversion, registration, and execution of the ``scil_mti_
267267

268268

269269
References
270-
----------
270+
**********
271271

272272
[1] Varma G, Girard OM, Prevost VH, Grant AK, Duhamel G, Alsop DC.
273273
Interpretation of magnetization transfer from inhomogeneously broadened

docs/source/documentation/reconstruction/qball_metrics.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To run the script, you need a DWI image with its corresponding b-values and b-ve
2626
2727
2828
.. tip::
29-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/qball_metrics.sh>`_.
29+
You may download the complete bash script to run the whole tutorial in one step `here <../../_static/bash/reconst/qball_metrics.sh>`_.
3030

3131

3232
Running Q-ball

docs/source/documentation/reconstruction/ssst_fodf.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The tutorial data is still in preparation, meanwhile you can use this:
2323
cp $HOME/.scilpy/processing/fa_thr.nii.gz $in_dir/wm_mask.nii.gz
2424
2525
.. tip::
26-
You may download the complete bash script to run the whole tutorial in one step `here </_static/bash/reconst/ssst_fodf.sh>`_.
26+
You may download the complete bash script to run the whole tutorial in one step `here <../../_static/bash/reconst/ssst_fodf.sh>`_.
2727

2828

2929
1. Computing the frf

0 commit comments

Comments
 (0)