Skip to content

preproc_t1

Subworkflow for T1 image pre-processing, from denoising to brain extraction and cropping. It requires three input channels, one with a raw T1 image you want to process (ch_image), one with a T1 template (ch_template) and one with a brain probability mask (ch_probability_map). The aim of the workflow is to carry out the first stages of pre-processing, through denoising, N4 correction, resampling and brain extraction, right up to the cropping stage. The resulting T1 is corrected, resampled, brain extracted and cropped.

You can retrieve the file after each step if you don’t want to run the entire subworkflow. The next steps would be to register the resulting T1-corrected image with the DWI-corrected image with, for example, the REGISTRATION subworkflow. IMPORTANT : the subworkflow is only reproducible with when running ANTs BET using a single thread.

----------- Steps -----------

1. Denoising (nlmeans, scil).
Used to remove the noise induced by the MRI acquisition, enhance the signal to noise ratio and improve the image quality and following metrics. The denoising is performed in the original spatial resolution and uses the nlmeans method.


2. N4 Image Intensities Bias Correction (N4BiasFieldCorrection, ANTs).
Used to normalize the image intensities and reduce biases (e.g. signal loss with distance in multi-channel head coils), while preserving contrasts between tissues.


3. Resample (DIPY).
Resamples the T1 to an isotropic spatial resolution. The default is 1mm, a standard in humans which usually facilitate registration with corrected DWI images. This spatial resolution is modifiable in the configuration file.


4. Brain Extraction (ANTs - default, freesurfer).
Isolates the brain tissue voxels from the remaining image. Also creates a binary brain mask. This brain extraction is required for the T1 to DWI Registration. IMPORTANT : when using ANTs, brain extraction is reproducible only when run using a single thread.


5. Cropping (scil).
Crops the empty planes around the brain to optimize the next processing steps.


Subworkflow based on Tractoflow : https://www.sciencedirect.com/science/article/pii/S105381192030375X?via%3Dihub

Keywords : T1, preprocessing, nlmeans, n4, resample, bet, crop

Components : denoising/nlmeans, preproc/n4, image/resample, betcrop/antsbet, betcrop/synthstrip, image/cropvolume, utils_options


TypeDescriptionMandatoryPattern
ch_imagefileThe input channel containing the anatomical image.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Anatomical T1 image file.
True*.\{nii,nii.gz\}
ch_templatefileThe input channel containing the anatomical template for antsBET.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Anatomical template image file.
False*.\{nii,nii.gz\}
ch_probability_mapfileThe input channel containing the brain probability mask for antsBET, with intensity range 1 (definitely brain) to 0 (definitely background).

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Brain probability mask image file.
False*.\{nii,nii.gz\}
ch_template_maskfileBrain mask (in template space) used to restrict metric computation when performing registration.
False*.\{nii,nii.gz\}
ch_initial_affinefileAffine transform from T1w space to DWI space, used as initialization for registration algorithms.
False*.\{mat/txt\}
ch_ref_maskfileThe input channel containing a reference brain mask for all processing. Optional

Structure : tuple val(meta), path(mask)
  • meta [map] Metadata map.
  • mask [file] Reference brain mask file.
False*.\{nii,nii.gz\}
ch_ref_n4fileThe input channel containing the reference and the reference mask for the n4 correction. Optional

Structure : tuple val(meta), path(ref)
  • meta [map] Metadata map.
  • ref [file] Reference image for N4 correction.
False*.\{nii,nii.gz\}
ch_ref_resamplefileThe input channel containing the reference for the resampling. Optional

Structure : tuple val(meta), path(ref)
  • meta [map] Metadata map.
  • ref [file] Reference image for resampling.
False*.\{nii,nii.gz\}
ch_weightsfileThe input channel containing an alternative model weights for synthstrip. Optional

Structure : tuple val(meta), path(weights)
  • meta [map] Metadata map.
  • weights [file] SynthStrip model weights file.
False*.pt
optionsmapMap of options for the preproc_t1 subworkflow.
  • preproc_t1_run_denoising (boolean) [Default: True]
    Denoise the anatomical image using the nlmeans method from scilpy.
  • preproc_t1_run_N4 (boolean) [Default: True]
    Perform N4 bias field correction using ANTs’ N4BiasFieldCorrection.
  • preproc_t1_run_resampling (boolean) [Default: True]
    Resample the anatomical image using the resample method from DIPY.
  • preproc_t1_run_synthstrip (boolean) [Default: True]
    Use SynthStrip for brain extraction.
  • preproc_t1_run_ants_bet (boolean) [Default: False]
    Use ANTs BET for brain extraction.
  • preproc_t1_run_crop (boolean) [Default: True]
    Crop the image after brain extraction.
False

TypeDescriptionMandatoryPattern
image_nlmeansfileChannel containing the anatomical image after the nlmeans denoising.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Denoised T1 image file.
True*.\{nii,nii.gz\}
image_N4fileChannel containing the anatomical image after the N4 correction.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] N4-corrected T1 image file.
True*.\{nii,nii.gz\}
image_resamplefileChannel containing the anatomical image after the resampling.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Resampled T1 image file.
True*.\{nii,nii.gz\}
image_betfileChannel containing the anatomical image after the brain-extraction.

Structure : tuple val(meta), path(t1)
  • meta [map] Metadata map.
  • t1 [file] Brain-extracted T1 image file.
True*.\{nii,nii.gz\}
mask_betfileChannel containing the binary mask after the brain-extraction.

Structure : tuple val(meta), path(mask)
  • meta [map] Metadata map.
  • mask [file] Brain extraction mask file.
True*.\{nii,nii.gz\}
crop_boxfileChannel containing the bouding box defining the limits of the crop.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Bounding box pickle file.
True*.\{pkl\}
mask_finalfileChannel containing the binary mask after the all preprocessing.

Structure : tuple val(meta), path(mask)
  • meta [map] Metadata map.
  • mask [file] Final preprocessed brain mask file.
True*.\{nii,nii.gz\}
t1_finalfileChannel containing the anatomical image after the all preprocessing.

Structure : tuple val(meta), path(image)
  • meta [map] Metadata map.
  • image [file] Final preprocessed T1 image file.
True*.\{nii,nii.gz\}
versionsfileFile containing software versions

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


Last updated : 2026-03-17