Export of EEG electrode locations from EEGLAB to Cartool

547 views
Skip to first unread message

M Plank

unread,
Jan 25, 2011, 3:15:54 AM1/25/11
to car...@googlegroups.com
Dear Cartool community,

I use EEGLAB for EEG data-preprocessing (e.g., ICA-based detection of electromyographic, oculomotoric, or carioballistic artifacts) before exporting the cleaned data to Cartool. However, electrode locations cannot be exported and read in as easily, and you find yourself performing multiple steps from MATLAB to Excel to Word etc. to Cartool.

For those of you who also encounter this problem, the following MATLAB script might be useful:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% MPlank - 2011-01-25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Extract electrode locations from EEG.chanlocs
%<x> <y> <z> <label>

loc = [];
for i = 1:length(EEG.chanlocs)
    loc{i,1} = num2str(EEG.chanlocs(i).X,6);
    loc{i,2} = num2str(EEG.chanlocs(i).Y,6);
    loc{i,3} = num2str(EEG.chanlocs(i).Z,6);
    loc{i,4} = EEG.chanlocs(i).labels;
end;

%save data in EEG_elocs.els;
fid = fopen('EEG_elocs.els','wt');
fprintf(fid,['ES01\n' int2str(size(loc,1)) '\n1\n10-10 System\n' int2str(size(loc,1)) '\n3\n']);
for i = 1 : size(loc,1)
    fprintf(fid,'%s\t %s\t %s\t %s\t\n',loc{i,:});
end;
fclose(fid);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Best regards,
Markus

Denis

unread,
Jan 25, 2011, 7:09:19 AM1/25/11
to car...@googlegroups.com
Thanks Markus!
We can copy this to the Files section, under the Matlab area,
Denis

Markus Plank

unread,
Jan 25, 2011, 1:52:52 PM1/25/11
to car...@googlegroups.com
Thanks, Denis! You guys do great work with Cartool - My colleagues and I appreciate your effort!

M

Jasna Martinovic

unread,
Dec 10, 2012, 9:30:13 AM12/10/12
to car...@googlegroups.com
I am just making a file for my 128 + 4 channels.


The file for exporting the channel structure has the top row which says:
fprintf(fid,['ES01\n' int2str(size(loc,1)) '\n1\n10-10 System\n' int2str(size(loc,1)) '\n3\n']);

I wonder if I should modify this - what should I put for the modified 10-20 system that's used in the 128 electrode system? Should I put 10-20 or GRID or something else? Also, I do not want to use my extra 4 channels in the analysis, so should I have a header that splits it into 2 sections, one of which is titled AUX or somesuch?

I was thinking of a file structured like this, but thought I'd pass it by the experts on the list first as I wouldn't like to make a mistake:
ES01
132
2
GRID
128
3
0
[then i put all the xyzs of the head channels)
AUX
4
0
[then i put the 4 eye channels)

I did search the help files but did not manage to find a sufficiently detailed explanation for electrode file headers in one place.

I look forward to hearing from you.

thanks in advance,
jasna


Dr Jasna Martinovic

School of Psychology

University of Aberdeen

William Guild Building

Aberdeen

AB24 3FX

 tel: 01224 272240

email: j.martinovic @ abdn.ac.uk

web: http://www.abdn.ac.uk/~psy527/dept/

Fengji Geng

unread,
Dec 10, 2012, 9:52:53 AM12/10/12
to car...@googlegroups.com
Hello Jasna,

I used 128 channels EGI net with the CZ added later in my pre-processing. If I understand you rightly, you might want a location file for a 128-channel net. So, I attached the one I am using in the attachment. Hope it helps!  

--
This is a message sent from the Cartool Community group cartoolcommunity.unige.ch
 
To unsubscribe from this group, send an email to cartool+u...@googlegroups.com
 
Please note: unsuscribing from the group also unsuscribes you from the Cartool registration and download of Cartool.. if you just want to set how you receive messages, go to: groups.google.com/group/cartool/subscribe



--
Fengji 

EEG_elocs.els
Reply all
Reply to author
Forward
0 new messages