forked from netstim/leaddbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathea_addnormmethods.m
49 lines (37 loc) · 1.18 KB
/
ea_addnormmethods.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
function ea_addnormmethods(handles,options,handlestring)
if ~exist('handlestring','var')
handlestring='normmethod';
end
% add normalization methods to menu
cnt=1;
earoot=ea_getearoot;
ndir=dir([earoot,'ea_normalize_*.m']);
for nd=length(ndir):-1:1
[~,methodf]=fileparts(ndir(nd).name);
[thisndc,compat]=eval([methodf,'(','''prompt''',')']);
if compat
ndc{cnt}=thisndc;
normmethod{cnt}=methodf;
try % default function could be something nonexistent
if strcmp(ndc{cnt},eval([options.prefs.normalize.default,'(','''prompt''',')']))
defentry=cnt;
end
end
cnt=cnt+1;
end
end
try
setappdata(handles.leadfigure,'normmethod',normmethod);
set(handles.(handlestring),'String',ndc);
catch
if isempty(which('spm'))
warning('It seems that SPM is not installed.');
end
end
try % set selection of normmethod to default entry (specified in ea_prefs).
if defentry<=length(get(handles.(handlestring),'String'))
set(handles.(handlestring),'Value',defentry);
end
end
clear defentry
ea_switchnormmethod(handles,handlestring);