Back to the main page.

Bug 1979 - ft_electroderealign should align elecpos not chanpos

Status CLOSED FIXED
Reported 2013-02-07 11:31:00 +0100
Modified 2018-03-10 21:57:16 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Lilla Magyari
URL:
Tags:
Depends on:
Blocks:
See also:

Lilla Magyari - 2013-02-07 11:31:27 +0100

hi Robert, I am looking at the ft_electroderealign function, and indeed it seems it aligns chanpos instead of elecpos. But when a template set of electrodes is used for alignment it makes sens to align chanpos, because the base of the alignment are those electrodes which have the same label in the template and in the to-be-aligned electrode set. And we discussed yesterday that chanpos has label and not elecpos. So, I think the alignment makes sens only if the chanpos and elecpos are the same at those electrodes which are used for alignment. (Or at least there should be minimum one such electrode/channel). So, I could ensure in the script: - the to-be-aligned electrodes and the template have elecpos and chanpos fields - the to-be-aligned electrodes and the template have common labels - it is true at least for one the channels with the common labels that elec.elecpos(x) = elec.chanpos(x) in the to-be-aligned electrodes (or alternatively: all electrodes with common labels should have the same elecpos and chanpos) Is it OK? Lilla


Robert Oostenveld - 2013-02-07 11:49:55 +0100

Let me add Vladimir to this one, since he has looked at the realignment in the past. @Vladimir, this came up in our meeting yesterday, hence Lilla is looking into this. chanpos can in general not be interpreted as the position of the metal disks that are attached to the skin. I most cases however, there will NOT be a complicated re-referencing scheme and chanpos==elecpos, nchan=nelec and tra=eye(nchan,nelec). ft_electroderealign predates the change of the sens structure to explicitly haev chanpos+elecpos. The layout of the whitespace code suggests that there has been a simple search-and-replace to the code, not taking elecpos into account. I suggest to change the code according to 1) determine a Nx3 elecpos and a Nx1 label array. Keep these separate from the elec structure. 2) determine the transformation for that elecpos 3) use ft_transform_sens to apply the transformation on the elec structure.


Robert Oostenveld - 2013-02-07 11:51:29 +0100

Let me also add Arno. @Arno and Vladimir: are EEGLAB and SPM making use of ft_electroderealign and/or of ft_sensorrealign?


Vladimir Litvak - 2013-02-07 11:55:46 +0100

(In reply to comment #2) Not SPM. I have a tool in MEEGtools that uses ft_interactiverealign but it was mainly used for our DBS-MEG stuff. I don't think anyone else uses it. Vladimir


Robert Oostenveld - 2013-02-07 11:57:38 +0100

(In reply to comment #3) I forgot that we also have ft_interactiverealign. So FT has three functions with a similar purpose...


Vladimir Litvak - 2013-02-07 12:01:50 +0100

Unrelated topic: could we discuss the lead field units today? I'm writing here to make sure you'll see it quickly.


Robert Oostenveld - 2013-02-07 12:03:15 +0100

(In reply to comment #5) that worked ;-) See email.


Vladimir Litvak - 2013-02-07 12:17:04 +0100

Didn't get anything.


Lilla Magyari - 2013-03-10 16:20:47 +0100

bash-4.1$ svn ci ft_electroderealign.m -m "bug1979: output of ft_electroderealign did not contain elecpos field. Now, ft_electroderealign deals only with input which has the same electrode (elecpos) and channel (chanpos) positions, and also the output contains the same elecpos and chanpos." Sending ft_electroderealign.m Transmitting file data . Committed revision 7611. And I put also into the reference documentation that the input electrode definition should contain the same elecpos and chanpos fields. Lilla