-
Notifications
You must be signed in to change notification settings - Fork 1
/
dcm-generate-bms-analysis.sh~
executable file
·82 lines (71 loc) · 2.24 KB
/
dcm-generate-bms-analysis.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
## ---------------------------------------------------------------- ##
## DCM-GENERATE-BMS-ANALYSIS.SH
## ---------------------------------------------------------------- ##
## Extract DCMs for the Autism task
## ---------------------------------------------------------------- ##
## History
## ---------------------------------------------------------------- ##
##
## 2015-09-27 : Added documentation and help string
##
## 2013-05-16 : File Created
## ---------------------------------------------------------------- ##
NL="
" # new line
HELP_MSG="dcm-generate-bms-analysis
--------------------------------------
This program creates a matlab script
to perform a Bayesian Model Selection
analysis.
Usage
--------------------------------------
$ dcm-generate-bms-analysis.sh
<models-file> <DCM dir>
<subj1> <sub2> ... <subN>
where:
<models-file> is a text file listing
the names of the DCM models
to compare (including the trailing
.mat).
<DCM dir> is the name of the folder
where the BMS file will be
placed.
<subX> is the [list of] of subject
folders.
Notes
--------------------------------------
* The script must be run from the root
folder, where all the subjects
folders are located
* Each subject folder must have a 'DCM'
directory where the model is located
* At least two arguments need to be
provided (model and at least one
subject)
"
if [ $# -lt 3 ]; then
echo "$HELP_MSG"
exit
fi
models=$1 # Model file name
shift;
dir=`pwd`/$1 # DCM folder name
shift
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.dir = {'${dir}'};"
j=0
for s in $@; do
j=$((j+1))
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.sess_dcm{${j}}.mod_dcm = {"
while read model; do
model_path=`pwd`/$s/DCM/${model}
echo "'${model_path}'"
done < $models
echo "};"
done
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.model_sp = {''};"
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.load_f = {''};"
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.method = 'FFX';"
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.family_level.family_file = {''};"
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.bma.bma_no = 0;"
echo "matlabbatch{1}.spm.stats.bms.bms_dcm.verify_id = 0;"