Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working and tested end-to-end version for infant and paediatric data (raw dwi/anat --> connectomics) #6

Open
wants to merge 49 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d68248f
Fixing registration and masks handling
gagnonanthony Aug 3, 2023
48c4fab
fix transform labels and minor changes
gagnonanthony Aug 8, 2023
db34163
fix registration channel
gagnonanthony Aug 8, 2023
e51b836
fix typo
gagnonanthony Aug 8, 2023
473edd8
Fix USAGE and labels registration
gagnonanthony Sep 12, 2023
0b61008
initial move for a more versatile pipeline
gagnonanthony Sep 15, 2023
d326b4e
fix resample and flatten metrics channel
gagnonanthony Sep 18, 2023
9ffb034
fix masking
gagnonanthony Sep 18, 2023
33018a0
fix local_fa_seeding_mask_thr
gagnonanthony Sep 18, 2023
4728fbc
change basis params
gagnonanthony Sep 18, 2023
de09cde
commit on trk option
gagnonanthony Sep 18, 2023
e6153f3
adding commit_on_trk process
gagnonanthony Sep 18, 2023
d89b915
fix metrics channel
gagnonanthony Sep 20, 2023
a326db4
improved usage and docstring + CI
gagnonanthony Oct 25, 2023
f40fd1a
added CI
gagnonanthony Oct 25, 2023
71ccc8b
Added freesurferflow
gagnonanthony Oct 26, 2023
5c34aa5
fix freesurfer, add docker and singularity files
gagnonanthony Oct 26, 2023
7e3ba90
fix test
gagnonanthony Oct 26, 2023
205b1b8
test
gagnonanthony Oct 26, 2023
208bb41
try fix space issues on runners
gagnonanthony Oct 26, 2023
a045bbc
fix singularity and back to nextflow testing
gagnonanthony Oct 27, 2023
d8b05cd
fix fast in docker and atlases
gagnonanthony Oct 27, 2023
75a8039
fixing utils download in container
gagnonanthony Oct 30, 2023
ab37b89
fix typos and bindings
gagnonanthony Oct 30, 2023
d4bf895
explicited usage files, minor fix, improved ci
gagnonanthony Nov 1, 2023
4df49b5
fix workspace in CI
gagnonanthony Nov 1, 2023
96ecd44
complete docs, logs and links between flows
gagnonanthony Nov 1, 2023
c4ff0ac
add t1 as output
gagnonanthony Nov 1, 2023
53215cb
fix typos
gagnonanthony Nov 1, 2023
2b856bb
fix links
gagnonanthony Nov 1, 2023
99ae581
change image filename
gagnonanthony Nov 1, 2023
60897b6
change output structure, readme and containers
gagnonanthony Nov 2, 2023
65dd8e2
fix lausanne atlas
gagnonanthony Nov 3, 2023
a3dccf5
fix output structure
gagnonanthony Nov 6, 2023
297bbb9
reverting back to $task.process for output
gagnonanthony Nov 6, 2023
b99c5c8
fix typo
gagnonanthony Nov 6, 2023
4c014f0
explicitly outputting and selecting altases
gagnonanthony Nov 6, 2023
108204d
bumping scilus 1.5 -> 1.6 in container
gagnonanthony Nov 14, 2023
ca75360
add priors + change commit process
gagnonanthony Dec 5, 2023
61e915f
add priors profile
gagnonanthony Dec 6, 2023
c0ef106
fix typos and minor bugs
gagnonanthony Dec 6, 2023
219c53d
add fastsurfer option + BN child atlas
gagnonanthony Dec 13, 2023
544cc6b
fix typo
gagnonanthony Dec 13, 2023
d490750
fix commit with priors
gagnonanthony Dec 13, 2023
da0cb05
fix typo in USAGE
gagnonanthony Dec 13, 2023
a966037
change .gca atlas to match 7.3.2 version
gagnonanthony Dec 14, 2023
b0cdd8d
updated slurm time and memory constraints
gagnonanthony Dec 22, 2023
1f424f4
fix mem in freesurfer + queuesize and maxforks
gagnonanthony Jan 4, 2024
de39fe6
Fix small typos
gagnonanthony Mar 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: CI
on: [push, pull_request]

