API

Workflows

fMRIprep base processing workflows

fmriprep.workflows.base.init_fmriprep_wf(subject_list, task_id, run_uuid, ignore, debug, low_mem, anat_only, longitudinal, omp_nthreads, skull_strip_ants, work_dir, output_dir, bids_dir, freesurfer, output_spaces, template, hires, bold2t1w_dof, fmap_bspline, fmap_demean, use_syn, force_syn, use_aroma, ignore_aroma_err, output_grid_ref)[source]

This workflow organizes the execution of FMRIPREP, with a sub-workflow for each subject.

If FreeSurfer is to be used, a FreeSurfer derivatives folder is created and populated with any needed template subjects.

(Source code)

Parameters

subject_list : list
List of subject labels
task_id : str or None
Task ID of BOLD series to preprocess, or None to preprocess all
run_uuid : str
Unique identifier for execution instance
ignore : list
Preprocessing steps to skip (may include “slicetiming”, “fieldmaps”)
debug : bool
Enable debugging outputs
low_mem : bool
Write uncompressed .nii files in some cases to reduce memory usage
anat_only : bool
Disable functional workflows
longitudinal : bool
Treat multiple sessions as longitudinal (may increase runtime) See sub-workflows for specific differences
omp_nthreads : int
Maximum number of threads an individual process may use
skull_strip_ants : bool
Use ANTs BrainExtraction.sh-based skull-stripping workflow If False, uses a faster AFNI-based workflow
work_dir : str
Directory in which to store workflow execution state and temporary files
output_dir : str
Directory in which to save derivatives
bids_dir : str
Root directory of BIDS dataset
freesurfer : bool
Enable FreeSurfer surface reconstruction (may increase runtime)
output_spaces : list

List of output spaces functional images are to be resampled to. Some parts of pipeline will only be instantiated for some output spaces.

Valid spaces:

  • T1w
  • template
  • fsnative
  • fsaverage (or other pre-existing FreeSurfer templates)
template : str
Name of template targeted by ‘template’ output space
hires : bool
Enable sub-millimeter preprocessing in FreeSurfer
bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
fmap_bspline : bool
Experimental: Fit B-Spline field using least-squares
fmap_demean : bool
Demean voxel-shift map during unwarp
use_syn : bool
Experimental: Enable ANTs SyN-based susceptibility distortion correction (SDC). If fieldmaps are present and enabled, this is not run, by default.
force_syn : bool
Temporary: Always run SyN-based SDC
use_aroma : bool
Perform ICA-AROMA on MNI-resampled functional series
ignore_aroma_err : bool
Do not fail on ICA-AROMA errors
output_grid_ref : str or None
Path of custom reference image for normalization
fmriprep.workflows.base.init_single_subject_wf(subject_id, task_id, name, ignore, debug, low_mem, anat_only, longitudinal, omp_nthreads, skull_strip_ants, reportlets_dir, output_dir, bids_dir, freesurfer, output_spaces, template, hires, bold2t1w_dof, fmap_bspline, fmap_demean, use_syn, force_syn, output_grid_ref, use_aroma, ignore_aroma_err)[source]

This workflow organizes the preprocessing pipeline for a single subject. It collects and reports information about the subject, and prepares sub-workflows to perform anatomical and functional preprocessing.

Anatomical preprocessing is performed in a single workflow, regardless of the number of sessions. Functional preprocessing is performed using a separate workflow for each individual BOLD series.

../_images/index-2.png

(Source code, png, svg, pdf)

Parameters

subject_id : str
List of subject labels
task_id : str or None
Task ID of BOLD series to preprocess, or None to preprocess all
name : str
Name of workflow
ignore : list
Preprocessing steps to skip (may include “slicetiming”, “fieldmaps”)
debug : bool
Enable debugging outputs
low_mem : bool
Write uncompressed .nii files in some cases to reduce memory usage
anat_only : bool
Disable functional workflows
longitudinal : bool
Treat multiple sessions as longitudinal (may increase runtime) See sub-workflows for specific differences
omp_nthreads : int
Maximum number of threads an individual process may use
skull_strip_ants : bool
Use ANTs BrainExtraction.sh-based skull-stripping workflow If False, uses a faster AFNI-based workflow
reportlets_dir : str
Directory in which to save reportlets
output_dir : str
Directory in which to save derivatives
bids_dir : str
Root directory of BIDS dataset
freesurfer : bool
Enable FreeSurfer surface reconstruction (may increase runtime)
output_spaces : list

