megplanar for magnetometers

Stephan Moratti moratti at MED.UCM.ES
Tue May 19 14:28:37 CEST 2009

Hi all,

I would like to transform my magnetometer maps to a planargradiometer
representation (with BESA I can do that, but it would be nice to have it
in fieldtrip). I guess, simply using megplanar and combineplanar as it
is, would be incorrect, as this functions assume axial gradiameters. So,
I tried to change some code of megplanar (lines 281-287, method 'orig')
simply assuming that X2 Y2 and Z2 are equal to X,Y,Z in the case of

% get the positions of bottom and top coil
  X  = grad.pnt(:, 1);
  Y  = grad.pnt(:, 2);
  Z  = grad.pnt(:, 3);
  X2 = grad.pnt(:, 1);% + grad.ori(:,1);
  Y2 = grad.pnt(:, 2);% + grad.ori(:,2);
  Z2 = grad.pnt(:, 3);% + grad.ori(:,3);

Well, probably this is quite naive. Attached please find my results
(testplanar.tiff). testmagneto.tiff contains the original magnetic flux
map (magentometers). Can anybody figure out if this makes sense?

Thanks for any comments and help,


*Stephan Moratti, PhD/
/**/see also:
/*Centro de Tecnología Biomédica CBT,
Universidad Politécnica de Madrid,

en la actualidad (currently at) en el
Centro de Magnetoencefalografía Dr. Perez Modrego,
Universidad Complutense de Madrid,
Faculdad de Medicina,
Pabellón 8,
Avda. Complutense, s/n,
28040 Madrid,

email: moratti at <mailto:moratti at>
moratti at <mailto:moratti at>
Tel.:    +34 91 394 2292
Fax.:   +34 91 394 2294

The aim of this list is to facilitate the discussion between users of the FieldTrip  toolbox, to share experiences and to discuss new ideas for MEG and EEG analysis. See also and
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testplanar.tif
Type: image/tiff
Size: 197102 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testmagneto.tif
Type: image/tiff
Size: 193370 bytes
Desc: not available
URL: <>

More information about the fieldtrip mailing list