forked from netstim/leaddbs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathea_addrecentpatient.m
More file actions
36 lines (29 loc) · 849 Bytes
/
ea_addrecentpatient.m
File metadata and controls
36 lines (29 loc) · 849 Bytes
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
function ea_addrecentpatient(handles,uipatdir,patsub,chosenix)
earoot=ea_getearoot;
load([earoot,'common',filesep,'ea_recent',patsub,'.mat']);
if strcmp(fullrpts,['No recent ',patsub,' found'])
fullrpts={};
end
if ~exist('chosenix','var')
try
chosenix=fullrpts{get(handles.recentpts,'Value')};
catch
chosenix=['Recent ',patsub,':'];
end
end
try
fullrpts=[uipatdir';fullrpts];
catch % calls from lead_group could end up transposed
try
fullrpts=[uipatdir;fullrpts];
catch
fullrpts=[uipatdir;fullrpts'];
end
end
[fullrpts]=unique(fullrpts,'stable');
if length(fullrpts)>10
fullrpts=fullrpts(1:10);
end
[~,nuchosenix]=ismember(chosenix,fullrpts);
save([earoot,'common',filesep,'ea_recent',patsub,'.mat'],'fullrpts');
ea_updaterecentpatients(handles,patsub,nuchosenix);