Warning: This document is for the development version of smriprep. The main version is master.

smriprep.workflows.base module

sMRIPrep base processing workflows.

smriprep.workflows.base.init_single_subject_wf(*, sloppy, debug, derivatives, freesurfer, hires, fs_no_resume, layout, longitudinal, low_mem, msm_sulc, name, omp_nthreads, output_dir, skull_strip_fixed_seed, skull_strip_mode, skull_strip_template, spaces, subject_id, bids_filters, cifti_output)[source]

Create a single subject workflow.

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.

Workflow Graph
../_images/smriprep-workflows-base-1.png

(Source code, png, svg, pdf)

Parameters:
  • sloppy (bool) – Quick, impercise operations. Used to decrease workflow duration.

  • debug (bool) – Enable debugging outputs

  • derivatives (list of directories) – Fast-track the workflow by searching for existing derivatives.

  • freesurfer (bool) – Enable FreeSurfer surface reconstruction (may increase runtime)

  • hires (bool) – Enable sub-millimeter preprocessing in FreeSurfer

  • fs_no_resume (bool) – Adjust pipeline to reuse base template of an existing longitudinal freesurfer output

  • layout (BIDSLayout object) – BIDS dataset layout

  • longitudinal (bool) – Treat multiple sessions as longitudinal (may increase runtime) See sub-workflows for specific differences

  • low_mem (bool) – Write uncompressed .nii files in some cases to reduce memory usage

  • name (str) – Name of workflow

  • omp_nthreads (int) – Maximum number of threads an individual process may use

  • output_dir (str) – Directory in which to save derivatives

  • skull_strip_fixed_seed (bool) – Do not use a random seed for skull-stripping - will ensure run-to-run replicability when used with –omp-nthreads 1

  • skull_strip_mode (str) – Determiner for T1-weighted skull stripping (force ensures skull stripping, skip ignores skull stripping, and auto automatically ignores skull stripping if pre-stripped brains are detected).

  • skull_strip_template (Reference) – Spatial reference to use in atlas-based brain extraction.

  • spaces (SpatialReferences) – Object containing standard and nonstandard space specifications.

  • subject_id (str) – List of subject labels

  • bids_filters (dict) – Provides finer specification of the pipeline input files through pybids entities filters. A dict with the following structure {<suffix>:{<entity>:<filter>,…},…}

Inputs:

subjects_dir – FreeSurfer SUBJECTS_DIR

smriprep.workflows.base.init_smriprep_wf(*, sloppy, debug, derivatives, freesurfer, fs_subjects_dir, hires, fs_no_resume, layout, longitudinal, low_mem, msm_sulc, omp_nthreads, output_dir, run_uuid, skull_strip_mode, skull_strip_fixed_seed, skull_strip_template, spaces, subject_list, work_dir, bids_filters, cifti_output)[source]

Create the execution graph of sMRIPrep, with a sub-workflow for each subject.

If FreeSurfer’s recon-all is to be run, a FreeSurfer derivatives folder is created and populated with any needed template subjects.

Workflow Graph
../_images/smriprep-workflows-base-2.png

(Source code, png, svg, pdf)

Parameters:
  • sloppy (bool) – Quick, impercise operations. Used to decrease workflow duration.

  • debug (bool) – Enable debugging outputs

  • derivatives (list of directories) – Fast-track the workflow by searching for existing derivatives.

  • freesurfer (bool) – Enable FreeSurfer surface reconstruction (may increase runtime)

  • fs_subjects_dir (os.PathLike or None) – Use existing FreeSurfer subjects directory if provided

  • hires (bool) – Enable sub-millimeter preprocessing in FreeSurfer

  • layout (BIDSLayout object) – BIDS dataset layout

  • longitudinal (bool) – Treat multiple sessions as longitudinal (may increase runtime) See sub-workflows for specific differences

  • low_mem (bool) – Write uncompressed .nii files in some cases to reduce memory usage

  • msm_sulc (bool) – Run Multimodal Surface Matching with sulcal depth maps

  • omp_nthreads (int) – Maximum number of threads an individual process may use

  • output_dir (str) – Directory in which to save derivatives

  • run_uuid (str) – Unique identifier for execution instance

  • skull_strip_fixed_seed (bool) – Do not use a random seed for skull-stripping - will ensure run-to-run replicability when used with –omp-nthreads 1

  • skull_strip_mode (str) – Determiner for T1-weighted skull stripping (force ensures skull stripping, skip ignores skull stripping, and auto automatically ignores skull stripping if pre-stripped brains are detected).

  • skull_strip_template (Reference) – Spatial reference to use in atlas-based brain extraction.

  • spaces (SpatialReferences) – Object containing standard and nonstandard space specifications.

  • subject_list (list) – List of subject labels

  • work_dir (str) – Directory in which to store workflow execution state and temporary files

  • bids_filters (dict) – Provides finer specification of the pipeline input files through pybids entities filters. A dict with the following structure {<suffix>:{<entity>:<filter>,…},…}