Skip to content

output_template_space

This subworkflow is used to output files in a specific template space. It leverages the templateflow template repository to fetch the requested template and its associated files, then register the input files to the requested template space.

The subworkflow relies on three parameters to be set:

- params.template: the template to use (e.g., ‘MNI152NLin2009cAsym’)
- params.templateflow_home: the path to the templateflow home directory.
will be used to store the templateflow templates or to fetch them if they were already downloaded.
- params.templateflow_res: the resolution of the template (e.g., 1)
- params.templateflow_cohort: the cohort of the template (e.g., 1)

An example of how to set the module’s ext.args can be find in the test/nextflow.config file. Additional configuration for local templates are also available in the test/local.config file.

To select the registration technique used to register the input files, use the
following parameters :
- params.run_easyreg : Use Easyreg any-to-any registration model
- params.run_synthmorph : Use Synthmorph ML registration model

Refer to the registration subworkflow and the modules it uses for configuration options.

Keywords : template, TemplateFlow, registration

Components : registration/antsapplytransforms, registration/tractogram, image/applymask, betcrop/fslbetcrop, utils/templateflow, registration, utils_options


TypeDescriptionMandatoryPattern
ch_anatfileChannel containing the anatomical image to use to compute the registration into template space.

Structure : tuple val(meta), path(anat)
  • meta [map] Metadata map.
  • anat [file] Anatomical image file.
True*.\{nii,nii.gz\}
ch_nifti_filesfileChannel containing the NIfTI files to register into the template space.

Structure : tuple val(meta), path(nifti_files)
  • meta [map] Metadata map.
  • nifti_files [file] List of NIfTI files to register.
False*.\{nii,nii.gz\}
ch_mask_filesfileChannel containing binary mask files to transform in the template space.

Structure : tuple val(meta), path(mask_files)
  • meta [map] Metadata map.
  • mask_files [file] List of binary mask files.
False*.\{nii,nii.gz\}
ch_labels_filesfileChannel containing label files to transform in the template space.

Structure : tuple val(meta), path(label_files)
  • meta [map] Metadata map.
  • label_files [file] List of label files.
False*.\{nii,nii.gz\}
ch_trk_filesfileChannel containing the TRK files to register into the template space.

Structure : tuple val(meta), path(trk_files)
  • meta [map] Metadata map.
  • trk_files [file] List of tractogram files.
False*.trk
ch_freesurfer_licensefileONLY USED WITH SYNTHMORPH REGISTRATION. The input channel containing the Freesurfer license file.

Structure : tuple val(meta), path(license)
  • meta [map] Metadata map.
  • license [file] Freesurfer license file.
False*.txt
optionsmapMap of options for the output_template_space subworkflow.
  • template (string) [Default: None]
    Name of the template to use (see https://templateflow.org).
  • templateflow_home (string) [Default: ./templateflow]
    Path to the templateflow local home directory where files are located and/or downloaded.
  • templateflow_res (integer) [Default: None]
    Template resolution to use or download.
  • templateflow_cohort (string) [Default: None]
    Name/type of the cohort to use.
  • run_easyreg (boolean) [Default: False]
    Use Easyreg any-to-any registration model.
  • run_synthmorph (boolean) [Default: False]
    Use Synthmorph ML registration model.
False

TypeDescriptionMandatoryPattern
ch_t1w_tplfileChannel containing the T1w template.

Structure : tuple path(t1w)
  • t1w [file] T1w template image file.
True*.\{nii,nii.gz\}
ch_t2w_tplfileChannel containing the T2w template.

Structure : tuple path(t2w)
  • t2w [file] T2w template image file.
True*.\{nii,nii.gz\}
ch_registered_anatfileChannel containing the anatomical image registered into the template space.

Structure : tuple val(meta), path(anat)
  • meta [map] Metadata map.
  • anat [file] Registered anatomical image file.
True*.\{nii,nii.gz\}
ch_registered_nifti_filesfileChannel containing the NIfTI files registered into the template space.

Structure : tuple val(meta), path(nifti_files)
  • meta [map] Metadata map.
  • nifti_files [file] List of registered NIfTI files.
False*.\{nii,nii.gz\}
ch_registered_mask_filesfileChannel containing the mask files registered into the template space.

Structure : tuple val(meta), path(mask_files)
  • meta [map] Metadata map.
  • mask_files [file] List of registered mask files.
False*.\{nii,nii.gz\}
ch_registered_labels_filesfileChannel containing the label files registered into the template space.

Structure : tuple val(meta), path(label_files)
  • meta [map] Metadata map.
  • label_files [file] List of registered label files.
False*.\{nii,nii.gz\}
ch_registered_trk_filesfileChannel containing the TRK files registered into the template space.

Structure : tuple val(meta), path(trk_files)
  • meta [map] Metadata map.
  • trk_files [file] List of registered tractogram files.
False*.trk
mqcfileChannel containing the MultiQC report of the registration.

Structure : tuple path(mqc)
  • mqc [file] MultiQC report file.
False*mqc.*
versionsfileFile containing software versions

Structure : tuple path(versions)
  • versions [file] Versions YAML file.
Trueversions.yml


Last updated : 2026-03-17