Skip to content

tractoflow

This subworkflow implements the TractoFlow [1] pipeline. It can process raw diffusion and T1 weighted image to reduce acquisition biases, align anatomical and diffusion space, compute DTI and fODF metrics and generate whole brain tractograms. ---------- Configuration ----------

  • nextflow.config : contains an example configuration for the subworkflow. └── modules.config : contains the bindings to the modules parameters and some defaults making it Tractoflow.

    i.e: nextflow.config import modules.config -------------- Steps -------------- PREPROCESS DWI (preproc_dwi, nf-neuro) Preprocess the DWI image including brain extraction, MP-PCA denoising, eddy current and motion correction, N4 bias correction, normalization and resampling. PREPROCESS T1 (preproc_t1, nf-neuro) Preprocess the T1 image including brain extraction, NL-Means denoising, bias field correction and resampling. T1 REGISTRATION (anatomical_registration, nf-neuro) Register the T1 image to the DWI image, using the b0 and the FA map as target for the diffusion space. SEGMENTATION (anatomical_segmentation, nf-neuro) Segment the T1 image into white matter, gray matter and CSF, in diffusion space. DTI FITTING (dipy) Fit the diffusion tensor model on the preprocessed DWI image and extract relevant metrics. FRF ESTIMATION (scilpy) Estimate the Fiber Response Function (FRF) from the preprocessed DWI image. FODF FITTING (dipy) Fit the Fiber Orientation Distribution Function (fODF), using Single or Multi Shell, Single or Multi Tissues models, on the preprocessed DWI image and extract relevant metrics. PFT TRACKING (dipy) Perform Particle Filtering Tractography (PFT) on the FODF to generate whole brain tractograms. LOCAL TRACKING (dipy on CPU, scilpy on GPU) Perform Local Tracking on the FODF to generate whole brain tractograms.

[1] https://tractoflow-documentation.readthedocs.io

Keywords : diffusion, MRI, end-to-end, tractography, preprocessing, fodf, dti

Components : anatomical_segmentation, preproc_dwi, preproc_t1, registration, reconst/dtimetrics, reconst/frf, reconst/fodf, reconst/meanfrf, registration/antsapplytransforms, tracking/localtracking, tracking/pfttracking


TypeDescriptionMandatoryPattern
ch_dwifileThe input channel containing the DWI file, B-values and B-vectors in FSL format files.

Structure: [ val(meta), path(dwi), path(bval), path(bvec) ]
True
ch_t1fileThe input channel containing the anatomical T1 weighted image.

Structure: [ val(meta), path(t1) ]
True
ch_sbreffile(Optional) The input channel containing the single-band b0 reference for the DWI.

Structure: [ val(meta), path(rev_b0) ]
True
ch_rev_dwifile(Optional) The input channel containing the reverse DWI file, B-values and B-vectors in FSL format files.

Structure: [ val(meta), path(rev_dwi), path(bval), path(bvec) ]
True
ch_rev_sbreffile(Optional) The input channel containing the reverse b0 file.

Structure: [ val(meta), path(rev_b0) ]
True
ch_aparc_asegfile(Optional) The input channel containing freesurfer brain segmentation and gray matter parcellation (aparc+aseg). Must be supplied with ch_wm_parc. When supplied, those are used to generate tissues masks and probability maps.

Structure: [ val(meta), path(aparc_aseg) ]
True
ch_wm_parcfile(Optional) The input channel containing freesurfer white matter parcellations (wmparc). Must be supplied with ch_aparc_aseg. When supplied, those are used to generate tissues masks and probability maps.

Structure: [ val(meta), path(wmparc) ]
True
ch_topup_configfile(Optional) The input channel containing the config file for Topup. This input is optional. See https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/topup/TopupUsersGuide#Configuration_files.

Structure: [ path(config_file) ]
True
ch_bet_templatefile(Optional) The input channel containing the anatomical template for antsBET.

Structure: [ val(meta), path(bet_template) ]
True
ch_bet_probability_mapfile(Optional) The input channel containing the brain probability mask for antsBET, with intensity range 1 (definitely brain) to 0 (definitely background).

Structure: [ val(meta), path(probability_map) ]
True
ch_lesion_maskfile(Optional) The input channel containing the lesion mask for segmentation.

Structure: [ val(meta), path(lesion_mask) ]
True

TypeDescriptionOptionalPattern
dwifilePreprocessed DWI image.

Structure: [ val(meta), path(dwi), path(bval), path(bvec) ]
False
t1fileT1 image warped to the DWI space.

Structure: [ val(meta), path(t1) ]
False
wm_maskfileWhite matter mask.

Structure: [ val(meta), path(wm_mask) ]
False
gm_maskfileGray matter mask.

Structure: [ val(meta), path(gm_mask) ]
False
csf_maskfileCerebrospinal fluid mask.

Structure: [ val(meta), path(csf_mask) ]
False
wm_mapfileWhite matter probability map.

Structure: [ val(meta), path(wm_map) ]
False
gm_mapfileGray matter probability map.

Structure: [ val(meta), path(gm_map) ]
False
csf_mapfileCerebrospinal fluid probability map.

