-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiffeomorphicRegistration.sh
42 lines (38 loc) · 1.64 KB
/
diffeomorphicRegistration.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
usage(){
echo "This script is intended to call the ANTs registration procedure in order to perform diffeomorphic SyN registration on DTI scalar maps."
echo "(basename $0) <Main folder> <Quick registration [Y/N]> <Structural Registration [Y/N]>"
echo ""
echo "Main folder = The location where is found the input files for ANTs registration."
echo "Quick registration = Choose if use the fast ANTs registration script. Default = N"
echo "Structural Registration = Do registration on structural images. Default = N"
}
if [[ $# -lt 3 ]]; then
usage
exit
fi
MAIN_FOLDER=$1
USE_QUICK=$2
STRUCTURAL_REGISTRATION=$3
if [[ -d "$MAIN_FOLDER" ]]; then
#Performing registration
if [[ $USE_QUICK == "Y" && $STRUCTURAL_REGISTRATION == "N" ]]; then
cd ${MAIN_FOLDER}
~/MSLesionTrack-Data/antsRegistrationSyNQuick.sh -d 3 -f patient-FA.nii.gz -m DTI-Template-FA.nii.gz -o regTemplate
elif [[ $USE_QUICK == "N" && $STRUCTURAL_REGISTRATION == "N" ]]; then
cd ${MAIN_FOLDER}
~/MSLesionTrack-Data/antsRegistrationSyN.sh -d 3 -f patient-FA.nii.gz -m DTI-Template-FA.nii.gz -o regTemplate
elif [[ $USE_QUICK == "Y" && $STRUCTURAL_REGISTRATION == "Y" ]]; then
cd ${MAIN_FOLDER}
~/MSLesionTrack-Data/antsRegistrationSyNQuick.sh -d 3 -f patient-FLAIR.nii.gz -m MNI-Template-T1.nii.gz -o regStruct
elif [[ $USE_QUICK == "N" && $STRUCTURAL_REGISTRATION == "Y" ]]; then
cd ${MAIN_FOLDER}
~/MSLesionTrack-Data/antsRegistrationSyN.sh -d 3 -f patient-FLAIR.nii.gz -m MNI-Template-T1.nii.gz -o regStruct
else
echo "Quick registration is Y or N."
exit
fi
else
echo "The input directory does not exist!"
exit
fi