sdcflows.workflows.fit.syn module

Estimating the susceptibility distortions without fieldmaps.

sdcflows.workflows.fit.syn.init_syn_preprocessing_wf(*, debug=False, name='syn_preprocessing_wf', omp_nthreads=1, auto_bold_nss=False, t1w_inversion=False)[source]

Prepare EPI references and co-registration to anatomical for SyN.

Workflow Graph
../_images/sdcflows-workflows-fit-syn-1.png

(Source code, png, svg, pdf)

Parameters:
  • debug (bool) – Whether a fast (less accurate) configuration of the workflow should be applied.

  • name (str) – Name for this workflow

  • omp_nthreads (int) – Parallelize internal tasks across the number of CPUs given by this option.

  • auto_bold_nss (bool) – Set up the reference workflow to automatically execute nonsteady states detection of BOLD images.

  • t1w_inversion (bool) – Run T1w intensity inversion so that it looks more like a T2 contrast.

Inputs:
  • in_epis (list of str) – Distorted EPI images that will be merged together to create the EPI reference file.

  • t_masks (list of bool) – (optional) mask of timepoints for calculating an EPI reference. Not used if auto_bold_nss=True.

  • in_meta (list of dict) – Metadata dictionaries corresponding to the in_epis input.

  • in_anat (str) – A preprocessed anatomical (T1w or T2w) image.

  • mask_anat (str) – A brainmask corresponding to the anatomical (T1w or T2w) image.

  • std2anat_xfm (str) – inverse registration transform of T1w image to MNI template.

Outputs:
  • epi_ref (tuple (str, dict)) – A tuple, where the first element is the path of the distorted EPI reference map (e.g., an average of b=0 volumes), and the second element is a dictionary of associated metadata.

  • anat_ref (str) – Path to the anatomical, skull-stripped reference in EPI space.

  • anat_mask (str) – Path to the brain mask corresponding to anat_ref in EPI space.

  • sd_prior (str) – A template map of areas with strong susceptibility distortions (SD) to regularize the cost function of SyN.

sdcflows.workflows.fit.syn.init_syn_sdc_wf(*, atlas_threshold=3, sloppy=False, debug=False, name='syn_sdc_wf', omp_nthreads=1)[source]

Build the fieldmap-less susceptibility-distortion estimation workflow.

SyN deformation is restricted to the phase-encoding (PE) direction. If no PE direction is specified, anterior-posterior PE is assumed.

SyN deformation is also restricted to regions that are expected to have a >3mm (approximately 1 voxel) warp, based on the fieldmap atlas.

Workflow Graph
../_images/sdcflows-workflows-fit-syn-2.png

(Source code, png, svg, pdf)

Parameters:
  • atlas_threshold (float) – Exclude from the registration metric computation areas with average distortions below this threshold (in mm).

  • sloppy (bool) – Whether a fast (less accurate) configuration of the workflow should be applied.

  • debug (bool) – Run in debug mode

  • name (str) – Name for this workflow

  • omp_nthreads (int) – Parallelize internal tasks across the number of CPUs given by this option.

Inputs:
  • epi_ref (tuple (str, dict)) – A tuple, where the first element is the path of the distorted EPI reference map (e.g., an average of b=0 volumes), and the second element is a dictionary of associated metadata.

  • epi_mask (str) – A path to a brain mask corresponding to epi_ref.

  • anat_ref (str) – A preprocessed, skull-stripped anatomical (T1w or T2w) image resampled in EPI space.

  • anat_mask (str) – Path to the brain mask corresponding to anat_ref in EPI space.

  • sd_prior (str) – A template map of areas with strong susceptibility distortions (SD) to regularize the cost function of SyN

Outputs:
  • fmap (str) – The path of the estimated fieldmap.

  • fmap_ref (str) – The path of an unwarped conversion of files in epi_ref.

  • fmap_coeff (str or list of str) – The path(s) of the B-Spline coefficients supporting the fieldmap.

  • out_warp (str) – The path of the corresponding displacements field transform to unwarp susceptibility distortions.

  • method (str) – Short description of the estimation method that was run.

sdcflows.workflows.fit.syn.match_histogram(reference, image, ref_mask=None, img_mask=None)[source]

Match the histogram of the T2-like anatomical with the EPI.