[FieldTrip] positions of Neuromag sensors rotated

Joachim.Lange at med.uni-duesseldorf.de Joachim.Lange at med.uni-duesseldorf.de
Fri Feb 28 09:41:56 CET 2020


Dear JM ;)
Thanks for your reply and the suggestions. I had done the plotting you suggested and it's the MEG sensors of the problematic subject that are off. I also had a second look at the landmarks (and the other polhemus recordings in the "headshape" variable) but couldn't find anything suspicious.
Best,
Jo


> Date: Thu, 27 Feb 2020 08:58:27 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] positions of Neuromag sensors rotated
> Message-ID: <65A8AC04-6811-404A-B470-96893F76D805 at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear Jo,
> 
> Have you plotted the 2 headshapes in a single figure, and likewise for the
> gradiometers? In other words, which of the 4 objects is off in terms of
> expected location in space?
> Have you checked for the problematic subject, whether the order of the
> landmark-clicking in the polhemus procedure was consistent with how the
> coordinate system is defined?
> 
> Best wishes,
> JM
> 
> On 19 Feb 2020, at 15:15, joachim.lange at med.uni-
> duesseldorf.de<mailto:joachim.lange at med.uni-duesseldorf.de> wrote:
> 
> Dear Fieldtrippers,
> I’m not sure whether my problem is a Fieldtrip or a Neuromag problem, but
> maybe someone can help me here.
> 
> I’ve recorded MEG data with a Neuromag system and the headshape and hpi
> coils using the polhemus system. When I read the headshape and the sensor
> locations from the fif-file and plot them using Fieldtrip, the plots look as
> expected, i.e., the “headshape” and the hpi coils are located within the MEG
> sensors / helmet (see attached example figures S1_1 and S1_2 from
> different angles). For one subject, however, the sensors from the hdr.grad-
> file seem rotated and it even looks like the “headshape” is partly outside the
> MEG sensors / helmet (see attached figures S2_1 and S2_2).
> I have no idea what is going wrong here and/or how I could correct the
> apparently wrong positions. Any help would be much appreciated.
> Thanks,
> Jo
> 
> Ps: the simple FT-code:
> 
> hdr = ft_read_header(‘subject.fif’);
> headshape = ft_read_headshape(‘subject.fif’);
> figure;
> ft_plot_sens(hdr.grad, 'style', 'b.', 'coil', 'false');
> ft_plot_mesh(headshape.pos(1:4,:),'vertexsize',20,'vertexcolor','r'); %HPI
> coils
> ft_plot_mesh(headshape.pos(5:end,:),'vertexsize',20,'vertexcolor','k');
> %”manual” headshape
> <S1_1.tif><S1_2.tif><S2_1.tif><S2_2.tif>___________________________
> ____________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200227/e4
> 8fc5ac/attachment-0001.htm>
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 27 Feb 2020 09:25:17 +0000
> From: "Schoffelen, J.M. (Jan Mathijs)" <jan.schoffelen at donders.ru.nl>
> To: FieldTrip discussion list <fieldtrip at science.ru.nl>
> Subject: Re: [FieldTrip] Possible bug in mtmconvol padding option
> Message-ID: <6E10027C-7D87-49CB-A159-72C16BBB1D4B at donders.ru.nl>
> Content-Type: text/plain; charset="utf-8"
> 
> Hi Mireia,
> 
> There was a typo in my pseudo-code, the value to be used for cfg.pad would
> of course be 1.
> Best,
> JM
> 
> 
> On 27 Feb 2020, at 09:29, Schoffelen, J.M. (Jan Mathijs)
> <jan.schoffelen at donders.ru.nl<mailto:jan.schoffelen at donders.ru.nl>>
> wrote:
> 
> Hi Mireia,
> 
> Indeed the cfg.pad parameter operates on the full epoch length, not on the
> sliding window length. This is per design, and it is not a bug.
> 
> Although I don’t fully understand the deeper reason of why you want to do
> what you want to do, one way to get there would be to handcraft your own
> procedure, and create the TFRs in a computationally inefficient for-loop. This
> would require a lot of data bookkeeping on your end.
> 
> Procedurally:
> 
> for k = 1:the-number-of-time-point-onto-which-you-want-to-estimate-your-
> tfr
> 
>   cfg = [];
>   cfg.latency = timepoint(k)+[-0.25 0.25-1./data.fsample];
>   tmpdata = ft_selectdata(cfg, data);
> 
>   cfg = [];
>   cfg.pad = 0.5;
>   cfg.method = ‘mtmfft’;
>   cfg….
>   tmpfreq(k) = ft_freqanalysis(cfg, tmpdata);
> 
> end
> 
> freq = tmpfreq(1);
> freq.powspctrm = cat( 3-or-4-depending-on-whether-you-did-
> cfg.keeptrials=‘yes’-previously, tmpfreq.powspctrm);
> freq.time = timepoint;
> freq.dimord = (‘rpt_)chan_freq_time’;
> 
> 
> Sounds like an overkill to me, though.
> 
> Best wishes, and good luck,
> 
> Jan-Mathijs
> 
> PS: Please feel free to suggest an update to the help-section of the
> ft_freqanalysis function, to explain better the cfg.pad parameter. We look
> forward to a PR!
> 
> 
> 
> On 24 Feb 2020, at 18:17, TORRALBA CUELLO, MIREIA
> <mireia.torralba at upf.edu<mailto:mireia.torralba at upf.edu>> wrote:
> 
> Hi,
> I am a Fieldtrip user and I came across this error
> 
> ft_error('the specified padding is too short');
> 
> when calculating power spectrum using this code:
> 
>  cfg=[];
>     cfg.method='mtmconvol';
>     cfg.foi=2:1:40;
>     cfg.t_ftimwin=0.5*ones(length(cfg.foi),1);
>     cfg.pad=1;
> cfg.taper='hanning';
> fLast=ft_freqanalysis(cfg,dataLast);
> 
> As I see it, the padding should work in each of my time windows (0.5 seconds
> length each) and therefore the error should not appear, but when I
> inspected which is the segment padded by the function I saw
> that what is being padded to 1 is the whole segment. I think this is not right,
> as what I would like is to increase my frequency resolution by padding each
> of the timewindows where I calculate the spectrum. The problem I have is
> that I want to use as a baseline another segment which has 0.5 seconds
> length, and as the frequency extracted by mtmconvol depends on the length
> of the segment, I am getting different frequency resolutions for the baseline
> and the target data.
> 
> Can anyone help me?
> Thanks and best regards.
> 
> Mireia
> 
> 
> 
> Mireia Torralba Cuello
> Multisensory Research Group
> Center for Brain and Cognition, Universitat Pompeu Fabra
> Address: Edifici Mercè Rodoreda 24.313
>         c\ Ramon Trias Fargas, 25-27
>         08005 Barcelona
> http://www.mrg.upf.edu<http://www.mrg.upf.edu/>
> Tel +34 935422745
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20200227/e6
> 8e7ce1/attachment-0001.htm>
> 
> ------------------------------
> 
> Subject: Digest Footer
> 
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> _______________________________________________
> fieldtrip mailing list
> https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
> https://doi.org/10.1371/journal.pcbi.1002202
> 
> 
> ------------------------------
> 
> End of fieldtrip Digest, Vol 111, Issue 21
> ******************************************



More information about the fieldtrip mailing list