-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBatch_Analysis_NARPS_v2_par.m
50 lines (34 loc) · 1.08 KB
/
Batch_Analysis_NARPS_v2_par.m
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
clear all
addpath /data/BnB2/TOOLS/spm12
global defaults,
spm('defaults','FMRI')
defaults.stats.fmri.t = 16;
defaults.stats.fmri.t0 = 1;
cwd = pwd;
workdir = '/data/BnB_TEMP/Data_NARPS/';
datapath = '/data/BnB_TEMP/Data_NARPS/Derivatives/';
Si = dir(fullfile(datapath,'MGT1')); Si = Si([Si.isdir]); Si = Si(3:end);
for i=1:size(Si,1)
subjects{i} = Si(i).name;
end
MODELL = 'NARPS_gain1st_censBadTP';
%MODELL = 'NARPS_loss1st';
labels = {'MGT1', 'MGT2', 'MGT3', 'MGT4'};
results_folder = fullfile(workdir, '/SingleSubjectAnalysis', MODELL);
mkdir(results_folder);
TR = 1.0;
for sub= 1:numel(subjects)
if ~exist(fullfile(results_folder,subjects{sub},'SPM.mat'),'file')
setupSPM(subjects{sub}, workdir, results_folder, labels, cwd, TR);
end
end
% parallelize model estimation
for sub= 1:numel(subjects)
if ~exist(fullfile(results_folder,subjects{sub},'RPV.nii'),'file')
% try
estimateSPM(fullfile(results_folder, subjects{sub}));
% end
end
end
cd(cwd)
%quit;