Skip to content

Commit e927e0d

Browse files
authored
Merge pull request #15 from scilus/update_2.3.0
[ENH] Update 2.4.0 + new features nextflow
2 parents 7866f92 + aa5ee9f commit e927e0d

File tree

11 files changed

+119
-44
lines changed

11 files changed

+119
-44
lines changed

source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# -- Project information -----------------------------------------------------
2121

2222
project = u'TractoFlow-documentation'
23-
copyright = u'2021, SCIL'
23+
copyright = u'2022, SCIL'
2424
author = u'SCIL'
2525

2626
# The short X.Y version

source/data/install.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#!/bin/bash
22

33
echo "Downloading TractoFlow..."
4-
wget -q https://github.com/scilus/tractoflow/releases/download/2.2.1/tractoflow-2.2.1.zip
5-
unzip -q tractoflow-2.2.1.zip
6-
rm -rf tractoflow-2.2.1.zip
4+
nextflow pull scilus/tractoflow
75
echo "Done: TractoFlow downloaded."
86
echo "Downloading TractoFlow Singularity..."
9-
wget -q --show-progress http://scil.dinf.usherbrooke.ca/containers_list/tractoflow_2.2.1_b9a527_2021-04-13.sif
7+
wget -q --show-progress http://scil.usherbrooke.ca/containers_list/scilus_1.4.0.sif
108
echo "Done: TractoFlow Singularity downloaded."

source/index.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ Welcome to the TractoFlow user documentation!
22
=============================================
33

44
.. note::
5-
New release available: 2.2.1.
6-
TractoFlow now support BIDS as input data.
5+
New release available: 2.4.0.
76

87
TractoFlow pipeline is developed by the Sherbrooke Connectivity Imaging Lab (`SCIL`_)
98
in order to process diffusion MRI dataset from the raw data to the tractography.
@@ -27,8 +26,7 @@ For MacOS users, please see this section :ref:`docker-tractoflow` for setup.
2726
For any issues or difficulties with TractoFlow, please use our Neurostar tag: https://neurostars.org/tag/tractoflow
2827

2928
.. tip::
30-
If you want to analyse datasets with white-matter lesions, we highly recommends
31-
to use our devrived version of TractoFlow: TractoFlow Atlas based Segmentation (ABS) https://github.com/scilus/TractoFlow-ABS
29+
If you want to analyse datasets with white-matter lesions use profile ABS.
3230

3331
.. toctree::
3432
:maxdepth: 1
@@ -43,6 +41,7 @@ For any issues or difficulties with TractoFlow, please use our Neurostar tag: ht
4341

4442
pipeline/steps
4543
pipeline/input
44+
4645
pipeline/options
4746
pipeline/profiles
4847
pipeline/launch

source/installation/install.rst

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
Install
2-
=======
1+
Fast Installation
2+
=================
33

44
Easy install method
55
-------------------
66

7-
Enter this command in your terminal (it downloads the container and TractoFlow code in the current directory):
7+
Enter this command in your terminal (it downloads the container and TractoFlow code in the current directory - Make sure nextflow is already installed before running this command):
88
::
99

10-
curl -s https://tractoflow-documentation.readthedocs.io/en/2.2.1/install.sh | bash
10+
curl -s https://tractoflow-documentation.readthedocs.io/en/2.4.0/install.sh | bash
11+
12+
13+
Detailed Installation
14+
=====================
1115

1216
TractoFlow pipeline
1317
-------------------
1418

1519
Release
1620
#######
1721

18-
Download the last release of TractoFlow pipeline:
22+
Download TractoFlow pipeline:
1923

2024
::
2125

22-
$> wget https://github.com/scilus/tractoflow/releases/download/2.2.1/tractoflow-2.2.1.zip && unzip tractoflow-2.2.1.zip
26+
$> nextflow pull scilus/tractoflow
2327

2428
For developers
2529
##############
@@ -34,6 +38,11 @@ Clone TractoFlow pipeline repository:
3438
# Clone with SSH
3539
$> git clone [email protected]:scilus/tractoflow.git
3640

41+
As a developer you will have to run tractoflow using this command:
42+
43+
::
44+
45+
nextflow run tractoflow/main.nf --help
3746

3847
.. _singularity-tractoflow:
3948

@@ -47,7 +56,13 @@ Download the last release of the Singularity container for TractoFlow:
4756

4857
::
4958

50-
$> wget http://scil.dinf.usherbrooke.ca/containers_list/tractoflow_2.2.1_b9a527_2021-04-13.sif
59+
$> wget http://scil.usherbrooke.ca/containers_list/scilus_1.4.0.sif
60+
61+
Or if you have sudo privileges
62+
63+
::
64+
65+
$> sudo singularity build scilus_1.4.0.sif docker://scilus/scilus:1.4.0
5166

