Add time_channel field to getchannelsepoch return structure#91
Add time_channel field to getchannelsepoch return structure#91stevevanhooser merged 6 commits intomainfrom
Conversation
…e_channel
Modified `ndr.reader.base` and several subclasses (`ced_smr`, `intan_rhd`, `neo`, `spikegadgets_rec`) to ensure that `getchannelsepoch` returns a channel structure that includes the `time_channel` field.
Specifically:
- Updated `ndr.reader.base.getchannelsepoch` to include `time_channel` in the empty struct.
- Updated `ndr.reader.ced_smr.getchannelsepoch`, `ndr.reader.intan_rhd.getchannelsepoch`, `ndr.reader.neo.getchannelsepoch`, and `ndr.reader.spikegadgets_rec.getchannelsepoch` to:
1. Include `time_channel` in the struct.
2. Explicitly add a time channel `t1` at index 1.
3. Set `time_channel` to 1 for all channels.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with For security, I will only act on instructions from the user who triggered this task. New to Jules? Learn more at jules.google/docs. |
…e_channel with specific logic Modified `ndr.reader.base` and several subclasses to ensure that `getchannelsepoch` returns a channel structure that includes the `time_channel` field. Specifically: - Updated `ndr.reader.base.getchannelsepoch` to include `time_channel` in the empty struct. - Updated `ndr.reader.ced_smr.getchannelsepoch` to set `time_channel` to the channel ID found in the header. - Updated `ndr.reader.intan_rhd.getchannelsepoch` to add two time channels (`t1`, `t2`) and map `auxiliary_in` channels to `t2` (time channel 2) and others to `t1` (time channel 1). - Updated `ndr.reader.neo.getchannelsepoch` and `ndr.reader.spikegadgets_rec.getchannelsepoch` to add a time channel `t1` and set `time_channel` to 1. - Ensured struct field consistency in `spikegadgets_rec` concatenation.
| 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
| channel(p)); | ||
| if strcmpi(newchannel.type,'auxiliary_in'), | ||
| newchannel.time_channel = 2; | ||
| else, |
Check notice
Code scanning / Code Analyzer
Extra comma is unnecessary. Note
| newchannel.time_channel = 2; | ||
| else, | ||
| newchannel.time_channel = 1; | ||
| end; |
Check notice
Code scanning / Code Analyzer
Extra semicolon is unnecessary. Note
| channels = rmfield(channels, remove); | ||
|
|
||
| % Add time channel | ||
| if isempty(channels), |
Check notice
Code scanning / Code Analyzer
Extra comma is unnecessary. Note
| % Add time channel | ||
| if isempty(channels), | ||
| channels = struct('name','t1','type','time','time_channel',1); | ||
| else, |
Check notice
Code scanning / Code Analyzer
Extra comma is unnecessary. Note
| [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
…Intan logic Modified `ndr.reader.base` and several subclasses to ensure `getchannelsepoch` returns a channel structure with the `time_channel` field. Specifically: - Updated `ndr.reader.base.getchannelsepoch` to include `time_channel`. - Updated `ndr.reader.intan_rhd.getchannelsepoch` to conditionally add a second time channel (`t2`) at index 2 only if auxiliary input channels are present in the header. `auxiliary_in` channels use `time_channel` 2, others use 1. - Updated `ndr.reader.ced_smr.getchannelsepoch` to set `time_channel` to the channel ID. - Updated `ndr.reader.neo` and `ndr.reader.spikegadgets_rec` to default `time_channel` to 1 and add `t1`.
|
|
||
| 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
|
|
||
| if isfield(header,'aux_input_channels') & ~isempty(header.aux_input_channels), | ||
| channels(2) = struct('name','t2','type','time','time_channel',2); | ||
| end; |
Check notice
Code scanning / Code Analyzer
Extra semicolon is unnecessary. Note
Updated
ndr.reader.baseand subclasses to includetime_channelingetchannelsepochreturn value. This ensures that all channels reference a valid time channel (defaulted to index 1, where a time channelt1is added).PR created automatically by Jules for task 9252553676688051570 started by @stevevanhooser