forked from open-ephys/analysis-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist_open_ephys_binary.m
More file actions
36 lines (32 loc) · 830 Bytes
/
Copy pathlist_open_ephys_binary.m
File metadata and controls
36 lines (32 loc) · 830 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 L=list_open_ephys_binary(jsonFile, type)
%function L=list_open_ephys_binary(oebinFile, type)
%
%Lists the elements present in a Open Ephys binary format recording
% oebinFile: The path for the structure.oebin json file
% type: The type of data to load. Can be 'continuous', 'events' or
% 'spikes'
%
%Returns a cell array with the folder_name field of each entry
%
%Requires minimum MATLAB version: R2016b
json=jsondecode(fileread(jsonFile));
switch type
case 'continuous'
data=json.continuous;
case 'spikes'
data=json.spikes;
case 'events'
data=json.events;
otherwise
error('Data type not supported');
end
len=length(data);
L=cell(len,1);
for i=1:len
if (iscell(data))
L{i}=data{i}.folder_name;
else
L{i}=data(i).folder_name;
end
end
end