5267
For developers
5368
##############
@@ -57,16 +72,16 @@ Clone the singularity repository for TractoFlow pipeline:
5772
::
5873

5974
# Clone with HTTPS
60-
$> git clone https://github.com/scilus/containers-tractoflow.git
75+
$> git clone https://github.com/scilus/containers-scilus.git
6176

6277
# Clone with SSH
63-
$> git clone [email protected]:scilus/containers-tractoflow.git
78+
$> git clone [email protected]:scilus/containers-scilus.git
6479

6580
Then, you can build the singularity image:
6681

6782
::
6883

69-
$> singularity build singularity_name.img singularity_tractoflow.def
84+
$> singularity build scilus_1.4.0.sif singularity_scilus.def
7085

7186
.. _docker-tractoflow:
7287

@@ -80,6 +95,6 @@ Download the last release of the Docker container for TractoFlow:
8095

8196
::
8297

83-
$> docker pull scilus/tractoflow:2.2.1
98+
$> docker pull scilus/scilus:1.4.0
8499

85100
Please see :ref:`profiles` section to use `macos` profile.

source/installation/requirements.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Local Computer
2121

2222
::
2323

24-
$> wget https://github.com/nextflow-io/nextflow/releases/download/v19.04.0/nextflow && chmod +x nextflow && \
24+
$> wget https://github.com/nextflow-io/nextflow/releases/download/v21.10.6/nextflow && chmod +x nextflow && \
2525
echo 'export PATH=$PATH:'$(pwd) >> ~/.bash_profile && source ~/.bash_profile
2626

2727
High Performance computer (HPC)
@@ -32,8 +32,8 @@ High Performance computer (HPC)
3232

3333
::
3434

35-
$> wget https://github.com/nextflow-io/nextflow/releases/download/v19.04.0/nextflow-19.04.0-all && \
36-
mv nextflow-19.04.0-all nextflow && \
35+
$> wget https://github.com/nextflow-io/nextflow/releases/download/v21.10.6/nextflow-21.10.6-all && \
36+
mv nextflow-21.10.6-all nextflow && \
3737
chmod +x nextflow && echo 'export PATH=$PATH:'$(pwd) >> ~/.bash_profile && source ~/.bash_profile
3838

3939
Note that a given HPC system might offer (a) readily available ``nextflow``
@@ -74,7 +74,7 @@ so that you can use the appropriate URL for the `wget` command.
7474
High Performance computer (HPC)
7575
###############################
7676

77-
Please try ``module load singularity/3.5`` or check with an administrator or on the HPC website.
77+
Please try ``module load singularity/3.7`` or check with an administrator or on the HPC website.
7878

7979
Docker
8080
------

source/pipeline/input.rst

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ before launching the processing to valide the BIDS format.
1414
In the case that some tags or informations are missing, TractoFlow will create a json file in ``results/Read_BIDS``.
1515
Please complete missing informations and relaunch the pipeline replacing ``--bids YOUR_BIDS_DATASET`` with ``--bids_config results/Read_BIDS/tractoflow_bids_struct.json``.
1616

