Skip to content

Detailed Pipeline

Paul Wright edited this page Jun 21, 2021 · 8 revisions

The processing steps and their order are described below. Some steps are always performed. Optional steps are marked in bold.

  1. Set-up steps
    1. Create output directory.
    2. Copy images (to avoid overwriting originals).
    3. If images are compressed (.nii.gz) then uncompress them.
    4. Collapse labels
      • Combine labels as specified in opt.labels.part, described here.
      • Can be used to select a subset of labels (e.g. if the input label image has voxels 1 = umbra and 2 = penumbra, you may wish to use only label 1 for cost function masking in the segmentation step).
      • Can be used to group combinations of labels.
  2. Erode
    • Remove a few of the outer voxels.
  3. Reset origin
    • Important for CT.
    • Also resize voxels if opt.do.vx is set.
  4. Realign to MNI space
  5. Reorient
    • Reslice so that image data is in world space.
  6. Crop
    • Crop the images to remove unneccesary data.
  7. Coregister
    • Set one of the images as reference and coregister the others to it.
  8. Denoise
    • Denoise the images.
    • Only done if not using super-resolution.
    • Always followed by another coregistration step.
  9. The below steps are for creating images of equal size, either by MTV super-resolution2, or by just simply reslicing.
    1. EITHER super-resolve images
      • Always followed by another coregistration step.
    2. OR reslice
      • Make images the same dimensions by reslicing, using a selected image as reference.
      • Also resize voxels if opt.do.vx is set.
    3. OR resize voxels
      • If neither resetting origin nor applying bounding box
    4. OR do nothing.
  10. SPM BB
    • Crop to SPM12 bounding box.
    • Use custom dimensions if specified.
    • Also resize voxels if opt.do.vx is set.
  11. If paths specifies label images, reslice these.
  12. Segment
    • Run SPM12 unified segmentation.
    • Combines multi-channel data. All images must be in the same space.
    • Can output deformation fields for precise non-linear warp to MNI space.
    • Can use cost function masking, e.g. to exclude tumour voxels from the estimation of the warp to MNI space.
  13. BF corr
    • Apply bias field correction (requires segmentation).
  14. Skull strip
    • Strip the skull (requires segmentation).
  15. Register to template
    • If a template is specified, reslice and affinely register images to the template.
  16. Write normalised
    1. Non-linearly warp images and labels to MNI space (requires segmentation).
  17. Intensity normalisation
    • Normalise image intensities using the range in opt.int_norm.rng.
  18. Write 2D version
  19. Output steps
    1. Assign created filenames to output variable.
    2. Save images in native space
    3. If original images were compressed (.nii.gz) then compress the output.
    4. Write MAT
      • Save the orientation matrix as a MATLAB .mat file.
Clone this wiki locally