forked from BUNPC/AtlasViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuipanelBrainDisplay.m
More file actions
91 lines (86 loc) · 2.47 KB
/
uipanelBrainDisplay.m
File metadata and controls
91 lines (86 loc) · 2.47 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
function uipanelBrainDisplay(hObject, eventdata, handles)
if(iscell(eventdata))
pialsurf = eventdata{1};
labelssurf = eventdata{2};
else
global atlasViewer;
pialsurf = atlasViewer.pialsurf;
labelssurf = atlasViewer.labelssurf;
end
if ~isempty(pialsurf)
hPialSurf = pialsurf.handles.surf;
hObject1 = pialsurf.handles.radiobuttonShowPial;
val1 = get(hObject1,'value');
enable1 = get(hObject1,'enable');
else
hPialSurf = [];
hObject1 = [];
val1 = -1;
enable1 = '';
end
if ~isempty(labelssurf)
hLabelsSurf = labelssurf.handles.surf;
hObject2 = labelssurf.handles.radiobuttonShowLabels;
val2 = get(hObject2,'value');
enable2 = get(hObject2,'enable');
else
hLabelsSurf = [];
hObject2 = [];
val2 = -1;
enable2 = '';
end
if hObject == hObject1
if val1==1
set(hObject2,'value',0);
if strcmp(enable1,'on')
set(hPialSurf,'visible','on');
end
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','off');
end
elseif val1==0 && val2==1
% This should never happen (means we're displaying labels and pial
% simultaneously which is the wrong thing to do) but for completeness
% we add this case.
if strcmp(enable1,'on')
set(hPialSurf,'visible','off');
end
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','on');
end
elseif val1==0 && val2==0
if strcmp(enable1,'on')
set(hPialSurf,'visible','off');
end
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','off');
end
end
elseif hObject == hObject2
if val2==1
set(hObject1,'value',0);
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','on');
end
if strcmp(enable1,'on')
set(hPialSurf,'visible','off');
end
elseif val1==0 && val2==1
% This should never happen (means we're displaying labels and pial
% simultaneously which is the wrong thing to do) but for completeness
% we add this case.
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','off');
end
if strcmp(enable1,'on')
set(hPialSurf,'visible','on');
end
elseif val2==0 && val1==0
if strcmp(enable2,'on')
set(hLabelsSurf,'visible','off');
end
if strcmp(enable1,'on')
set(hPialSurf,'visible','off');
end
end
end