Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions +ndr/+reader/base.m
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,10 @@
% 'name' | The name of the channel (e.g., 'ai1')
% 'type' | The type of data stored in the channel
% | (e.g., 'analogin', 'digitalin', 'image', 'timestamp')
% 'time_channel' | The index of the time channel that describes the time of this channel
%
%
%
channels = struct('name',[],'type',[]);
channels = channels([]);
channels = vlt.data.emptystruct('name','type','time_channel');
end; % getchannelsepoch()

function [datatype,p,datasize] = underlying_datatype(ndr_reader_obj, epochstreams, epoch_select, channeltype, channel)
Expand Down
5 changes: 3 additions & 2 deletions +ndr/+reader/ced_smr.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
if epochselect~=1,
error(['For CED SOM/SMR files, epochselect should be 1.']);
end;
channels = vlt.data.emptystruct('name','type');
channels = vlt.data.emptystruct('name','type','time_channel');

% open SMR files, and examine the headers for all channels present
% for any new channel that hasn't been identified before,
Expand All @@ -52,13 +52,14 @@
header = ndr.format.ced.read_SOMSMR_header(filename);

if isempty(header.channelinfo),
channels = struct('name','t1','type','time');
channels = struct('name','t1','type','time','time_channel',1);
end;

for k=1:length(header.channelinfo),
%header.channelinfo(k).kind
newchannel.type = ndr.reader.ced_smr.cedsmrheader2readerchanneltype(header.channelinfo(k).kind);
newchannel.name = [ ndr.reader.base.mfdaq_prefix(newchannel.type) int2str(header.channelinfo(k).number) ];
newchannel.time_channel = header.channelinfo(k).number;
channels(end+1) = newchannel;
end
end % getchannels()
Expand Down
15 changes: 13 additions & 2 deletions +ndr/+reader/intan_rhd.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@
% | (e.g., 'analogin', 'digitalin', 'image', 'timestamp')
%

channels = vlt.data.emptystruct('name','type');

intan_channel_types = {
'amplifier_channels'
'aux_input_channels'
Expand All @@ -192,6 +190,14 @@

filename = intan_rhd_obj.filenamefromepochfiles(epochstreams);
header = ndr.format.intan.read_Intan_RHD2000_header(filename);

channels = vlt.data.emptystruct('name','type','time_channel');

channels(1) = struct('name','t1','type','time','time_channel',1);

if isfield(header,'aux_input_channels') & ~isempty(header.aux_input_channels),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
channels(2) = struct('name','t2','type','time','time_channel',2);
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.

for k=1:length(intan_channel_types)
if isfield(header,intan_channel_types{k}),
Expand All @@ -205,6 +211,11 @@
intan_rhd_obj,...
channel_type_entry,...
channel(p));
if strcmpi(newchannel.type,'auxiliary_in'),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
newchannel.time_channel = 2;
else,

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
newchannel.time_channel = 1;
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
channels(end+1) = newchannel;
end
end
Expand Down
6 changes: 5 additions & 1 deletion +ndr/+reader/neo.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
py_channels = py.neo_python.getchannelsepoch(epochfiles, epochselect);

% Formatting objects from python to matlab
channels = vlt.data.emptystruct('name', 'type');
channels = vlt.data.emptystruct('name', 'type', 'time_channel');

channels(1) = struct('name','t1','type','time','time_channel',1);

for k = 1:length(py_channels)
new_channel.type = char(py_channels{k}{'type'});
new_channel.name = char(py_channels{k}{'name'});
new_channel.time_channel = 1;
channels(end + 1) = new_channel;
end
end
Expand Down
9 changes: 9 additions & 0 deletions +ndr/+reader/spikegadgets_rec.m
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@

remove = {'startbyte','bit','number'};
channels = rmfield(channels, remove);

% Add time channel
if isempty(channels),

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
channels = struct('name','t1','type','time','time_channel',1);
else,

Check notice

Code scanning / Code Analyzer

Extra comma is unnecessary. Note

Extra comma is unnecessary.
[channels.time_channel] = deal(1);
time_channel = struct('name','t1','type','time','time_channel',1);
channels = [time_channel; channels(:)];
end;

Check notice

Code scanning / Code Analyzer

Extra semicolon is unnecessary. Note

Extra semicolon is unnecessary.
end


Expand Down
2 changes: 1 addition & 1 deletion .github/badges/code_issues.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.