-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathrun_1stLevel_Analysis_Gambles.sh
50 lines (42 loc) · 1.68 KB
/
run_1stLevel_Analysis_Gambles.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
43
44
45
46
47
48
49
50
#!/bin/bash
# Generate the subject list to make modifying this script
# to run just a subset of subjects easier.
for id in `seq -w 1 16` ; do
subj="sub-$id"
echo "===> Starting processing of $subj"
echo
cd $subj
# If the brain mask doesn’t exist, create it
if [ ! -f anat/${subj}_T1w_brain.nii.gz ]; then
echo "Skull-stripped brain not found, creating it..."
# Note: This fractional intensity appears to work well for most of the subjects in the
# Flanker dataset. You may want to change it if you modify this script for your own study.
bet2 anat/${subj}_T1w.nii.gz \
anat/${subj}_T1w_brain.nii.gz
fi
# Copy the design files into the subject directory, and then
# change “sub-01” to the current subject number
cp ../design_run1.fsf .
cp ../design_run2.fsf .
cp ../design_run3.fsf .
# Note that we are using the | character to delimit the patterns
# instead of the usual / character because there are / characters
# in the pattern.
sed -i '' "s|sub-01|${subj}|g" \
design_run1.fsf
sed -i '' "s|sub-01|${subj}|g" \
design_run2.fsf
sed -i '' "s|sub-01|${subj}|g" \
design_run3.fsf
# Now everything is set up to run feat
echo "===> Starting feat for run 1"
feat design_run1.fsf
echo "===> Starting feat for run 2"
feat design_run2.fsf
echo "===> Starting feat for run 3"
feat design_run3.fsf
echo
# Go back to the directory containing all of the subjects, and repeat the loop
cd ..
done
echo