forked from JoramSoch/MACS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbatch_MA_cvLME_man.m
85 lines (69 loc) · 2.85 KB
/
batch_MA_cvLME_man.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
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
83
84
85
function module = batch_MA_cvLME_man
% _
% Configure MATLAB Batch for "MA: calculate cvLME (manually)"
%
% Author: Joram Soch, BCCN Berlin
% E-Mail: joram.soch@bccn-berlin.de
%
% First edit: 16/03/2017, 21:55 (V0.99/V15)
% Last edit: 09/03/2018, 10:25 (V1.2/V18)
%=========================================================================%
% F I E L D S %
%=========================================================================%
% Select SPM.mat
%-------------------------------------------------------------------------%
SPM_mat = cfg_files;
SPM_mat.tag = 'SPM_mat';
SPM_mat.name = 'Select SPM.mat';
SPM_mat.help = {'Select the SPM.mat file of a specified and/or estimated GLM.'};
SPM_mat.filter = 'mat';
SPM_mat.ufilter = '^SPM\.mat$';
SPM_mat.num = [1 1];
% Accuracy & Complexity
%-------------------------------------------------------------------------%
AnC = cfg_menu;
AnC.tag = 'AnC';
AnC.name = 'Accuracy & Complexity';
AnC.help = {'Choose whether model accuracy and model complexity are calculated in addition to the log model evidence.'};
AnC.labels = {'No', 'Yes'};
AnC.values = {0, 1};
AnC.val = {0};
%=========================================================================%
% M O D U L E %
%=========================================================================%
% MA: cvLME (man)
%-------------------------------------------------------------------------%
module = cfg_exbranch;
module.tag = 'MA_cvLME_man';
module.name = 'MA: calculate cvLME (manually)';
module.val = {SPM_mat AnC};
module.help = {'Cross-Validated Log Model Evidence for General Linear Model'
'Type "help MA_cvLME_multi" or "help MA_cvLME_single" for help.'};
module.prog = @run_module;
module.vout = @vout_module;
%=========================================================================%
% F U N C T I O N S %
%=========================================================================%
% Run batch
%-------------------------------------------------------------------------%
function out = run_module(job)
% get input variables
load(job.SPM_mat{1});
AnC = logical(job.AnC);
% add working directory
if ~isfield(SPM,'swd')
SPM.swd = fileparts(job.SPM_mat{1});
end;
% execute operation
MA_cvLME_multi(SPM,[],[],AnC);
% set output files
load(job.SPM_mat{1});
out.cvLME_nii = cellstr(strcat(SPM.swd,'/',SPM.MACS.cvLME.fname));
% Dependencies
%-------------------------------------------------------------------------%
function dep = vout_module(job)
% define dependencies
dep(1) = cfg_dep;
dep(1).sname = 'cvLME map (voxel-wise image)';
dep(1).src_output = substruct('.','cvLME_nii');
dep(1).tgt_spec = cfg_findspec({{'filter','image','strtype','e'}});