You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xensor .elc files can include head shape, and this sometimes breaks the function. Or maybe all the times, I'm not sure.
I dug around, in the process I've found mentions of readasalocs, but apparently it was discontinued at some point.
The offending line is labels = locs(indlabels+1:end,:);
this reads the entirety of the file til the end. If the labels are the last line - you're lucky. Otherwise - not so much.
labels = locs(indlabels+1,:);
This reads only the labels.
There was also a for-if loop, and I replaced this out of principle.
locs = loadtxt( filename );
% get label names
% ---------------
indlabels=find(strcmpi(locs(:,1), 'Labels'));
indpos=find(strcmpi(locs(:,1), 'Positions'));
if isempty(indpos) || isempty(indlabels)
error('Could not find ''Labels'' or ''Position'' tag in electrode file');
end
labels = locs(indlabels+1,:);
% get positions
% -------------
if strcmp(locs(indpos+1,2),':')
positions = locs(indpos+1:indlabels-1,3:5);
else
positions = locs(indpos+1:indlabels-1,1:3);
end
The text was updated successfully, but these errors were encountered:
xensor .elc files can include head shape, and this sometimes breaks the function. Or maybe all the times, I'm not sure.
I dug around, in the process I've found mentions of readasalocs, but apparently it was discontinued at some point.
The offending line is
labels = locs(indlabels+1:end,:);
this reads the entirety of the file til the end. If the labels are the last line - you're lucky. Otherwise - not so much.
labels = locs(indlabels+1,:);
This reads only the labels.
There was also a for-if loop, and I replaced this out of principle.
The text was updated successfully, but these errors were encountered: