Registration - GerardMJuan/BrainFortLib-neuroimage-hub GitHub Wiki

ADNI registration instructions

This file describes how to do a proper registration from a normally downloaded dataset from the ADNI website to a properly registered dataset.

A good overview of registration using ANTS is located in https://github.com/ANTsX/ANTs/wiki.

Getting Started

In this file we will describe the procedure to register a database of brain MRI image to a given template.

Prerequisites

  • Having the set of images in a directory, in .nii format.
  • Have a .csv file of the database, detailing the directory of each image.
  • Python and any further dependencies.
  • scheduler.py script in the directory or path.
  • Template brain image.

Instructions

New instructions (Really need to expand on this)

    1. Preprocess images.
    1. Register each baseline to a template.
    1. Use the inverse transformation to register the template mask to each of the baselines.
    1. Apply dilated mask to remove cranium.
    1. Repeat the same for each follow-up, in order to also remove the mask at follow-up space.

OLD INSTRUCTIONS

  1. Preprocess all the images, using the file process_image_fromfile.py

This script does normalization, denonising, histogram matching, normalization with respect to a template, and puts the images in another directory, which conserves the structure of the input directory.

Example of execution:

python -u /homedtic/gmarti/CODE/img-mri-processing/MRI_processing/process_images.py --in_dir /homedtic/gmarti/DATA/Data/ADNI/ --in_metadata /homedtic/gmarti/DATA/ADNImetadata/ADNI/ADNI_Standard_Baselines.csv --img_suffix .nii --n4 --denoising --histmatch --template_file /homedtic/gmarti/DATA/MNI152/icbm_avg_152_t1_tal_nlin_symmetric_VI.nii --template_norm --out_dir /homedtic/gmarti/DATA/Data/ADNI_SD_B/ --num_threads 50

  1. (If working with longitudinal data) Register follow-ups to baseline. Preferred is to do an Affine 1-4 transformation. Use register_to_baseline.py.

Example of execution:

register_to_baseline.py --in_dir /homedtic/gmarti/DATA/Data/followups_processed/ --img_suffix .nii --template_dir /homedtic/gmarti/DATA/Data/baseline_processed/ --transform Affine 1 --out_warp_intfix aff1 --out_dir /homedtic/gmarti/DATA/Data/followups_baseline_reg/ --output_warped_image

  1. Register both the followups and the baseline to the template

Using a given template.

python3 -u /homedtic/gmarti/CODE/img-mri-processing/MRI_processing/register_to_template.py --in_dir /homedtic/gmarti/DATA/Data/ADNI_SD_B/ --in_metadata /homedtic/gmarti/DATA/ADNImetadata/ADNI/ADNI_Standard_Baselines.csv --img_suffix .nii --template_file /homedtic/gmarti/DATA/MNI152/icbm_avg_152_t1_tal_nlin_symmetric_VI.nii --transform Affine 1 --out_warp_intfix affine1 --out_dir /homedtic/gmarti/DATA/Data/ADNI_Affine1_SdBaseline/ --output_warped_image --clean --num_threads 80

  1. Mask the image to remove the bones

Given an input directory and an output directory, remove the bones by just masking the image. It is not a proper bone-removal algorithm. Use createmask.py

Example of execution:

python3 /homedtic/gmarti/CODE/img-mri-processing/MRI_processing/createmask.py --template_mask /homedtic/gmarti/DATA/Data/icbm_avg_152_t1_tal_nlin_symmetric_VI_mask.nii --in_dir /homedtic/gmarti/DATA/Data/ADNI_Affine1_SdBaseline/ --out_dir /homedtic/gmarti/DATA/Data/ADNI_Affine1_SdBaseline_masked/ --img_suffix Warped.nii.gz --dilate --size 3

Author