Skip to content

agdamsbo/normalisation-pipeline

Repository files navigation

DOI

Data processing for brain and lesion normalisation

This pipeline was comprised as part of my exchange stay at the Brain Behavior Lab at UBC, Vancouver, Canada. It is my hope that the notes and script may be of help to others, myself being a new learner to FSL and everything around it.

The reason for creating this tool is to use 1mm MNI normalised lesion masks for the NeMo tool.

Most of the hard working scripts in this pipeline are based on the work by Dr. Dianne Patterson, PhD. I have tried my best at modifying the original scripts as little as possible for clarity, and instead created a few new scripts to work as wrappers.

The pipeline provides a set of handy tools listed below, which I will also go through:

  • R-script to organise files into subject-folders

  • Shell pipeline to process all subject folders to extract brain mask, and normalise lesion mask to 1 mm MNI space (this is the primary content)

  • Shell-script to normalise lesion mask after manual correction of brain mask (no, even using optiBET is not perfect)

  • R-script to package lesion masks to supply to the NeMo tool.

Requirements

You need to have fsl as well as R and RStudio (or similar) installed. I also highly recommend the package ITK-SNAP, which can be used for some (semi-)manual mask modifications.

Files required for each subject

The scripts needs a T1 weighted scan and lesion mask in Nifti format. Naming should be as follows.

  • subjID_T1w.nii.gz
  • subjID_LesionMask.nii.gz

Instructions

Step-by-step documentation and notes are provided here.

Source and acknowledgements

Scripts for normalization: link

NeMo tool upload: link

Notes on changes from the originals

fsl_anat_alt_bbl.sh: It took me some time to figure out, I have to say. During the script, the working directory is changed. This makes referencing the optiBET_bbl.sh script a little tricky. I ended up going back a step with "cd -" and forward again after running optiBET_bbl.sh.

Licensing

If nothing else is explicitly stated en the relevant files, everything in the repository is licensed under the AGPL-v3.