-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCA_Mem_Motion_Outliers.sh
53 lines (37 loc) · 2.25 KB
/
MCA_Mem_Motion_Outliers.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
51
52
53
#!/bin/bash
## Run from MCA study "Data" folder, after MRIcroGL dicom to .nii.gz conversion, Fieldmap correction and Brain Extraction; req's file = datain.txt (contains param's)
#fsl_motion_outliers : runs motion calculations; Does Motion Correction (or not, usually with --nomoco for using MCFLIRT before/after via GUI; if using framewise displacement as the metric, have motion correction ON), finds Outliers, and creates Confound Matrix for GLM in First Level Preprocessing
#Reference: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSLMotionOutliers
#############################################################################
# for individual runs, use the following:
# Subj=76
# Ses=2
# Task=2
for Subj in {70..71}
do
for Ses in {1..2}
do
for Task in {1..2}
do
#################### Should not need to edit below this line ################
echo "\n Running Subject ${Subj} Session ${Ses}"
date
echo Starting Motion Calcs...
DATADIR=$PWD
# DATALABEL=MCA${Subj}_Ses${Ses}_Mem${Task}
# check for any data with scrubbed volumes
if [ -f "${DATADIR}/MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_corrected_scrubbed.nii.gz" ]; then
INPUT=${DATADIR}/MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_corrected_scrubbed.nii.gz
else
INPUT=${DATADIR}/MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_corrected.nii.gz
fi
##################### MEMORY DATA ####################
echo "Memory Data MCA${Subj}_Ses${Ses}_Mem${Task} being processed..."
fsl_motion_outliers -i ${INPUT} -o ./MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_mp-confoundsMtx.txt -s ./MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_fdrms.txt -p ./MCA${Subj}_Ses${Ses}/Mem${Task}_func/${DATALABEL}_fdrms_plot.png --fdrms --thresh=1.5 --dummy=0 -v
wait
echo "Subj MCA${Subj} MEM Done"
done
done
done
echo All Done!
date