List of output spaces functional images are to be resampled to. Some parts of pipeline will only be instantiated for some output spaces.

Valid spaces:

  • T1w
  • template
  • fsnative
  • fsaverage (or other pre-existing FreeSurfer templates)
template : str
Name of template targeted by ‘template’ output space
hires : bool
Enable sub-millimeter preprocessing in FreeSurfer
bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
fmap_bspline : bool
Experimental: Fit B-Spline field using least-squares
fmap_demean : bool
Demean voxel-shift map during unwarp
use_syn : bool
Experimental: Enable ANTs SyN-based susceptibility distortion correction (SDC). If fieldmaps are present and enabled, this is not run, by default.
force_syn : bool
Temporary: Always run SyN-based SDC
output_grid_ref : str or None
Path of custom reference image for normalization
use_aroma : bool
Perform ICA-AROMA on MNI-resampled functional series
ignore_aroma_err : bool
Do not fail on ICA-AROMA errors

Inputs

subjects_dir
FreeSurfer SUBJECTS_DIR

Anatomical reference preprocessing workflows

fmriprep.workflows.anatomical.init_anat_preproc_wf(skull_strip_ants, output_spaces, template, debug, freesurfer, longitudinal, omp_nthreads, hires, reportlets_dir, output_dir, name='anat_preproc_wf')[source]

This workflow controls the anatomical preprocessing stages of FMRIPREP.

This includes:

  • Creation of a structural template
  • Skull-stripping and bias correction
  • Tissue segmentation
  • Normalization
  • Surface reconstruction with FreeSurfer
../_images/index-3.png

(Source code, png, svg, pdf)

Parameters

skull_strip_ants : bool
Use ANTs BrainExtraction.sh-based skull-stripping workflow. If False, uses a faster AFNI-based workflow
output_spaces : list

List of output spaces functional images are to be resampled to.

Some pipeline components will only be instantiated for some output spaces.

Valid spaces:

  • T1w
  • template
  • fsnative
  • fsaverage (or other pre-existing FreeSurfer templates)
template : str
Name of template targeted by ‘template’ output space
debug : bool
Enable debugging outputs
freesurfer : bool
Enable FreeSurfer surface reconstruction (may increase runtime)
longitudinal : bool
Create unbiased structural template, regardless of number of inputs (may increase runtime)
omp_nthreads : int
Maximum number of threads an individual process may use
hires : bool
Enable sub-millimeter preprocessing in FreeSurfer
reportlets_dir : str
Directory in which to save reportlets
output_dir : str
Directory in which to save derivatives
name : str, optional
Workflow name (default: anat_preproc_wf)

Inputs

t1w
List of T1-weighted structural images
t2w
List of T2-weighted structural images
subjects_dir
FreeSurfer SUBJECTS_DIR

Outputs

t1_preproc
Bias-corrected structural template, defining T1w space
t1_brain
Skull-stripped t1_preproc
t1_mask
Mask of the skull-stripped template image
t1_seg
Segmentation of preprocessed structural image, including gray-matter (GM), white-matter (WM) and cerebrospinal fluid (CSF)
t1_tpms
List of tissue probability maps in T1w space
t1_2_mni
T1w template, normalized to MNI space
t1_2_mni_forward_transform
ANTs-compatible affine-and-warp transform file
t1_2_mni_reverse_transform
ANTs-compatible affine-and-warp transform file (inverse)
mni_mask
Mask of skull-stripped template, in MNI space
mni_seg
Segmentation, resampled into MNI space
mni_tpms
List of tissue probability maps in MNI space
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
fs_2_t1_transform
Affine transform from FreeSurfer subject space to T1w space
surfaces
GIFTI surfaces (gray/white boundary, midthickness, pial, inflated)

Subworkflows

fmriprep.workflows.anatomical.init_skullstrip_ants_wf(debug, omp_nthreads, name='skullstrip_ants_wf')[source]

This workflow performs skull-stripping using ANTs’ BrainExtraction.sh

../_images/index-4.png

(Source code, png, svg, pdf)

Parameters

debug : bool
Enable debugging outputs
omp_nthreads : int
Maximum number of threads an individual process may use

Inputs

in_file
T1-weighted structural image to skull-strip

Outputs

bias_corrected
Bias-corrected in_file, before skull-stripping
out_file
Skull-stripped in_file
out_mask
Binary mask of the skull-stripped in_file
out_report
Reportlet visualizing quality of skull-stripping

Surface preprocessing

fmriprep uses FreeSurfer to reconstruct surfaces from T1w/T2w structural images.

fmriprep.workflows.anatomical.init_surface_recon_wf(omp_nthreads, hires, name='surface_recon_wf')[source]

This workflow reconstructs anatomical surfaces using FreeSurfer’s recon-all.

Reconstruction is performed in three phases. The first phase initializes the subject with T1w and T2w (if available) structural images and performs basic reconstruction (autorecon1) with the exception of skull-stripping. For example, a subject with only one session with T1w and T2w images would be processed by the following command:

$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -i <bids-root>/sub-<subject_label>/anat/sub-<subject_label>_T1w.nii.gz \
    -T2 <bids-root>/sub-<subject_label>/anat/sub-<subject_label>_T2w.nii.gz \
    -autorecon1 \
    -noskullstrip

The second phase imports an externally computed skull-stripping mask. The final phase resumes reconstruction, using the T2w image to assist in finding the pial surface, if available. See init_autorecon_resume_wf() for details.

../_images/index-5.png

(Source code, png, svg, pdf)

Parameters

omp_nthreads : int
Maximum number of threads an individual process may use
hires : bool
Enable sub-millimeter preprocessing in FreeSurfer

Inputs

t1w
List of T1-weighted structural images
t2w
List of T2-weighted structural images (only first used)
skullstripped_t1
Skull-stripped T1-weighted image (or mask of image)
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID

Outputs

subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
fs_2_t1_transform
FSL-style affine matrix translating from FreeSurfer T1.mgz to T1w
surfaces
GIFTI surfaces for gray/white matter boundary, pial surface, midthickness (or graymid) surface, and inflated surfaces
out_report
Reportlet visualizing quality of surface alignment

Subworkflows

fmriprep.workflows.anatomical.init_autorecon_resume_wf(omp_nthreads, name='autorecon_resume_wf')[source]

This workflow resumes recon-all execution, assuming the -autorecon1 stage has been completed.

In order to utilize resources efficiently, this is broken down into five sub-stages; after the first stage, the second and third stages may be run simultaneously, and the fourth and fifth stages may be run simultaneously, if resources permit:

$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -autorecon2-volonly
$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -autorecon-hemi lh \
    -noparcstats -nocortparc2 -noparcstats2 -nocortparc3 \
    -noparcstats3 -nopctsurfcon -nohyporelabel -noaparc2aseg \
    -noapas2aseg -nosegstats -nowmparc -nobalabels
$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -autorecon-hemi rh \
    -noparcstats -nocortparc2 -noparcstats2 -nocortparc3 \
    -noparcstats3 -nopctsurfcon -nohyporelabel -noaparc2aseg \
    -noapas2aseg -nosegstats -nowmparc -nobalabels
$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -autorecon3 -hemi lh -T2pial
$ recon-all -sd <output dir>/freesurfer -subjid sub-<subject_label> \
    -autorecon3 -hemi rh -T2pial

The excluded steps in the second and third stages (-no<option>) are not fully hemisphere independent, and are therefore postponed to the final two stages.

../_images/index-6.png

(Source code, png, svg, pdf)

Inputs

subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
use_T2
Refine pial surface using T2w images

Outputs

subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
out_report
Reportlet visualizing quality of surface alignment
fmriprep.workflows.anatomical.init_gifti_surface_wf(name='gifti_surface_wf')[source]

This workflow prepares GIFTI surfaces from a FreeSurfer subjects directory

If midthickness (or graymid) surfaces do not exist, they are generated and saved to the subject directory as lh/rh.midthickness. These, along with the gray/white matter boundary (lh/rh.smoothwm), pial sufaces (lh/rh.pial) and inflated surfaces (lh/rh.inflated) are converted to GIFTI files. Additionally, the vertex coordinates are recentered to align with native T1w space.

../_images/index-7.png

(Source code, png, svg, pdf)

Inputs

subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID

Outputs

surfaces
GIFTI surfaces for gray/white matter boundary, pial surface, midthickness (or graymid) surface, and inflated surfaces

BOLD fMRI -processing workflows

fmriprep.workflows.bold.init_func_preproc_wf(bold_file, ignore, freesurfer, bold2t1w_dof, reportlets_dir, output_spaces, template, output_dir, omp_nthreads, fmap_bspline, fmap_demean, use_syn, force_syn, use_aroma, ignore_aroma_err, debug, low_mem, output_grid_ref, layout=None)[source]

