Back to the main page.

Bug 2385 - create 3D easycap elec-files

Reported 2013-11-22 07:51:00 +0100
Modified 2014-03-12 12:20:02 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 enhancement
Assigned to: Jörn M. Horschig
Depends on:
See also:

Jörn M. Horschig - 2013-11-22 07:51:29 +0100

Based on a mail from Max Cantor, I realized that we can easily provide 3D elec-files: This link on the easycap website ( explains the coordinate system. Conversion to radians has to be done (this is what Max reported): X = COS(RADIANS(Phi))*SIN(RADIANS(Theta)) Y = SIN(RADIANS(Theta))*SIN(RADIANS(Phi)) Z = =COS(RADIANS(Theta))

Jörn M. Horschig - 2013-11-22 07:53:54 +0100

after browsing the easycap page for a bit (see time between this post and the former) - we can also just use the xyz coordinates provided by easycap:

Jörn M. Horschig - 2013-11-22 07:55:11 +0100

(this page for M10: conversion necessary here)

Robert Oostenveld - 2013-11-22 09:17:35 +0100

FieldTrip can already read these: mac001> grep case fileio/ft_read_sens.m case 'asa_elc' case 'polhemus_pos' case 'besa_elp' case 'besa_pos' case 'besa_sfp' case {'ctf_ds', 'ctf_res4', 'ctf_old', 'neuromag_fif', 'neuromag_mne', '4d', '4d_pdf', '4d_m4d', '4d_xyz', 'yokogawa_ave', 'yokogawa_con', 'yokogawa_raw', 'itab_raw' 'itab_mhd', 'netmeg'} case 'eeg' case 'meg' case 'neuromag_mne_grad' case 'neuromag_mne_elec' case {'neuromag_mne' 'babysquid_fif'} case {'spmeeg_mat', 'eeglab_set'} case 'polhemus_fil' case 'matlab' case 'zebris_sfp' case '4d_el_ascii' case 'localite_pos' I would not mind adding more import formats to the reading function. Furthermore, we already provide these template electrode sets: GSN-HydroCel-128.sfp GSN-HydroCel-129.sfp GSN-HydroCel-256.sfp GSN-HydroCel-257.sfp GSN-HydroCel-32.sfp GSN-HydroCel-64_1.0.sfp GSN-HydroCel-65_1.0.sfp README standard_1005.elc standard_1020.elc standard_alphabetic.elc standard_postfixed.elc standard_prefixed.elc standard_primed.elc which have their documentation at But why would we want to copy files that are so easily accessible from easycap into the fieldtrip release?

Robert Oostenveld - 2013-11-22 09:50:25 +0100

mac001> svn commit test/test_bug2385.m fileio/ Sending fileio/ft_filetype.m Sending fileio/ft_read_sens.m Adding test/test_bug2385.m Transmitting file data ... Committed revision 8833. mac001> svn commit test/test_bug2385.m fileio/ Sending fileio/ft_read_sens.m Sending test/test_bug2385.m Transmitting file data .. Committed revision 8834. @Jorn, could you review the code changes and tell me whether this serves your purpose?

Jörn M. Horschig - 2013-11-22 10:00:49 +0100

yes, looks very good, thanks ;) So the idea is to not ship elec-files with FieldTrip that can easily be retrieved otherwise? I would be in favour of including them anyways (e.g. if the company goes bankrupt and the website goes offline, it will not be easy to download the electrode positions anymore). On the other hand, I can see that this would set user expectations higher and higher and put some more maintenance work on our shoulders...

Robert Oostenveld - 2013-11-22 10:17:07 +0100

(In reply to comment #5) It is mainly the added responsibility that comes on our shoulders that I see as a potential problem. I am wary of "processing" or "polishing" external files and then adding them to FT, as that involves decisions that need to be motivated/justified/documented and then people keep us responsible for all aspects of the file (including the historical versions). I think that if we add the three files as they are and clearly document where we got them from, it is OK to add them to our release. The whole point of the template section (like on the wiki is to make it easier to provide provenance to the "data files" that we release. so in this case I actually don't see any issues to release them (copy and paste the EGI story).

Jörn M. Horschig - 2013-11-27 10:56:48 +0100

svn ci easycap-M1* -m "enhancement #2385 - added easycap electrode positions" Adding easycap-M1.sfp Adding easycap-M10.sfp Transmitting file data .. Committed revision 8866. and added description to wiki

Jim Herring - 2014-01-14 09:46:51 +0100

ft_read_sens breaks when reading both easycap templates. Because of the extension it expects the templates to have a besa_sfp format (4 columns: label, x, y, z) while the templates contain 3 columns (label, theta?, phi?).

Robert Oostenveld - 2014-01-14 10:19:51 +0100

(In reply to Jim Herring from comment #8) Are the file actually correct SFP files? SFP is a file format defined by BESA and not invented by us. See

Jörn M. Horschig - 2014-01-14 10:25:39 +0100

Hi Jim, nope, I actually renamed the file-extension (and obviously did not test with the new extension). Apparently not a smart move. They were .txt files originally

Jörn M. Horschig - 2014-01-14 10:26:04 +0100

and hi Robert :)

Jim Herring - 2014-01-14 10:41:08 +0100

Hi Joern and Robert, ft_fileformat and ft_read_sens can handle EasyCap text files downloaded from their website just fine (at least now, maybe not when you added the templates). However, the first line has to start with 'Site', which is not the case in the .sfp files but is the case in the .txt files downloaded from the EasyCap website.

Jörn M. Horschig - 2014-01-22 10:05:13 +0100

svn ci -m "changed easycap templates to .txt for proper recognition" Deleting electrode/easycap-M1.sfp Adding electrode/easycap-M1.txt Deleting electrode/easycap-M10.sfp Adding electrode/easycap-M10.txt Transmitting file data .. Committed revision 9121.