jobs:
pipeline-compilation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: nf-core/setup-nextflow@v1
- name: Run pipeline
run: |
nextflow run ${GITHUB_WORKSPACE} --help
nextflow run ${GITHUB_WORKSPACE} --help -profile tracking
nextflow run ${GITHUB_WORKSPACE} --help -profile tracking,infant
nextflow run ${GITHUB_WORKSPACE} --help -profile connectomics
nextflow run ${GITHUB_WORKSPACE} --help -profile connectomics,infant
nextflow run ${GITHUB_WORKSPACE} --help -profile tracking,connectomics
nextflow run ${GITHUB_WORKSPACE} --help -profile tracking,connectomics,infant
nextflow run ${GITHUB_WORKSPACE} --help -profile freesurfer
nextflow run ${GITHUB_WORKSPACE} --help -profile freesurfer,connectomics
nextflow run ${GITHUB_WORKSPACE} --help -profile freesurfer,connectomics,tracking
97 changes: 69 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,83 @@
Infant-DWI
===============
Complete pipeline to perform tractography from infant diffusion MRI data. Adapted from the SCIL TractoFlow Pipeline (https://github.com/scilus/tractoflow.git) and Connectoflow Pipeline (https://github.com/scilus/connectoflow.git).
ChildBrainFlow Pipeline
=======================

SINGULARITY
-----------
If you are running this pipeline on Linux, it is recommended you use the SCIL singularity container that contains all the relevant dependencies.
You can get the image by running this command:
ChildBrainFlow is an end-to-end pipeline that performs tractography, t1 reconstruction and connectomics.
It is essentially a merged version of multiple individual pipelines to avoid the handling of inputs/outputs
between flows with some parameters tuned for pediatric brain scans. Here is a list of flows from which
processes have been taken:

`` sudo singularity pull scilus.sif docker://scilus/scilus:latest``
1. TractoFlow (https://github.com/scilus/tractoflow.git) [1]
2. FreeSurfer-Flow (https://github.com/scilus/freesurfer_flow)
3. Connectoflow (https://github.com/scilus/connectoflow)

DOCKER
------
If you are on MacOS or Windows, you can use Docker to run Infant-DWI.
Prebuilt image are available here:
> [!NOTE]
> Please note that some steps have been removed from the original pipelines if they were not relevant for pediatric data. If you need some of these steps, please use the original pipelines.

Nextflow
--------
To install nextflow, please see : https://www.nextflow.io/docs/latest/getstarted.html#requirements

The pipeline export by default a `` parameters.json `` within the output directory to provide a documentation of the parameters used during the execution. For a more detailed report (excluding execution's parameters), the default feature of nextflow `` -with-report <report_name.html> `` can be used to export a html report. Simply add this your command line when launching the pipeline:

https://hub.docker.com/r/scilus/scilus
```
nextflow run main.nf --input <input> <other_arguments> -with-report <report_name.html>
```

DEPENDENCIES
------------
You can also run Infant-DWI without any container, but you need these dependencies installed on your machine to make it work:
Apptainer
---------
If you are running this pipeline on Linux, it is recommended to run the pipeline using an apptainer image.
The pipeline comes with a recipe file (`` /containers/apptainer_recipe.def ``) containing all the required
dependencies to successfully run every profiles. To build the apptainer image, run this command:

* Scilpy (https://github.com/scilus/scilpy.git)
* Mrtrix3 (https://www.mrtrix.org/)
* FSL (https://fsl.fmrib.ox.ac.uk/fsl/fslwiki)
* ANTs (http://stnava.github.io/ANTs/)
```
sudo apptainer build <image_name> </path/to/apptainer_recipe.def>
```

All these dependencies must be in your PATH environment variable in order to launch Infant-Tracking.
Docker
------
If you are on MacOS or Windows, you can use Docker to run ChildBrainFlow. The pipeline comes with
a Dockerfile containing all the dependencies required to successfully run every profiles of the pipeline.
Simply run this command from inside the `` /containers/ `` folder:

```
docker build -t <container_name> .
```
> [!WARNING]
> Due to the high number of dependencies (ANTs, FSL, MRtrix3, Scilpy, Freesurfer, FastSurfer, etc.), the resulting docker image can be pretty large (~ 40Gb).

USAGE
Usage
-----
See _USAGE_ or run `` nextflow run main.nf --help `` for more details.

REFERENCES
References
----------
This pipeline is adapted from the SCIL TractoFlow pipeline, see:
If you used this pipeline, please cite :

[1] Theaud, G., Houde, J.-C., Boré, A., Rheault, F., Morency, F., Descoteaux, M.,
TractoFlow: A robust, efficient and reproducible diffusion MRI pipeline
leveraging Nextflow & Singularity, NeuroImage,
https://doi.org/10.1016/j.neuroimage.2020.116889.

[2] Kurtzer GM, Sochat V, Bauer MW Singularity: Scientific containers for mobility of compute. PLoS ONE 12(5)
(2017): e0177459. https://doi.org/10.1371/journal.pone.0177459

[3] P. Di Tommaso, et al. Nextflow enables reproducible computational workflows. Nature Biotechnology 35,
316–319 (2017) https://doi.org/10.1038/nbt.3820

[4] Garyfallidis, E., Brett, M., Amirbekian, B., Rokem, A., Van Der Walt, S., Descoteaux, M., Nimmo-Smith, I.,
2014. Dipy, a library for the analysis of diffusion mri data. Frontiers in neuroinformatics 8, 8.
https://doi.org/10.3389/fninf.2014.00008

[5] Tournier, J. D., Smith, R. E., Raffelt, D. A., Tabbara, R., Dhollander, T., Pietsch, M., … & Connelly, A.
(2019). MRtrix3: A fast, flexible and open software framework for medical image processing and visualisation.
NeuroImage 202, https://doi.org/10.1016/j.neuroimage.2019.116137

[6] Avants, B. B., Tustison, N., & Song, G. (2009). Advanced normalization tools (ANTS). Insight j, 2(365), 1-35.

Theaud, G., Houde, J.-C., Boré, A., Rheault, F., Morency, F., Descoteaux, M.,
TractoFlow: A robust, efficient and reproducible diffusion MRI pipeline
leveraging Nextflow & Singularity, NeuroImage,
https://doi.org/10.1016/j.neuroimage.2020.116889.
[7] Jenkinson, M., Beckmann, C.F., Behrens, T.E., Woolrich, M.W., Smith, S.M., 2012. Fsl. Neuroimage 62,
782–790. https://doi.org/10.1016/j.neuroimage.2011.09.015

[8] Fischl, B., Salat, D.H., Busa, E., Albert, M., Dieterich, M., Haselgrove, C., van der Kouwe, A., Killiany,
R., Kennedy, D., Klaveness, S., Montillo, A., Makris, N., Rosen, B., Dale, A.M., 2002. Whole brain
segmentation: automated labeling of neuroanatomical structures in the human brain. Neuron 33, 341-355.
https://doi.org/10.1016/s0896-6273(02)00569-x
Loading