Structure: [ val(meta), path(csf_map) ]
False
aparc_asegfile(Optional) Freesurfer brain segmentation and gray matter parcellation (aparc+aseg) in diffusion space. Only available if ch_aparc_aseg is provided in inputs.

Structure: [ val(meta), path(aparc_aseg) ]
False
wmparcfile(Optional) Freesurfer white matter parcellations (wmparc) in diffusion space. Only available if ch_wm_parc is provided in inputs.

Structure: [ val(meta), path(wmparc) ]
False
anatomical_to_diffusionfileTransformation matrix from the anatomical space to the diffusion space.

Structure: [ val(meta), [path(warp), path(affine)] ]
False
diffusion_to_anatomicalfileTransformation matrix from the diffusion space to the anatomical space.

Structure: [ val(meta), [path(affine), path(warp)] ]
False
t1_nativefilePreprocessed T1 in anatomical space.

Structure: [ val(meta), path(t1) ]
False
dti_tensorfile4-D Diffusion tensor image, with 6 components in the last dimensions, ordered by FSL convention (row-major : Dxx, Dxy, Dxz, Dyy, Dyz, Dzz).

Structure: [ val(meta), path(dti_tensor) ]
False
dti_mdfileMean diffusivity map.

Structure: [ val(meta), path(dti_md) ]
False
dti_rdfileRadial diffusivity map.

Structure: [ val(meta), path(dti_rd) ]
False
dti_adfileAxial diffusivity map.

Structure: [ val(meta), path(dti_ad) ]
False
dti_fafileFractional anisotropy map.

Structure: [ val(meta), path(dti_fa) ]
False
dti_rgbfileRGB map of the diffusion tensor.

Structure: [ val(meta), path(dti_rgb) ]
False
dti_peaksfilePrincipal direction of the diffusion tensor.

Structure: [ val(meta), path(dti_peaks) ]
False
dti_evecsfileEigenvectors of the diffusion tensor, ordered by eigenvalue.

Structure: [ val(meta), path(dti_evecs) ]
False
dti_evalsfileEigenvalues of the diffusion tensor.

Structure: [ val(meta), path(dti_evals) ]
False
dti_residualfileResiduals of the diffusion tensor fitting.

Structure: [ val(meta), path(dti_residual) ]
False
dti_gafileGeneralized anisotropy map.

Structure: [ val(meta), path(dti_ga) ]
False
dti_modefileMode of the diffusion tensor.

Structure: [ val(meta), path(dti_mode) ]
False
dti_normfileNorm of the diffusion tensor.

Structure: [ val(meta), path(dti_norm) ]
False
fiber_responsefileFiber Response Function (FRF) estimated from the DWI image. If using Single Tissue If using Multi Tissues Structure: [ val(meta), path(wm_fiber_response), path(gm_fiber_response), path(csf_fiber_response) ]

Structure: [ val(meta), path(fiber_response) ]
False
fodffileFiber Orientation Distribution Function (fODF) estimated from the DWI image. If using Single Tissue If using Multi Tissues Structure: [ val(meta), path(wm_fodf), path(gm_fodf), path(csf_fodf) ]

Structure: [ val(meta), path(fodf) ]
False
fodf_rgbfileRGB map of the fODF, normalized by volume fraction of WM.

Structure: [ val(meta), path(fodf_rgb) ]
False
fodf_peaksfilePeaks of the fODF.

Structure: [ val(meta), path(fodf_peaks) ]
False
afd_maxfileMaximum Apparent Fiber Density (AFD) map.

Structure: [ val(meta), path(afd_max) ]
False
afd_totalfileTotal Apparent Fiber Density (AFD) map.

Structure: [ val(meta), path(afd_total) ]
False
afd_sumfileSum of Apparent Fiber Density (AFD) map.

Structure: [ val(meta), path(afd_sum) ]
False
nufofileNumber of Unique Fibers Orientations (NUFO) map.

Structure: [ val(meta), path(nufo) ]
False
volume_fractionfileTissues volume fraction map.

Structure: [ val(meta), path(volume_fraction) ]
False
pft_tractogramfileWhole brain tractogram generated with Particle Filtering Tractography (PFT).

Structure: [ val(meta), path(pft_tractogram) ]
False
pft_configfileConfiguration file used for Particle Filtering Tractography (PFT).

Structure: [ val(meta), path(pft_config) ]
False
pft_map_includefileInclude map used for Particle Filtering Tractography (PFT).

Structure: [ val(meta), path(pft_map_include) ]
False
pft_map_excludefileExclude map used for Particle Filtering Tractography (PFT).

Structure: [ val(meta), path(pft_map_exclude) ]
False
pft_seeding_maskfileSeeding mask used for Particle Filtering Tractography (PFT).False
local_tractogramfileWhole brain tractogram generated with Local Tracking.

Structure: [ val(meta), path(local_tractogram) ]
False
local_configfileConfiguration file used for Local Tracking.

Structure: [ val(meta), path(local_config) ]
False
local_seeding_maskfileSeeding mask used for Local Tracking.

Structure: [ val(meta), path(local_seeding_mask) ]
False
local_tracking_maskfileTracking mask used for Local Tracking.

Structure: [ val(meta), path(local_tracking_mask) ]
False
versionsfileFile containing software versions

Structure: [ path(versions.yml) ]
Falseversions.yml


Last updated : 2025-10-30