-
Notifications
You must be signed in to change notification settings - Fork 0
/
svca4_PlotClassGui.m
154 lines (118 loc) · 5.92 KB
/
svca4_PlotClassGui.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
function varargout = svca4_PlotClassGui(varargin)
% SVCA4_PLOTCLASSGUI MATLAB code for svca4_plotclassgui.fig
% Last Modified by GUIDE v2.5 07-Dec-2016 13:54:59
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @svca4_PlotGui_OpeningFcn, ...
'gui_OutputFcn', @svca4_PlotGui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Executes just before svca4_plotclassgui is made visible.
function svca4_PlotGui_OpeningFcn(hObject, eventdata, handles, varargin)
global svca4
% Choose default command line output for svca4_plotclassgui
% Update handles structure
guidata(hObject, handles);
% This sets up the initial plot - only do when we are invisible
% so window can get raised using svca4_plotclassgui.
if strcmp(get(hObject,'Visible'),'off')
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classesnn_it00(svca4.GMWM_sel,1,:))),'-b','LineWidth',2); hold on
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classesnn_it00(svca4.GMWM_sel,2,:))),'-g','LineWidth',2)
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classesnn_it00(svca4.BLOOD_sel,3,:))),'-r','LineWidth',2)
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classesnn_it00(svca4.TSPO_sel,4,:))),'-k','LineWidth',2)
legend('Grey','White','Blood','TSPO')
xlabel('Time (sec)')
set(gca,'FontSize',14)
end
% --- Outputs from this function are returned to the command line.
function varargout = svca4_PlotGui_OutputFcn(hObject, eventdata, handles)
global svca4
% Get default command line output from handles structure
varargout{1} = svca4;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global svca4
axes(handles.axes1);
cla;
popup_sel_index = get(handles.plotChoice, 'Value');
switch popup_sel_index
case 1
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classes_it00(svca4.GMWM_sel,1,:))),'-b','LineWidth',4); hold on
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classes_it00(svca4.GMWM_sel,2,:))),'-g','LineWidth',4)
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classes_it00(svca4.BLOOD_sel,3,:))),'-r','LineWidth',4)
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classes_it00(svca4.TSPO_sel,4,:))),'-k','LineWidth',4)
legend('Grey','White','Blood','TSPO')
xlabel('Time (sec)')
set(gca,'FontSize',20,'FontWeight','bold')
case 2
figure;
for s = svca4.BLOOD_sel
subplot(2,4,s)
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(s,3,:)),'-r','LineWidth',2); hold on
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(s,1,:)),'-b','LineWidth',2);
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(s,2,:)),'-g','LineWidth',2);
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(s,4,:)),'-k','LineWidth',2); hold on
%xlim([0 60])
ys(s,:) = get(gca,'ylim');
end
% for s = svca4.TSPO_sel
% subplot(2,4,svca4.TSPO_sel(s))
% plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(s,4,:)),'-k','LineWidth',2); hold on
% end
set(findall(gcf,'type','axes'),'ylim',[min(ys(:,1)) max(ys(:,2))])
set(findall(gcf,'type','axes'),'xlim',[0 svca4.PET_standardEndTimes(end)]) % should remove the hard coding here
set(findall(gcf,'type','axes'),'FontSize',12)
case 3
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(svca4.BLOOD_sel,3,:)),'LineWidth',2); hold on
legend off
case 4
plot(svca4.PET_standardEndTimes,squeeze(svca4.classes_it00(svca4.TSPO_sel,4,:)),'LineWidth',2); hold on
plot(svca4.PET_standardEndTimes,nanmean(squeeze(svca4.classes_it00(svca4.TSPO_sel,4,:))),'--k','LineWidth',2);
legend(cellstr(num2str(svca4.TSPO_sel')),'Average')
case 5
end
% --------------------------------------------------------------------
function FileMenu_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function OpenMenuItem_Callback(hObject, eventdata, handles)
file = uigetfile('*.fig');
if ~isequal(file, 0)
open(file);
end
% --------------------------------------------------------------------
function PrintMenuItem_Callback(hObject, eventdata, handles)
printdlg(handles.figure1)
% --------------------------------------------------------------------
function CloseMenuItem_Callback(hObject, eventdata, handles)
selection = questdlg(['Close ' get(handles.figure1,'Name') '?'],...
['Close ' get(handles.figure1,'Name') '...'],...
'Yes','No','Yes');
if strcmp(selection,'No')
return;
end
delete(handles.figure1)
% --- Executes on selection change in plotChoice.
function plotChoice_Callback(hObject, eventdata, handles)
% --- Executes during object creation, after setting all properties.
function plotChoice_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
set(hObject, 'String', {'Plot average', 'Plot individuals', 'Plot blood for individuals','Plot TSPO'});
% --------------------------------------------------------------------
function Untitled_1_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function Untitled_2_Callback(hObject, eventdata, handles)
% --------------------------------------------------------------------
function Untitled_3_Callback(hObject, eventdata, handles)