-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtvm_installOpenFmriAnalysisToolbox.m
More file actions
102 lines (85 loc) · 2.91 KB
/
tvm_installOpenFmriAnalysisToolbox.m
File metadata and controls
102 lines (85 loc) · 2.91 KB
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
function tvm_installOpenFmriAnalysisToolbox(configuration)
% TVM_INSTALLOPENFMRIANALYSISTOOLBOX
% TVM_INSTALLOPENFMRIANALYSISTOOLBOX(configuration)
%
%
% Copyright (C) Tim van Mourik, 2015, DCCN
%
%%
rootDirectory = mfilename('fullpath');
rootDirectory = fileparts(rootDirectory);
%% Parse configuration
if nargin == 0
configuration = [];
end
display = tvm_getOption(configuration, 'Display', true);
% true
core = tvm_getOption(configuration, 'Core', true);
% true
interface = tvm_getOption(configuration, 'Interface', true);
% true
development = tvm_getOption(configuration, 'Development', false);
% true
%%
addpath(rootDirectory);
if core
addpath(fullfile(rootDirectory, 'Core'));
addpath(fullfile(rootDirectory, 'Core/BoundaryRegistration'));
addpath(fullfile(rootDirectory, 'Core/Curvature'));
addpath(fullfile(rootDirectory, 'External'));
addpath(fullfile(rootDirectory, 'External/NifTI'));
end
if interface
addpath(fullfile(rootDirectory, 'Interface'));
addpath(fullfile(rootDirectory, 'Interface/Activation'));
addpath(fullfile(rootDirectory, 'Interface/DesignMatrix'));
addpath(fullfile(rootDirectory, 'Interface/LaminarAnalysis'));
addpath(fullfile(rootDirectory, 'Interface/Preprocessing'));
addpath(fullfile(rootDirectory, 'Interface/Publishing'));
addpath(fullfile(rootDirectory, 'Interface/Registration'));
addpath(fullfile(rootDirectory, 'Interface/Utilities'));
end
if development
addpath(fullfile(rootDirectory, 'Development'));
end
if display
if core
tvm_workInProgress();
fprintf('You''re very welcome to use the Laminar Analysis toolbox, \nbut please be aware this version is in continuous development\n');
end
end
log = '/home/mrphys/timvmou/ToolboxUserLog.txt';
if exist(log, 'file')
try %#ok<TRYNC>
f = fopen(log, 'a');
fprintf(f, '%s\t%s\n', getenv('USER'), datestr(now()));
fclose(f);
clear('f');
end
end
clear('log');
end %end function
%This function is defined in the toolbox, but as this function is there to
%load the toolbox, we don't know about this function yet
function optionValue = tvm_getOption(configuration, optionName, default)
%TVM_GETOPTION Finds an option in a parameter
% VALUE = GETOPTION(OPTIONS,'NAME', DEFAULT)
% This is an adaptation of the MATLAB getoptim() function. If the option
% NAME is given in the cell array OPTIONS, the VALUE is the assigned
% value. Otherwise, the default value is returned.
%
% Copyright (C) 2012-2016, Tim van Mourik, DCCN
if nargin == 2
if isfield(configuration, optionName)
optionValue = configuration.(optionName);
return
else
error('TVM:getOption:MandatoryOption', [optionName ' is a mandatory option']);
end
end
if isfield(configuration, optionName)
optionValue = configuration.(optionName);
else
optionValue = default;
end
end %end function