-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmnimask2diff.sh
26 lines (17 loc) · 1.19 KB
/
mnimask2diff.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
#!/bin/bash
# This script registers a ROI file (in std space) to the native space (diffusion).
# Requirements: DWI file, std_mask (same DWI file name as a prefix) and you ROI (filename ROI)
data_directory=/Users/arturmarquespaulo/Documents/sample_DTI/
for identifier in $(cat /Users/arturmarquespaulo/Documents/sample_DTI/subjectlist.txt);
do
directory=${data_directory}${identifier}
echo Running ${identifier}...;
for sdtMaskFile in /Users/arturmarquespaulo/Documents/sample_DTI/MaskROIs/*.nii.gz
do
maskfile=$(basename ${sdtMaskFile} .nii.gz)
echo Running ${maskfile}...
flirt -ref ${directory}/nodif_brain -in ${sdtMaskFile} -applyxfm -init ${directory}.bedpostX/xfms/standard2diff -out ${directory}.bedpostX/${maskfile}
echo Applywarp ${maskfile} ok, binarizing mask...
fslmaths ${directory}.bedpostX/${maskfile} -thr 0.5 -bin ${directory}.bedpostX/${identifier}_${maskfile}_bin0.5
done
done