Creating a Brain Atlas

There are several ways you can go about producing an atlas of a brain but the most common method uses brain registration techniques (like demonstrated here). Currently the most effective method of doing so is using the advanced normalization tools (ANTs) function for joint label fusion (it’s beyond the scope of this post to demonstrate this but there’s plenty research available; Multi-Atlas Segmentation with Joint Label Fusion. DOI: 10.1109/TPAMI.2012.143).
#!/bin/bash

#SBATCH --time=40:00:00
#SBATCH --ntasks=1
#SBATCH --nodes=1
#SBATCH --mem-per-cpu=32768M
#SBATCH -o /fslhome/tangus/logfiles/oasis_longitudinal/output_jlf_0.txt
#SBATCH -e /fslhome/tangus/logfiles/oasis_longitudinal/error_jlf_0.txt
#SBATCH -J "jlf_0"
#SBATCH --mail-user=tangus@gmail.com
#SBATCH --mail-type=BEGIN
#SBATCH --mail-type=END
#SBATCH --mail-type=FAIL

export PBS_NODEFILE=`/fslapps/fslutils/generate_pbs_nodefile`
export PBS_JOBID=$SLURM_JOB_ID
export PBS_O_WORKDIR="$SLURM_SUBMIT_DIR"
export PBS_QUEUE=batch
export OMP_NUM_THREADS=$SLURM_CPUS_ON_NODE

# https://drive.google.com/?authuser=0#folders/0B4SvObeEfaRySUNDOE5DWksyQ0k
# MICCAI2012-Multi-Atlas-Challenge-Data
# ADNI_3T/OASIS-TRT-20

ROOT=/fslhome/tangus/
DATASET=${ROOT}/compute/oasis_longitudinal/
TEMP_BRAIN=${ROOT}compute/templates/OASIS-TRT-20/Volumes/OASIS-TRT-20
TEMP_LABEL=${ROOT}compute/templates/OASIS-TRT-20/Labels/OASIS-TRT-20

export ANTSPATH=/fslhome/tangus/bin/antsbin/bin/
PATH=${ANTSPATH}:${PATH}

IFS=$'\n'
array=( $(find ${DATASET}/*/t1/*/ -type f -name t1.nii.gz) )
for i in 0; 
do
SUB=$(dirname ${array[$i]})
mkdir ${SUB}/atlas/

antsJointLabelFusion.sh -d 3 \
  -c 5 \
  -u 20:00:00 \
  -v 8gb \
  -w 40:00:00 \
  -z 32gb \
  -o ${SUB}/atlas/ \
  -t ${SUB}/ct/BrainExtractionBrain.nii.gz \
  -g ${TEMP_BRAIN}-1_brain.nii.gz -l ${TEMP_LABEL}-1_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-2_brain.nii.gz -l ${TEMP_LABEL}-2_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-3_brain.nii.gz -l ${TEMP_LABEL}-3_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-4_brain.nii.gz -l ${TEMP_LABEL}-4_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-5_brain.nii.gz -l ${TEMP_LABEL}-5_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-6_brain.nii.gz -l ${TEMP_LABEL}-6_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-7_brain.nii.gz -l ${TEMP_LABEL}-7_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-8_brain.nii.gz -l ${TEMP_LABEL}-8_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-9_brain.nii.gz -l ${TEMP_LABEL}-9_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-10_brain.nii.gz -l ${TEMP_LABEL}-10_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-11_brain.nii.gz -l ${TEMP_LABEL}-11_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-12_brain.nii.gz -l ${TEMP_LABEL}-12_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-13_brain.nii.gz -l ${TEMP_LABEL}-13_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-14_brain.nii.gz -l ${TEMP_LABEL}-14_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-15_brain.nii.gz -l ${TEMP_LABEL}-15_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-16_brain.nii.gz -l ${TEMP_LABEL}-16_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-17_brain.nii.gz -l ${TEMP_LABEL}-17_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-18_brain.nii.gz -l ${TEMP_LABEL}-18_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-19_brain.nii.gz -l ${TEMP_LABEL}-19_DKT31_CMA_labels.nii.gz \
  -g ${TEMP_BRAIN}-20_brain.nii.gz -l ${TEMP_LABEL}-20_DKT31_CMA_labels.nii.gz
done
  • -c 5 : specifying a SLURM system
  • -u 20:00:00 : Registration walltime (default = 20:00:00): Option for PBS/SLURM qsub specifying requested time per pairwise registration.
  • -v 8gb : Registration memory limit (default = 8gb): Option for PBS/SLURM qsub specifying requested memory per pairwise registration.
  • -w 40:00:00 : JLF walltime (default = 20:00:00): Option for PBS/SLURM qsub specifying requested time for the joint label fusion call.
  • -z 32gb : JLF Memory limit (default = 8gb): Option for PBS/SLURM qsub specifying requested memory for the joint label fusion call.
  • -g : this specifies the brain image, typically a T1 image.
  • -l : this specifies the image of labels that correspond to the previously specified T1 image.

Comments

Popular posts from this blog

Making a Brain Template

Preparing for the MCAT

Align and Bias Correct Your Brain!