-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplotWavesurferDatav3.m
More file actions
65 lines (54 loc) · 2.11 KB
/
plotWavesurferDatav3.m
File metadata and controls
65 lines (54 loc) · 2.11 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
function [] = plotWavesurferDatav2()
%This function creates the list selection GUI. If the list is not the
%correct size, edit the 'position' parameter'. The value is in pixels so it
%changes depending on screen resolution.
d = dir('*.h5');
str = {d.name};
S.fh = figure('units','pixels',...
'position',[100 100 300 800],...
'menubar','none',...
'name','Wavesurfer Plot Tool',...
'numbertitle','off',...
'resize','off');
S.ls = uicontrol('style','list',...
'unit','pix',...
'position',[10 60 275 720],...
'min',0,'max',1,...
'fontsize',8,...
'string',str);
S.pb = uicontrol('style','push',...
'units','pix',...
'position',[10 10 180 40],...
'fontsize',10,...
'string','Graph Data');
set(S.pb, 'callback', {@pb_call, S});
end
function [] = pb_call(varargin)
S = varargin{3}; % Get the structure.
%This adds a "running" button while the graph calculates, useful for
%knowing when long plots are still processing
col = get(S.pb,'backg'); % Get the background color of the figure.
set(S.pb,'str','RUNNING...','backg',[1 .6 .6]) % Change color of button.
pause(.01) % FLUSH the event queue, drawnow would work too.
%This gets the selection from the list (the filename) and loads the data into a
%struct
L = get(S.ls,{'string','value'});
if isempty(L{1})
display('No files found')
else
filename = L{1}{L{2}};
ws_data_struct = ws.loadDataFile(filename);
%Determines if recording is continuous or sweep based and calls requisite
%functions for plotting
if ws_data_struct.header.AreSweepsContinuous == 1
display 'This is a continuous recording'
figure
plot_continuous_recording(ws_data_struct)
else
display 'This is a sweep based recording'
plot_sweep_recording_brush_prototype(ws_data_struct)
end
end
set(S.pb,'str','Graph Data','backg',col)
clear
end