-
Notifications
You must be signed in to change notification settings - Fork 10
/
sepia_load_addons.m
121 lines (106 loc) · 4.09 KB
/
sepia_load_addons.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
%% sepia_load_addons
%
% Description: a script provides add-on ability in SEPIA
% names
%
% Kwok-shing Chan @ DCCN
% k.chan@donders.ru.nl
% Date created: 27 June 2020
% Date modified: 12 June 2021
% Date modified: 3 August 2022 (v1.1)
%
% DO NOT change the variable name
% DO NOT change the order of the entities, add a new one at the end instead
%
%% find addons in these directories
addons_dir = fullfile(SEPIA_HOME,'addons');
addons_unwrap_dir = fullfile(addons_dir,'phase_unwrap');
addons_echo_combine_dir = fullfile(addons_dir,'echo_combine');
addons_bfr_dir = fullfile(addons_dir,'bfr');
addons_qsm_dir = fullfile(addons_dir,'qsm');
addons_swismwi_dir = fullfile(addons_dir,'swi_smwi');
%% Phase unwrapping addons
listing = dir(addons_unwrap_dir);
for klist = 3:length(listing)
if listing(klist).isdir
curr_dir = fullfile(addons_unwrap_dir,listing(klist).name);
if exist(fullfile(curr_dir,'addon_config.m'),'file')
run(fullfile(curr_dir,'addon_config.m'))
methodUnwrapName{end+1} = addons.method;
wrapper_Unwrap_function{end+1} = addons.wrapper_function;
gui_unwrap_exclusion{end+1} = addons.gui_exclude_voxel;
end
end
end
%% Echo phase combinationaddons
listing = dir(addons_echo_combine_dir);
for klist = 3:length(listing)
if listing(klist).isdir
curr_dir = fullfile(addons_echo_combine_dir,listing(klist).name);
if exist(fullfile(curr_dir,'addon_config.m'),'file')
run(fullfile(curr_dir,'addon_config.m'))
methodEchoCombineName{end+1} = addons.method;
wrapper_EchoCombine_function{end+1} = addons.wrapper_function;
if ~isempty(addons.gui_method_panel)
function_EchoCombine_method_panel{end+1} = addons.gui_method_panel;
end
if ~isempty(addons.config_function)
config_EchoCombine_function{end+1} = addons.config_function;
end
end
end
end
%% BFR addons
listing = dir(addons_bfr_dir);
for klist = 3:length(listing)
if listing(klist).isdir
curr_dir = fullfile(addons_bfr_dir,listing(klist).name);
if exist(fullfile(curr_dir,'addon_config.m'),'file')
run(fullfile(curr_dir,'addon_config.m'))
methodBFRName{end+1} = addons.method;
wrapper_BFR_function{end+1} = addons.wrapper_function;
if ~isempty(addons.gui_method_panel)
function_BFR_method_panel{end+1} = addons.gui_method_panel;
end
if ~isempty(addons.config_function)
config_BFR_function{end+1} = addons.config_function;
end
end
end
end
%% QSM addons
listing = dir(addons_qsm_dir);
for klist = 3:length(listing)
if listing(klist).isdir
curr_dir = fullfile(addons_qsm_dir,listing(klist).name);
if exist(fullfile(curr_dir,'addon_config.m'),'file')
run(fullfile(curr_dir,'addon_config.m'))
methodQSMName{end+1} = addons.method;
wrapper_QSM_function{end+1} = addons.wrapper_function;
if ~isempty(addons.gui_method_panel)
function_QSM_method_panel{end+1} = addons.gui_method_panel;
end
if ~isempty(addons.config_function)
config_QSM_function{end+1} = addons.config_function;
end
end
end
end
%% SWI/SMWI addons
listing = dir(addons_swismwi_dir);
for klist = 3:length(listing)
if listing(klist).isdir
curr_dir = fullfile(addons_swismwi_dir,listing(klist).name);
if exist(fullfile(curr_dir,'addon_config.m'),'file')
run(fullfile(curr_dir,'addon_config.m'))
methodSWISMWIName{end+1} = addons.method;
wrapper_SWISMWI_function{end+1} = addons.wrapper_function;
if ~isempty(addons.gui_method_panel)
function_SWISMWI_method_panel{end+1} = addons.gui_method_panel;
end
if ~isempty(addons.config_function)
config_SWISMWI_function{end+1} = addons.config_function;
end
end
end
end