17+
If you have a BIDS structure and want to use `-profile ABS` you need to use the `--fs` option to point to your freesurfer folder output.
18+
1719
If you have any problems, contact us on NeuroStar (https://neurostars.org/tag/tractoflow).
1820

1921
Root parameter
2022
--------------
2123

2224
It is possible not to follow the BIDS format. In that case, the input root parameter
23-
is called using ``--root`` and requires the following file structure:
25+
is called using ``--input`` and requires the following file structure:
2426

2527
::
2628

@@ -29,21 +31,28 @@ is called using ``--root`` and requires the following file structure:
2931
│ ├── dwi.nii.gz
3032
│ ├── bval
3133
│ ├── bvec
34+
│ ├── t1.nii.gz
3235
│ ├── rev_b0.nii.gz (optional)
33-
│ └── t1.nii.gz
36+
│ ├── aparc+aseg.nii.gz (optional)
37+
│ └── wmparc.nii.gz (optional)
3438
└── S2
3539
├── dwi.nii.gz
3640
├── bval
3741
├── bvec
42+
├── t1.nii.gz
3843
├── rev_b0.nii.gz (optional)
39-
└── t1.nii.gz
44+
├── aparc+aseg.nii.gz (optional)
45+
└── wmparc.nii.gz (optional)
4046

4147
The `root` folder must contains subjects folders (e.g. `S1`, `S2`,...). Each subject folder contains the required images:
4248

4349
* ``dwi.nii.gz`` are the diffusion weighted images.
4450
* ``bval`` is the b-value file in the FSL format.
4551
* ``bvec`` is the b-vector file in the FSL format.
46-
* ``rev_b0.nii.gz`` (optional) is the reversed phase encoded b0 image also called blip-up/blip-down. Used to correct distortion due to diffusion acquisition (`Documentation`_).
4752
* ``t1.nii.gz`` is the T1 weighted image.
53+
* ``rev_b0.nii.gz`` (optional) is the reversed phase encoded b0 image also called blip-up/blip-down. Used to correct distortion due to diffusion acquisition (`Documentation`_).
54+
* ``aparc+aseg.nii.gz`` (optional) is the freesurfer gm segmented image.
55+
* ``wmparc.nii.gz`` (optional) is the freesurfer wm segmented image.
56+
4857

4958
.. _Documentation: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup#topup_-_A_tool_for_estimating_and_correcting_susceptibility_induced_distortions

source/pipeline/launch.rst

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,14 @@ To run the pipeline, use the following command:
99
::
1010

1111
# With Singularity
12-
$> nextflow run tractoflow/main.nf --bids input_bids --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.img -resume
12+
$> nextflow run tractoflow -r 2.4.0 --bids input_bids -with-singularity scilus_1.4.0.sif -resume
1313
# Or
14-
$> nextflow run tractoflow/main.nf --root input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.img -resume
14+
$> nextflow run tractoflow -r 2.4.0 --input input_folder -with-singularity scilus_1.4.0.sif -resume
1515

1616
# With Docker
17-
$> nextflow run tractoflow/main.nf --bids input_bids --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-docker scilus/docker-tractoflow:2.1.1 -resume
17+
$> nextflow run tractoflow -r 2.4.0 --bids input_bids -with-docker scilus/scilus:1.4.0 -resume
1818
# Or
19-
$> nextflow run tractoflow/main.nf --root input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-docker scilus/docker-tractoflow:2.1.1 -resume
20-
21-
Where ``DTI_SHELLS`` are the shells used to compute the DTI metrics
22-
(typically b-value < 1200 e.g. "0 1000") and ``FODF_SHELLS`` are the shells used
23-
to compute the fODF metrics (typically b > 700 e.g. "0 1000 2000").
19+
$> nextflow run tractoflow -r 2.4.0 --input input_folder -with-docker scilus/scilus:1.4.0 -resume
2420

2521
If you want to skip steps already processed by an anterior run, you can add `-resume` option in the command line.
2622

@@ -42,7 +38,7 @@ to be executed with ``sbatch``.
4238
#SBATCH --mem=0
4339
#SBATCH --time=48:00:00
4440

45-
nextflow -c singularity.conf run tractoflow/main.nf --root input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.img -resume
41+
nextflow -c singularity.conf run tractoflow -r 2.4.0 --input input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.sif -resume
4642

4743
To launch on multiple nodes, you must to use the MPI option that use Ignite executor.
4844
The following example use 2 nodes with 32 threads on each nodes. The follwing lines
@@ -59,7 +55,7 @@ must be saved in ``.sh`` file (e.g. ``cmd.sh``) to be executed with ``sbatch``.
5955

6056
export NXF_CLUSTER_SEED=$(shuf -i 0-16777216 -n 1)
6157

62-
srun nextflow -c singularity.conf run tractoflow/main.nf --root input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.img -with-mpi -resume
58+
srun nextflow -c singularity.conf run tractoflow -r 2.4.0 --input input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -with-singularity singularity_name.sif -with-mpi -resume
6359

6460
To launch the pipeline on the HPC:
6561

source/pipeline/options.rst

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Options
22
=======
33

44
To display the options of Tractoflow, please use
5-
``nextflow run tractoflow/main.nf --help``.
5+
``nextflow run tractoflow -r 2.4.0 --help``.
66

77
Optional BIDS arguments
88
------------
@@ -18,8 +18,13 @@ Optional BIDS arguments
1818
If set, it will remove all the participants that are missing any information.
1919

2020

21+
``--fs "freesurfer_output_folder"`` (default: none)
22+
If you want to run Tractoflow-ABS (Atlas Based Segmentation) combined with a BIDS structure input
23+
you need to have this argument.
24+
2125
Options list
2226
------------
27+
2328
``--b0_thr_extract_b0 MAX_VALUE`` (default: 10)
2429
All b-values below a maximum value are considered b=0 images.
2530

@@ -84,6 +89,24 @@ Options list
8489
``--dwi_interpolation METHOD`` (default: lin)
8590
Interpolation method [nn, lin, quad, cubic].
8691

92+
``--max_dti_shell_value`` (default: 1200)
93+
Maximum shell threshold to be consider as a DTI shell (b <= 1200).
94+
This is the default behaviour to select DTI shells.
95+
96+
``--dti_shells``
97+
Shells selected to compute the DTI metrics (generally b <= 1200).
98+
Please write them between quotes e.g. (--dti_shells "0 300 1000").
99+
If selected, it will overwrite max_dti_shell_value.
100+
101+
``--min_fodf_shell_value`` (default: 700)
102+
Minimum shell threshold to be consider as a fODF shell (b >= 700).
103+
This is the default behaviour to select fODF shells.
104+
105+
``--fodf_shells``
106+
Shells selected to compute the fODF metrics (generally b >= 700).
107+
Please write them between quotes e.g. (--fodf_shells "0 1000 2000").
108+
If selected, it will overwrite min_fodf_shell_value.
109+
87110
``--run_t1_denoising BOOL`` (default: true)
88111
Run T1 denoising using NLmean algorithm.
89112

@@ -106,6 +129,9 @@ Options list
106129
``--min_fa MIN_THRESHOLD`` (default: 0.5)
107130
Minimum FA threshold to compute the FRF.
108131

132+
``--min_nvox MIN_NVOX_THRESHOLD`` (default: 300)
133+
Minimum number of voxels to compute the FRF.
134+
109135
``--roi_radius RADIUS`` (default: 20)
110136
Region of interest radius to compute the FRF.
111137
This ROI starts from the center of the 3D volume (sizeX/2, sizeY/2, sizeZ/2).
@@ -238,8 +264,6 @@ Optional Local Tracking arguments
238264
[LOCAL] List of random seed numbers for the random number generator.
239265
Please write them as list separated using commat WITHOUT SPACE e.g. (--local_random_seed 0,1,2)
240266

241-
242-
243267
``--template_t1 PATH`` (default: /human-data/mni_152_sym_09c/t1)
244268
Path to the template T1 directory for antsBrainExtraction.
245269
The folder must contain t1_template.nii.gz and t1_brain_probability_map.nii.gz.

source/pipeline/profiles.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ To select one or multiple profiles, please use the ``-profile`` option. For exam
77

88
::
99

10-
$> nextflow run tractoflow/main.nf --root input_folder --dti_shells "DTI_SHELLS" --fodf_shells "FODF_SHELLS" -profile macos,fully_reproducible -with-singularity singularity_name.img -resume
10+
$> nextflow run tractoflow -r 2.4.0 --input input_folder -profile macos,fully_reproducible -with-singularity singularity_name.sif -resume
1111

1212
Profiles available
1313
------------------
@@ -25,3 +25,14 @@ Profiles available
2525

2626
``cbrain``
2727
When this profile is used, Nextflow will copy all the output files in publishDir and not use symlinks.
28+
29+
``ABS``
30+
When this profile is used, TractoFlow-ABS (Atlas Based Segmentation) is used.
31+
This profile must be used for pathological data.
32+
The aparc+aseg.nii.gz and wmparc.nii.gz must be in the same space than t1.nii.gz
33+
34+
``bundling``
35+
When this profile is used, it will activate custom tracking parameters to improve recobundle results.
36+
37+
``connectomics``
38+
When this profile is used, it will activate custom tracking parameters to improve connectomics analysis.

source/reference/changelog.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
Changelog
22
=========
33

4+
2.4.0
5+
########
6+
Date: November 2022
7+
8+
New features
9+
- Automatic extraction of shells when computing DTI and fODF
10+
- Skip step bet_prelim_dwi when not needed
11+
- Add remove_invalid step in Tracking processes
12+
- Add possibility for complex BIDS structure with multiband acquisition and full reverse encoding acquisitions. (only available with cuda profile)
13+
- New profile "bundling". It will activate custom tracking parameters to improve recobundle results. Local tracking will be enable with fa seeding mask and tracking mask.
14+
- New profile "connectomics". It will activate custom tracking parameters to improve connectomics analysis.
15+
16+
2.3.0
17+
########
18+
Date: 05 April 2022
19+
20+
New features
21+
- New profile Atlas Based Segmentation (-profile ABS)
22+
- New profile "skip preprocessing" for HCP dataset (-profile skip_preprocessing)
23+
- Add option to compute dwi sh (-sh_fitting true)
24+
- Gibbs correction (-run_gibbs_correction true)
25+
26+
427
2.2.1
528
#########
629
Date: 09 April 2021

0 commit comments

Comments
 (0)