-
Notifications
You must be signed in to change notification settings - Fork 0
/
LiveView.m
44 lines (44 loc) · 1.24 KB
/
LiveView.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
% aViewer=LiveView(aViewer) : updates a live viewer.
%
function aViewer=LiveView(aViewer,aRecon)
if isempty(aViewer) || (isnumeric(aViewer) && aViewer > 1)
dipshow(3,aRecon);drawnow();
else
if aViewer == 0
aViewer = view5d(aRecon);
elseif aViewer == 1
if isa(aRecon,'cuda')
toShow = ConditionalCudaConvert(aRecon,0);
else
toShow = aRecon;
end
aViewer = dipshow(toShow);
aViewer.UserData.curslice =floor(size(toShow,3)/2);
drawnow();
else
if isa(aViewer,'matlab.ui.Figure')
if isa(aRecon,'cuda')
toShow = ConditionalCudaConvert(aRecon,0);
else
toShow = aRecon;
end
try
aViewer = dipshow(aViewer,toShow);
catch
aViewer = dipshow(toShow);
aViewer.UserData.curslice =floor(size(toShow,3)/2);
end
drawnow();
else
try
% aViewer.toFront();
view5d(aRecon,0,'replaceElement',aViewer,0);
aViewer.ProcessKeyMainWindow('t');
aViewer.UpdatePanels()
catch
dipshow(3,aRecon);
drawnow();
end
end
end
end