This workflow controls the functional preprocessing stages of FMRIPREP.

../_images/index-8.png

(Source code, png, svg, pdf)

Parameters

bold_file : str
BOLD series NIfTI file
ignore : list
Preprocessing steps to skip (may include “slicetiming”, “fieldmaps”)
freesurfer : bool
Enable FreeSurfer functional registration (bbregister) and resampling BOLD series to FreeSurfer surface meshes.
bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
reportlets_dir : str
Directory in which to save reportlets
output_spaces : list

List of output spaces functional images are to be resampled to. Some parts of pipeline will only be instantiated for some output spaces.

Valid spaces:

  • T1w
  • template
  • fsnative
  • fsaverage (or other pre-existing FreeSurfer templates)
template : str
Name of template targeted by ‘template’ output space
output_dir : str
Directory in which to save derivatives
omp_nthreads : int
Maximum number of threads an individual process may use
fmap_bspline : bool
Experimental: Fit B-Spline field using least-squares
fmap_demean : bool
Demean voxel-shift map during unwarp
use_syn : bool
Experimental: Enable ANTs SyN-based susceptibility distortion correction (SDC). If fieldmaps are present and enabled, this is not run, by default.
force_syn : bool
Temporary: Always run SyN-based SDC
use_aroma : bool
Perform ICA-AROMA on MNI-resampled functional series
ignore_aroma_err : bool
Do not fail on ICA-AROMA errors
debug : bool
Enable debugging outputs
low_mem : bool
Write uncompressed .nii files in some cases to reduce memory usage
output_grid_ref : str or None
Path of custom reference image for normalization
layout : BIDSLayout
BIDSLayout structure to enable metadata retrieval

Inputs

bold_file
BOLD series NIfTI file
t1_preproc
Bias-corrected structural template image
t1_brain
Skull-stripped t1_preproc
t1_mask
Mask of the skull-stripped template image
t1_seg
Segmentation of preprocessed structural image, including gray-matter (GM), white-matter (WM) and cerebrospinal fluid (CSF)
t1_tpms
List of tissue probability maps in T1w space
t1_2_mni_forward_transform
ANTs-compatible affine-and-warp transform file
t1_2_mni_reverse_transform
ANTs-compatible affine-and-warp transform file (inverse)
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
fs_2_t1_transform
Affine transform from FreeSurfer subject space to T1w space

Outputs

bold_t1
BOLD series, resampled to T1w space
bold_mask_t1
BOLD series mask in T1w space
bold_mni
BOLD series, resampled to template space
bold_mask_mni
BOLD series mask in template space
confounds
TSV of confounds
surfaces
BOLD series, resampled to FreeSurfer surfaces
aroma_noise_ics
Noise components identified by ICA-AROMA
melodic_mix
FSL MELODIC mixing matrix
fmriprep.workflows.bold.init_bold_reference_wf(omp_nthreads, bold_file=None, name='bold_reference_wf')[source]

This workflow generates reference BOLD images for a series

The raw reference image is the target of HMC, and a contrast-enhanced reference is the subject of distortion correction, as well as boundary-based registration to T1w and template spaces.

../_images/index-9.png

(Source code, png, svg, pdf)

Parameters

bold_file : str
BOLD series NIfTI file
omp_nthreads : int
Maximum number of threads an individual process may use
name : str
Name of workflow (default: bold_reference_wf)

Inputs

bold_file
BOLD series NIfTI file

Outputs

bold_file
Validated BOLD series NIfTI file
raw_ref_image
Reference image to which BOLD series is motion corrected
skip_vols
Number of non-steady-state volumes detected at beginning of bold_file
ref_image
Contrast-enhanced reference image
ref_image_brain
Skull-stripped reference image
bold_mask
Skull-stripping mask of reference image
bold_mask_report
Reportlet showing quality of masking
validation_report
HTML reportlet indicating whether bold_file had a valid affine
fmriprep.workflows.bold.init_bold_hmc_wf(metadata, bold_file_size_gb, ignore, name='bold_hmc_wf', omp_nthreads=1)[source]

This workflow performs HMC over the input BOLD image.

../_images/index-10.png

(Source code, png, svg, pdf)

Parameters

metadata : dict
BIDS metadata for BOLD file
bold_file_size_gb : float
Size of BOLD file in GB
ignore : list
Preprocessing steps to skip - if “slicetiming” is included, skip slice-timing correction
name : str
Name of workflow (default: bold_hmc_wf)
omp_nthreads : int
Maximum number of threads an individual process may use

