Warning: This document is for an old version of smriprep. The main version is master.

smriprep.workflows.base module

sMRIPrep base processing workflows.

smriprep.workflows.base.init_single_subject_wf(debug, freesurfer, fast_track, hires, layout, longitudinal, low_mem, name, omp_nthreads, output_dir, skull_strip_fixed_seed, skull_strip_mode, skull_strip_template, spaces, subject_id, bids_filters)

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
  • debug (bool) – Enable debugging outputs

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

  • fast_track (bool) – If True, attempt to collect previously run derivatives.

  • 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

  • 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(debug, fast_track, freesurfer, fs_subjects_dir, hires, layout, longitudinal, low_mem, omp_nthreads, output_dir, run_uuid, skull_strip_mode, skull_strip_fixed_seed, skull_strip_template, spaces, subject_list, work_dir, bids_filters)

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
  • debug (bool) – Enable debugging outputs

  • fast_track (bool) – 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

  • 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>,…},…}