-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathspm_cfg.m
131 lines (121 loc) · 5.86 KB
/
spm_cfg.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
function spmjobs = spm_cfg
% SPM Configuration file for MATLABBATCH
%__________________________________________________________________________
% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
% $Id: spm_cfg.m 6315 2015-01-23 17:09:06Z guillaume $
%--------------------------------------------------------------------------
% Temporal
%--------------------------------------------------------------------------
temporal = cfg_choice;
temporal.tag = 'temporal';
temporal.name = 'Temporal';
temporal.help = {'Temporal pre-processing functions.'};
temporal.values = { spm_cfg_st };
%--------------------------------------------------------------------------
% Spatial
%--------------------------------------------------------------------------
spatial = cfg_choice;
spatial.tag = 'spatial';
spatial.name = 'Spatial';
spatial.help = {'Various spatial and other pre-processing functions.'};
spatial.values = { spm_cfg_autoreorient spm_cfg_realign spm_cfg_realignunwarp spm_cfg_coreg spm_cfg_preproc8 spm_cfg_norm spm_cfg_smooth };
%--------------------------------------------------------------------------
% Stats
%--------------------------------------------------------------------------
stats = cfg_choice;
stats.tag = 'stats';
stats.name = 'Stats';
stats.help = {'Various analysis utilities.'};
stats.values = { spm_cfg_fmri_spec spm_cfg_fmri_design spm_cfg_fmri_data spm_cfg_factorial_design spm_cfg_model_review spm_cfg_fmri_est spm_cfg_con spm_cfg_results spm_cfg_mfx spm_cfg_bms_map spm_cfg_ppi spm_cfg_setlevel };
%--------------------------------------------------------------------------
% Dynamic Causal Modelling
%--------------------------------------------------------------------------
dcm = cfg_choice;
dcm.tag = 'dcm';
dcm.name = 'DCM';
dcm.help = {'Dynamic Causal Modelling.'};
dcm.values = { spm_cfg_dcm_fmri spm_cfg_dcm_meeg spm_cfg_dcm_bms};
%--------------------------------------------------------------------------
% Util
%--------------------------------------------------------------------------
spm_cfg_import = cfg_choice;
spm_cfg_import.tag = 'import';
spm_cfg_import.name = 'Import';
spm_cfg_import.help = {'Import.'};
spm_cfg_import.values = { spm_cfg_dicom spm_cfg_minc spm_cfg_ecat spm_cfg_parrec};
util = cfg_choice;
util.tag = 'util';
util.name = 'Util';
util.help = {'Various useful tools.'};
util.values = { spm_cfg_disp spm_cfg_checkreg spm_cfg_render spm_cfg_import spm_cfg_imcalc spm_cfg_reorient spm_cfg_voi spm_cfg_cdir spm_cfg_md spm_cfg_bbox spm_cfg_deface spm_cfg_deformations spm_cfg_tissue_volumes spm_cfg_print spm_cfg_cat spm_cfg_split spm_cfg_exp_frames spm_cfg_sendmail };
%--------------------------------------------------------------------------
% Tools
%--------------------------------------------------------------------------
tools = cfg_choice;
tools.tag = 'tools';
tools.name = 'Tools';
tools.help = {'Other tools', ...
['Toolbox configuration files should be placed in the ' ...
'toolbox directory, with their own *_cfg_*.m files. ' ...
'If you write a toolbox, then you can include it in ' ...
'this directory - but remember to try to keep the ' ...
'function names unique (to reduce clashes with other ' ...
'toolboxes).'], ...
['See spm_cfg.m or MATLABBATCH documentation ' ...
'for information about the form of SPM''s configuration ' ...
'files.']};
tools.values = {};
if isdeployed
%-In compiled mode, cfg_master will take care of toolbox detection
% See spm_make_standalone.m
tools.values = spm_cfg_static_tools;
else
%-Toolbox directories autodetection
tbxdir = spm_get_defaults('tbx.dir');
for i=1:numel(tbxdir)
[unused,d] = spm_select('FPList',tbxdir{i});
if isempty(d), d = {}; else d = cellstr(d); end
ft = {}; dt = {};
%-Look for '*_cfg_*.m' files in these directories
for j=1:numel(d)
f = cellstr(spm_select('List',d{j},'^[^(._)].*_cfg_.*\.m$'));
if ~isempty(f{1})
ft = [ft f{:}];
dt = [dt repmat(d(j),1,numel(f))];
end
end
%-Path to the toolbox MUST be added to matlabpath in the
% configuration or 'prog' file of said toolbox with, e.g.:
% >> if ~isdeployed
% >> addpath(fileparts(mfilename('fullpath')));
% >> end
cwd = pwd;
for j=1:numel(ft)
try
cd(dt{j});
tools.values{end+1} = feval(strtok(ft{j},'.'));
catch
disp(['Loading of toolbox ' fullfile(dt{j},ft{j}) ' failed.']);
end
end
cd(cwd);
end
end
%==========================================================================
% spmjobs SPM
%==========================================================================
spmjobs = cfg_choice;
spmjobs.tag = 'spm';
spmjobs.name = 'SPM';
spmjobs.help = {
'%* Statistical Parametric Mapping'
''
'Statistical Parametric Mapping refers to the construction and assessment of spatially extended statistical processes used to test hypotheses about functional imaging data. These ideas have been instantiated in software that is called SPM.'
''
'The SPM software package has been designed for the analysis of brain imaging data sequences. The sequences can be a series of images from different cohorts, or time-series from the same subject.'
''
'The current release is designed for the analysis of fMRI, PET, SPECT, EEG and MEG.'
''
}';
spmjobs.values = { temporal spatial stats dcm spm_cfg_eeg util tools };
spmjobs.rewrite_job = @spm_rewrite_job;