Inputs

bold_file
BOLD series NIfTI file
raw_ref_image
Reference image to which BOLD series is motion corrected
skip_vols
Number of non-steady-state volumes detected at beginning of bold_file

Outputs

bold_split
Individual 3D volumes, not motion corrected
xforms
List of affine transforms aligning each volume to ref_image in ITK format
movpar_file
MCFLIRT motion parameters, normalized to SPM format (X, Y, Z, Rx, Ry, Rz)
fmriprep.workflows.bold.init_bold_reg_wf(freesurfer, bold2t1w_dof, bold_file_size_gb, name='bold_reg_wf', use_compression=True, use_fieldwarp=False)[source]

This workflow registers the reference BOLD image to T1-space, using a boundary-based registration (BBR) cost function.

If FreeSurfer-based preprocessing is enabled, the bbregister utility is used to align the BOLD images to the reconstructed subject, and the resulting transform is adjusted to target the T1 space. If FreeSurfer-based preprocessing is disabled, FSL FLIRT is used with the BBR cost function to directly target the T1 space.

../_images/index-11.png

(Source code, png, svg, pdf)

Parameters

freesurfer : bool
Enable FreeSurfer functional registration (bbregister)
bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
bold_file_size_gb : float
Size of BOLD file in GB
name : str
Name of workflow (default: bold_reg_wf)
use_compression : bool
Save registered BOLD series as .nii.gz
use_fieldwarp : bool
Include SDC warp in single-shot transform from BOLD to T1

Inputs

name_source
BOLD series NIfTI file Used to recover original information lost during processing
ref_bold_brain
Reference image to which BOLD series is aligned If fieldwarp == True, ref_bold_brain should be unwarped
ref_bold_mask
Skull-stripping mask of reference image
t1_preproc
Bias-corrected structural template image
t1_brain
Skull-stripped t1_preproc
t1_mask
Mask of the skull-stripped template image
t1_seg
Segmentation of preprocessed structural image, including gray-matter (GM), white-matter (WM) and cerebrospinal fluid (CSF)
bold_split
Individual 3D BOLD volumes, not motion corrected
hmc_xforms
List of affine transforms aligning each volume to ref_image in ITK format
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID
fs_2_t1_transform
Affine transform from FreeSurfer subject space to T1w space
fieldwarp
a DFM in ITK format

Outputs

mat_bold_to_t1
Affine transform from ref_bold_brain to T1 space (FSL format)
mat_t1_to_bold
Affine transform from T1 space to BOLD space (FSL format)
itk_bold_to_t1
Affine transform from ref_bold_brain to T1 space (ITK format)
itk_t1_to_bold
Affine transform from T1 space to BOLD space (ITK format)
bold_t1
Motion-corrected BOLD series in T1 space
bold_mask_t1
BOLD mask in T1 space
fs_reg_file
Affine transform from ref_bold_brain to T1 space (FreeSurfer reg format)
out_report
Reportlet visualizing quality of registration

Registration workflows

fmriprep.workflows.util.init_bbreg_wf(bold2t1w_dof, report, reregister=True, name='bbreg_wf')[source]

This workflow uses FreeSurfer’s bbregister to register a BOLD image to a T1-weighted structural image.

It is a counterpart to init_fsl_bbr_wf(), which performs the same task using FSL’s FLIRT with a BBR cost function.

../_images/index-12.png

(Source code, png, svg, pdf)

Parameters

bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
report : bool
Generate visual report of registration quality
rereigster : bool, optional
Update affine registration matrix with FreeSurfer-T1w transform (default: True)
name : str, optional
Workflow name (default: bbreg_wf)

Inputs

in_file
Reference BOLD image to be registered
fs_2_t1_transform
FSL-style affine matrix translating from FreeSurfer T1.mgz to T1w
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID (must have folder in SUBJECTS_DIR)
t1_brain
Unused (see init_fsl_bbr_wf())
t1_seg
Unused (see init_fsl_bbr_wf())

Outputs

out_matrix_file
FSL-style registration matrix
out_reg_file
FreeSurfer-style registration matrix (.dat)
final_cost
Value of cost function at final registration
out_report
reportlet for assessing registration quality
fmriprep.workflows.util.init_fsl_bbr_wf(bold2t1w_dof, report, name='fsl_bbr_wf')[source]

