Skip to content

Commit

Permalink
Update loadOpenEphysSettingsFile.m
Browse files Browse the repository at this point in the history
  • Loading branch information
petersenpeter committed Sep 18, 2024
1 parent 93c78ca commit b996c4e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion calc_CellMetrics/loadOpenEphysSettingsFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@
% Electrode groups and channel mapping
channelmapping = [];
for i = 1:session.extracellular.nChannels
if isfield(openEphys_metadata.continuous(1).channels{i},'channel_metadata')
if isstruct(openEphys_metadata.continuous.channels)
if isfield(openEphys_metadata.continuous.channels(i),'channel_metadata')
channelmapping(i) = openEphys_metadata.continuous(1).channels(i).channel_metadata.value+1;
end
elseif isfield(openEphys_metadata.continuous(1).channels{i},'channel_metadata')
channelmapping(i) = openEphys_metadata.continuous(1).channels{i}.channel_metadata.value+1;
end
end
Expand Down

0 comments on commit b996c4e

Please sign in to comment.