Back to the main page.

Bug 2740 - QuikCap 32 10-20 layout

Reported 2014-10-17 03:43:00 +0200
Modified 2019-08-10 12:28:23 +0200
Product: FieldTrip
Component: fileio
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P5 major
Assigned to: Jörn M. Horschig
Depends on:
See also:

Yanina - 2014-10-17 03:43:18 +0200

Created attachment 667 Layout Image Hello! So I have data collected with Neuroscan 32 channels quickcap (1020 standard) and I am trying to create a layout for this type of cap. I have exported .asc file from Neuroscan, modified it according to the instructions from and created a .lay file. Plotted it with dirlist = dir('template/layout/*'); filename = {dirlist(~[dirlist.isdir]).name}' for i=1:length(filename) cfg = []; cfg.layout = filename{i}; layout = ft_prepare_layout(cfg); figure ft_plot_lay(layout); title(filename{i}); end and received a layout with electrodes shifted a bit to the right and with weird huge rectangles around them (both the .lay file and the .png are attached). I am collecting EEG data from a SynAmps RT 128 channels. I am using a QuikCap NSL, which although has 128 electrodes, does not follow standard 10-20 localisation.

Yanina - 2014-10-17 03:43:41 +0200

Created attachment 668 Channel Locations

Yanina - 2014-10-17 03:53:45 +0200

And I am sorry, in the first comment the last two lines are just the citation from a similar bug (but for a different cap) reported by Andre (bug 679).

Robert Oostenveld - 2014-10-17 08:57:00 +0200

Created attachment 669 the updated layout Hi Yanina, Nice that you got so far already. The box size is easy to solve, just change the 4th and 5th column into smaller numbers. I downloaded your txt file, renamed it into quickcap32.lay and did the following multiple times, changing the asci file (with *.lay extension) in a text editor. cfg = []; cfg.layout = 'quickcap32.lay' ft_layoutplot(cfg) With a width of 0.120 and a height of 0.100 it looks quite ok. Then I noticed the following issue: The electrodes are offset to the right, this is due to there being an M1 at the left ear but not an M2 at the right ear. The circle depicting the head is centred at the middle of all electrodes, and with an asymmetric layout towards M1 the electrodes don't align the way you would want. There is an M2, but it is not at the appropriate location. The CZ is at x=0.511, the M1 is at x=0.093, hence I moved M2 from (x=0.032 y=0.032) towards (x=0.929, y=0.579) it is still not symmetric w.r.t. the circle, because 30 0.065 0.031 0.120000 0.100000 HEO 31 0.925 0.028 0.120000 0.100000 VEO are now sticking out most. With Cz at x=0.511, these are not symmetric. So, using >> 0.511-0.065 ans = 0.4460 >> 0.511+ans ans = 0.9570 I determine where VEO should be at the same distance towards CZ. Then onto the next issue: HEO and VEO overlap with the COMNT and SCALE (which are automatically added in the lower left and right corner if not explicitly present. So I add these, to be able to control them precisely given 30 0.065 0.031 0.120000 0.100000 HEO 31 0.925 0.028 0.120000 0.100000 VEO I can add them as 33 0.065 1.000 0.120000 0.100000 COMNT 34 0.925 1.000 0.120000 0.100000 SCALE Then the final issue: the electrodes are upside down. Left right is correct, but Ox is closest to the nose and FPx to the back of the head. I fixed that by adding a "-" in front of the 3rd column with y values. That gives me the following (see attachment). If you plot it with ft_layoutplot, you will see that it is still not perfect. I'll discuss the final refinements in the next comment...

Robert Oostenveld - 2014-10-17 09:07:35 +0200

(In reply to Robert Oostenveld from comment #3) I moved HEO and VEO a bit towards the midline, which makes M1 and M2 closer to the ears. But still not ideal... The issue is that HEO and VEO are considered in the scaling of the circle. So if you move them up, FPx is going to move down. And if you move Mx outwards, all other electrodes will move inwards. So you can only place them relative to the sphere, not absolute. You have more control by representing it in a mat file: >> layout = ft_prepare_layout(cfg) reading layout from file quickcap32.lay the call to "ft_prepare_layout" took 0 seconds and required the additional allocation of an estimated 0 MB layout = pos: [34x2 double] width: [34x1 double] height: [34x1 double] label: {34x1 cell} outline: {[101x2 double] [3x2 double] [10x2 double] [10x2 double]} mask: {[101x2 double]} cfg: [1x1 struct] The outline (head with ears and nose) and mask (same circle as head, to restrict interpolation) are now fixed and will not change any more. So you can move the positions by updating layout.pos as you wish, and finalize by saving it to mat file: save easycap32.mat layout The issue with the automatic scaling also explains why we have moved from the lay files to mat files for quite a few templates. The mat files also allow for more detailled outlines and masks, such as needed for ECoG data as shown on Hope this resolves it, Robert

Yanina - 2014-10-20 18:52:44 +0200

Dear Robert, many thanks! I will go through your logic once again with Matlab and my txt file being open. Your two comments are superhelpful!

Robert Oostenveld - 2019-08-10 12:28:23 +0200

This closes a whole series of bugs that have been resolved (either FIXED/WONTFIX/INVALID) for quite some time. If you disagree, please file a new issue describing the issue on