This workflow uses FSL FLIRT to register a BOLD image to a T1-weighted structural image, using a boundary-based registration (BBR) cost function.

It is a counterpart to init_bbreg_wf(), which performs the same task using FreeSurfer’s bbregister.

(Source code)

Parameters

bold2t1w_dof : 6, 9 or 12
Degrees-of-freedom for BOLD-T1w registration
report : bool
Generate visual report of registration quality
name : str, optional
Workflow name (default: fsl_bbr_wf)

Inputs

in_file
Reference BOLD image to be registered
t1_brain
Skull-stripped T1-weighted structural image
t1_seg
FAST segmentation of t1_brain
fs_2_t1_transform
Unused (see init_bbreg_wf())
subjects_dir
Unused (see init_bbreg_wf())
subject_id
Unused (see init_bbreg_wf())

Outputs

out_matrix_file
FSL-style registration matrix
out_reg_file
Unused (see init_bbreg_wf())
final_cost
Value of cost function at final registration
out_report
reportlet for assessing registration quality

Resampling workflows

fmriprep.workflows.bold.init_bold_surf_wf(output_spaces, name='bold_surf_wf')[source]

This workflow samples functional images to FreeSurfer surfaces

For each vertex, the cortical ribbon is sampled at six points (spaced 20% of thickness apart) and averaged.

Outputs are in GIFTI format.

../_images/index-14.png

(Source code, png, svg, pdf)

Parameters

output_spaces : list
List of output spaces functional images are to be resampled to Target spaces beginning with fs will be selected for resampling, such as fsaverage or related template spaces If the list contains fsnative, images will be resampled to the individual subject’s native surface

Inputs

source_file
Motion-corrected BOLD series in T1 space
subjects_dir
FreeSurfer SUBJECTS_DIR
subject_id
FreeSurfer subject ID

Outputs

surfaces
BOLD series, resampled to FreeSurfer surfaces
fmriprep.workflows.bold.init_bold_mni_trans_wf(template, bold_file_size_gb, name='bold_mni_trans_wf', output_grid_ref=None, use_compression=True, use_fieldwarp=False)[source]

This workflow samples functional images to the MNI template in a “single shot” from the original BOLD series.

../_images/index-15.png

(Source code, png, svg, pdf)

Parameters

template : str
Name of template targeted by ‘template’ output space
bold_file_size_gb : float
Size of BOLD file in GB
name : str
Name of workflow (default: bold_mni_trans_wf)
output_grid_ref : str or None
Path of custom reference image for normalization
use_compression : bool
Save registered BOLD series as .nii.gz
use_fieldwarp : bool
Include SDC warp in single-shot transform from BOLD to MNI

Inputs

itk_bold_to_t1
Affine transform from ref_bold_brain to T1 space (ITK format)
t1_2_mni_forward_transform
ANTs-compatible affine-and-warp transform file
bold_split
Individual 3D volumes, not motion corrected
bold_mask
Skull-stripping mask of reference image
name_source
BOLD series NIfTI file Used to recover original information lost during processing
hmc_xforms
List of affine transforms aligning each volume to ref_image in ITK format
fieldwarp
a DFM in ITK format

Outputs

bold_mni
BOLD series, resampled to template space
bold_mask_mni
BOLD series mask in template space

Utility workflows

fmriprep.workflows.util.init_enhance_and_skullstrip_bold_wf(name='enhance_and_skullstrip_bold_wf', omp_nthreads=1)[source]

This workflow takes in a BOLD volume, and attempts to enhance the contrast between gray and white matter, and skull-stripping the result.

../_images/index-16.png

(Source code, png, svg, pdf)

Inputs

in_file
BOLD image (single volume)

Outputs

bias_corrected_file
the in_file after N4BiasFieldCorrection
skull_stripped_file
the bias_corrected_file after skull-stripping
mask_file
mask of the skull-stripped input file
out_report
reportlet for the skull-stripping
fmriprep.workflows.util.init_skullstrip_bold_wf(name='skullstrip_bold_wf')[source]

This workflow applies skull-stripping to a BOLD image.

It is intended to be used on an image that has previously been bias-corrected with init_enhance_and_skullstrip_bold_wf()

../_images/index-17.png

(Source code, png, svg, pdf)

Inputs

in_file
BOLD image (single volume)

Outputs

skull_stripped_file
the in_file after skull-stripping
mask_file
mask of the skull-stripped input file
out_report
reportlet for the skull-stripping