[FieldTrip] online head position monitoring not working

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Fri Apr 3 09:13:01 CEST 2026


Dear Andreas,

My first thought was that this is very likely my bad. I made some quasi recent changes to this code (mainly for clean up reasons: https://github.com/fieldtrip/fieldtrip/commit/32ca5daa2560fc2748fbb1d809935c44acbe99b7<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip%2Fcommit%2F32ca5daa2560fc2748fbb1d809935c44acbe99b7&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842393479%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=B%2BHn3ISNuv7naONtH92xmGS8fz%2B6wYMtw5fD7%2BRXa88%3D&reserved=0>), and only tested whether those changes broke anything based on the off-line mode of operation.
In our MEG-lab downstairs - where the onine stuff runs just fine - we haven’t updated the FieldTrip code for ages, so we may not have noticed my half-baked work. Great that you already dug into this into so much detail, so I hope it is easy to resolve.

Upon closer inspection of the code changes in the abovementioned commit, the code line that throws the error was already there prior to my tampering with the code. In other words, we need to dig deeper.

Would you mind creating an issue on https://github.com/fieldtrip/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffieldtrip%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842426941%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=zHD%2FVbRuTqlnqlDL8wg2GHrZR3t%2FCD3A8otp%2BNW%2BF7g%3D&reserved=0>, with the message below copied in + your code, and we take it from there.

Have a good easter break, and best wishes to all,

JM



On 2 Apr 2026, at 16:38, Andreas Wollbrink via fieldtrip <fieldtrip at science.ru.nl> wrote:

Dear Fieldtrip community,

while trying to integrate online head-position monitoring into our standard pipeline during MEG recordings with our CTF WC 275 channel system,
I noticed that the ‘ft_realtime_headlocalizer’ function (as in the attached example script aw_trackHeadPosition) applied on Matlab (e.g. applied on our stimulation computer) terminates with the following message:

Error Message:

Unrecognized field name "grad".

Error in ft_realtime_headlocalizer (line 115)
isneuromag = ft_senstype(hdr.grad, 'neuromag');
^^^^^^^^
Error in aw_trackHeadPosition (line 7)
ft_realtime_headlocalizer(cfg);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The problems seems to happen only when I transfer (live) data using the Linux command-line program ‘ctf2ft_v3’ or when I transfer an existing dataset using the 'ft_realtime_fileproxy' function
(see the scripts in the appendix for an example) both from the acquisition computer.

When I play back the head movements from the same dataset using the `ft_realtime_headlocalizer` function (see attached script aw_replayHeadPosition.m) on the same computer as above (e.g. stimulation computer), everything works.
So the `grad` structure is essentially present in the data set (header).

Has anyone else had a similar experience, or perhaps even found a solution?

Please let me know if you need any additional information.

Thanks a lot for the help.

Best, Andreas





--

Andreas Wollbrink, Dipl.-Ing., Biomedical Engineer
________________________________
Lab Manager
IT-Administrator

University Hospital, University of Muenster
Institute for Biomagnetism and Biosignalanalysis

Malmedyweg 15, 48149 Muenster, Germany

office:    +49-251-83-52546
email: a.wollbrink at uni-muenster.de<mailto:a.wollbrink at wwu.de>
web: https://www.medizin.uni-muenster.de/biomag/das-institut/mitarbeiter/andreas-wollbrink.html<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.medizin.uni-muenster.de%2Fbiomag%2Fdas-institut%2Fmitarbeiter%2Fandreas-wollbrink.html&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842448906%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=50kWb0WoSHBDjCgnxabR2QME9KUwmWnMHbzWH7X4TX4%3D&reserved=0>

Wir erfüllen unsere Informationspflichten zum Datenschutz gem. Art. 13-14 DS-GVO durch Veröffentlichung auf unserer Internetseite unter www.datenschutz.ukmuenster.de<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.datenschutz.ukmuenster.de%2F&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842474565%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=q5JXBoNmvY%2F53LOfnxXhDhMED6Hl0RSe3ZegnFtHa%2FQ%3D&reserved=0>


<aw_startRealtimeFileProxy.m><aw_trackHeadPosition.m><ErrorMessage_RealtimeHeadPosTracking.txt><aw_replayHeadPosition.m>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842495094%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=u%2FR6WEePiM2ldVwXPeNUsxm%2FnMDvGYyfj0va29mBGZo%3D&reserved=0>
https://doi.org/10.1371/journal.pcbi.1002202<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd780a3314e8d41ea1ddf08de915070e5%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C639107971842516385%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=FgRsrjcwurGNZS%2BsNvcd14uRwXlgy6TXCAANdWDM%2Fjw%3D&reserved=0>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20260403/87b405ae/attachment.htm>


More information about the fieldtrip mailing list