Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readeetraklocs chokes on head shape #757

Open
Allexxann opened this issue Apr 15, 2024 · 2 comments
Open

readeetraklocs chokes on head shape #757

Allexxann opened this issue Apr 15, 2024 · 2 comments

Comments

@Allexxann
Copy link

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
@arnodelorme
Copy link
Collaborator

Do you have an .elc file we could use for testing?

@Allexxann
Copy link
Author

ELC.zip
Directly from xensor without any tampering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants