smriprep.workflows.outputs module

Writing outputs.

smriprep.workflows.outputs.init_anat_reports_wf(*, spaces, freesurfer, output_dir, sloppy=False, name='anat_reports_wf')[source]

Set up a battery of datasinks to store reports in the right location.

Parameters:
  • freesurfer (bool) – FreeSurfer was enabled

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

  • name (str) – Workflow name (default: anat_reports_wf)

Inputs:
  • source_file – Input T1w image

  • std_t1w – T1w image resampled to standard space

  • std_mask – Mask of skull-stripped template

  • subject_dir – FreeSurfer SUBJECTS_DIR

  • subject_id – FreeSurfer subject ID

  • t1w_conform_report – Conformation report

  • t1w_preproc – The T1w reference map, which is calculated as the average of bias-corrected and preprocessed T1w images, defining the anatomical space.

  • t1w_dseg – Segmentation in T1w space

  • t1w_mask – Brain (binary) mask estimated by brain extraction.

  • template – Template space and specifications

smriprep.workflows.outputs.init_anat_second_derivatives_wf(*, bids_root: str, output_dir: str, cifti_output: Literal['91k', '170k', False], name='anat_second_derivatives_wf', tpm_labels=('GM', 'WM', 'CSF'))[source]

Set up a battery of datasinks to store derivatives in the right location.

Parameters:
  • bids_root (str) – Root path of BIDS dataset

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

  • name (str) – Workflow name (default: anat_derivatives_wf)

  • tpm_labels (tuple) – Tissue probability maps in order

Inputs:
  • template – Template space and specifications

  • source_files – List of input T1w images

  • t1w_preproc – The T1w reference map, which is calculated as the average of bias-corrected and preprocessed T1w images, defining the anatomical space.

  • t1w_mask – Mask of the t1w_preproc

  • t1w_dseg – Segmentation in T1w space

  • t1w_tpms – Tissue probability maps in T1w space

  • anat2std_xfm – Nonlinear spatial transform to resample imaging data given in anatomical space into standard space.

  • surfaces – GIFTI surfaces (gray/white boundary, midthickness, pial, inflated)

  • morphometrics – GIFTIs of cortical thickness, curvature, and sulcal depth

  • t1w_fs_aseg – FreeSurfer’s aseg segmentation, in native T1w space

  • t1w_fs_aparc – FreeSurfer’s aparc+aseg segmentation, in native T1w space

  • cifti_morph – Morphometric CIFTI-2 dscalar files

  • cifti_metadata – JSON files containing metadata dictionaries

smriprep.workflows.outputs.init_ds_anat_volumes_wf(*, bids_root: str, output_dir: str, name='ds_anat_volumes_wf', tpm_labels=('GM', 'WM', 'CSF')) Workflow[source]
smriprep.workflows.outputs.init_ds_dseg_wf(*, output_dir, name='ds_dseg_wf')[source]

Save discrete segmentations

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

  • name (str) – Workflow name (default: ds_dseg_wf)

Inputs:
  • source_files – List of input T1w images

  • t1w_dseg – Segmentation in T1w space

Outputs:

t1w_dseg – The location in the output directory of the discrete segmentation

smriprep.workflows.outputs.init_ds_fs_registration_wf(*, output_dir, name='ds_fs_registration_wf')[source]

Save rigid registration between subject anatomical template and FreeSurfer T1.mgz

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

  • name (str) – Workflow name (default: ds_fs_registration_wf)

Inputs:
  • source_files – List of input T1w images

  • fsnative2t1w_xfm – LTA-style affine matrix translating from FreeSurfer-conformed subject space to T1w

Outputs:
  • t1w2fsnative_xfm – LTA-style affine matrix translating from T1w to FreeSurfer-conformed subject space

  • fsnative2t1w_xfm – LTA-style affine matrix translating from FreeSurfer-conformed subject space to T1w

smriprep.workflows.outputs.init_ds_grayord_metrics_wf(*, bids_root: str, output_dir: str, metrics: list[str], cifti_output: Literal['91k', '170k'], name='ds_grayord_metrics_wf') LiterateWorkflow[source]

Save CIFTI-2 surface metrics

Parameters:
  • bids_root (str) – Root path of BIDS dataset

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

  • metrics (str) – List of metrics to generate DataSinks for

  • cifti_output (str) – Density of CIFTI-2 files to save

  • name (str) – Workflow name (default: ds_surface_metrics_wf)

Inputs:
  • source_files – List of input T1w images

  • ``<metric>`` – CIFTI-2 scalar file for each metric passed to metrics

  • ``<metric>_metadata`` – JSON file containing metadata for each metric passed to metrics

Outputs:

``<metric>`` – CIFTI-2 scalar file in output_dir for each metric passed to metrics

smriprep.workflows.outputs.init_ds_mask_wf(*, bids_root: str, output_dir: str, mask_type: str, name='ds_mask_wf')[source]

Save the subject brain mask

Parameters:
  • bids_root (str) – Root path of BIDS dataset

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

  • name (str) – Workflow name (default: ds_mask_wf)

Inputs:
  • source_files – List of input T1w images

  • mask_file – Mask to save

Outputs:

mask_file – The location in the output directory of the mask

smriprep.workflows.outputs.init_ds_surface_metrics_wf(*, bids_root: str, output_dir: str, metrics: list[str], name='ds_surface_metrics_wf') LiterateWorkflow[source]

Save GIFTI surface metrics

Parameters:
  • bids_root (str) – Root path of BIDS dataset

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

  • metrics (str) – List of metrics to generate DataSinks for

  • name (str) – Workflow name (default: ds_surface_metrics_wf)

Inputs:
  • source_files – List of input T1w images

  • ``<metric>`` – Left and right GIFTIs for each metric passed to metrics

Outputs:

``<metric>`` – Left and right GIFTIs in output_dir for each metric passed to metrics

smriprep.workflows.outputs.init_ds_surfaces_wf(*, bids_root: str, output_dir: str, surfaces: list[str], name='ds_surfaces_wf') LiterateWorkflow[source]

Save GIFTI surfaces

Parameters:
  • bids_root (str) – Root path of BIDS dataset

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

  • surfaces (str) – List of surfaces to generate DataSinks for

  • name (str) – Workflow name (default: ds_surfaces_wf)

Inputs:
  • source_files – List of input T1w images

  • ``<surface>`` – Left and right GIFTIs for each surface passed to surfaces

Outputs:

``<surface>`` – Left and right GIFTIs in output_dir for each surface passed to surfaces

smriprep.workflows.outputs.init_ds_template_registration_wf(*, output_dir, name='ds_template_registration_wf')[source]

Save template registration transforms

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

  • name (str) – Workflow name (default: anat_derivatives_wf)

Inputs:
  • template – Template space and specifications

  • source_files – List of input T1w images

  • anat2std_xfm – Nonlinear spatial transform to resample imaging data given in anatomical space into standard space.

  • std2anat_xfm – Inverse transform of anat2std_xfm

smriprep.workflows.outputs.init_ds_template_wf(*, num_t1w, output_dir, name='ds_template_wf')[source]

Save the subject-specific template

Parameters:
  • num_t1w (int) – Number of T1w images

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

  • name (str) – Workflow name (default: ds_template_wf)

Inputs:
  • source_files – List of input T1w images

  • t1w_ref_xfms – List of affine transforms to realign input T1w images

  • t1w_preproc – The T1w reference map, which is calculated as the average of bias-corrected and preprocessed T1w images, defining the anatomical space.

Outputs:

t1w_preproc – The location in the output directory of the preprocessed T1w image

smriprep.workflows.outputs.init_ds_tpms_wf(*, output_dir, name='ds_tpms_wf', tpm_labels=('GM', 'WM', 'CSF'))[source]

Save tissue probability maps

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

  • name (str) – Workflow name (default: anat_derivatives_wf)

  • tpm_labels (tuple) – Tissue probability maps in order

Inputs:
  • source_files – List of input T1w images

  • t1w_tpms – Tissue probability maps in T1w space

Outputs:

t1w_tpms – The location in the output directory of the tissue probability maps

smriprep.workflows.outputs.init_template_iterator_wf(*, spaces: SpatialReferences, sloppy: bool = False, name='template_iterator_wf')[source]

Prepare the necessary components to resample an image to a template space

This produces a workflow with an unjoined iterable named “spacesource”.

It takes as input a collated list of template specifiers and transforms to that space.

The fields in outputnode can be used as if they come from a single template.