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