Automated FSL-based processing pipeline for DTI (Diffusion Tensor Imaging) data. Specifically for non-brain images (e.g. images of DRG (Dorsal Root Ganglia))
- optionally ROIs are extracted from the images, using
fslroi
- all images with b-value 0 are extracted (in both AP and PA direction) and recombined for topup
- the AP and PA file (nifti, bvec, and bval) are concatenated for eddy
- config files for topup and eddy are created
- then topup and eddy are applied
- dtifit is applied to the eddy corrected data
- bedpostX is applied to the eddy corrected data
The workflow can be run with slurm (--executor slurm
). Start it in the root of a BIDS dataset and all subjects and sessions with dwi
images in dir-AP
and dir-PA
are processed. Outputs are stored under derivatives/dti_smk
.
The listed versions are the ones this pipeline was developed with. It might work with other (particularly newer) versions.
- FSL (6.0.7.18)
- Snakemake (9.9.0)
- (optional) snakemake-executor-plugin-slurm (1.6.0)
Navigate into the root of your BIDS dataset and run (adjusting the path to the Snakefile and number of cpus):
snakemake --snakefile /path/to/workflow/Snakefile --cores 6
If you are on a SLURM cluster (and you have snakemake-executor-plugin-slurm
installed), you can run (again adjusting parameters as appropriate):
snakemake --snakefile /path/to/workflow/Snakefile --executor slurm --default-resources mem_mb=1000 cpus_per_task=2 runtime=60 --jobs 10 --latency-wait 60
the full BIDS specification is not supported, yet.
There are currently still some limitations:
- the session level is not optional (
_ses-<label>
) - the PhaseEncodingDirection has to be in
_dir-<label>
and only "AP" and "PA" are supported (in uppercase letters) - no additional file name components are currently accepted (acq, rec, run, part, chunk)
Install dependencies with:
uv sync
Run tests with:
uv run pytest test
Contributions are welcome, including but not limited to bug fixes, new features, documentation, and tests.