<div dir="ltr"><div><div><div>Thank you Arjen,<br></div><div>Actually, I am testing the FieldTrip motion regression on MEG data specifically collected with a current phantom and known motion. I can treat the data as ERP data and average over 1 sec trials if needed. <br>
</div>Following your advise on reduction of the regressors number (on 120 trials of 1 sec long) I was able to avoid the "out of memory" issue. Though I run into the different set of problems now that I need help to understand:<br>
______________________________________________<br>??? Error using ==> mxSerialize<br>Error during serialization of (null)<br><br>Error in ==> ft_postamble_provenance at 91<br> cfg.callinfo.outputhash{iargout} = CalcMD5(mxSerialize(tmparg));<br>
<br>Error in ==> ft_postamble at 55<br> evalin('caller', ['ft_postamble_' cmd]);<br><br>Error in ==> ft_timelockanalysis at 370<br>ft_postamble provenance timelock<br><br>Error in ==> ft_regressconfound at 313<br>
dataout = ft_timelockanalysis(tempcfg, dataout);% reaveraging<br>_________________________________________________________<br><br></div>Here is the code I run to regress the head motion:<br>%%<br>addpath C:\Userdata\MATLAB\FieldTrip\fieldtrip-20131023<br>
ft_defaults<br>cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds';<br>cfg.trialdef.triallength=1; <br>cfg.trialdef.ntrials=120; <br>cfg.continuous = 'yes';<br>cfg = ft_definetrial(cfg); <br>cfg.channel = {'MEG'};<br>
cfg.demean = 'yes';<br>data = ft_preprocessing(cfg); <br><br>%%<br>cfg = [];<br>cfg.keeptrials = 'yes';<br>timelock = ft_timelockanalysis(cfg, data); <br><br>%%<br>cfg = [];<br>
cfg.dataset = 'InnaTest_Current-Phantom_20131004_09.ds';<br>cfg.trialdef.triallength=1;<br>cfg.trialdef.ntrials=120; <br>cfg.continuous = 'yes';<br>cfg = ft_definetrial(cfg);<br><br>%%<br>cfg.channel = {'HLC0011','HLC0012','HLC0013', ...<br>
'HLC0021','HLC0022','HLC0023', ...<br> 'HLC0031','HLC0032','HLC0033'};<br>headpos = ft_preprocessing(cfg);<br><br>
ntrials = length(headpos.sampleinfo)<br>for t = 1:ntrials<br>coil1(:,t) = [mean(headpos.trial{1,t}(1,:)); mean(headpos.trial{1,t}(2,:)); mean(headpos.trial{1,t}(3,:))];<br>coil2(:,t) = [mean(headpos.trial{1,t}(4,:)); mean(headpos.trial{1,t}(5,:)); mean(headpos.trial{1,t}(6,:))];<br>
coil3(:,t) = [mean(headpos.trial{1,t}(7,:)); mean(headpos.trial{1,t}(8,:)); mean(headpos.trial{1,t}(9,:))];<br>end<br><br>cc = circumcenter(coil1, coil2, coil3);<br>cc_dem = [cc - repmat(mean(cc,2),1,size(cc,2))]';<br>
<br>%%<br>confound = [cc_dem ...<br>ones(size(cc_dem,1),1)]; <br><br>%%<br>cfg = [];<br>cfg.confound = confound;<br>cfg.reject = [1:6];<br>regr = ft_regressconfound(cfg, timelock);<br>
%%<br><br>_________________________________________________________________<br></div>Sorry for the lengthy letter and thanks for the help!<br><div><div class="gmail_extra"><br clear="all"><div>Inna<br></div><br><br><br><br>
<br><div class="gmail_quote">On Thu, Nov 28, 2013 at 12:23 PM, Stolk, A. (Arjen) <span dir="ltr"><<a href="mailto:a.stolk@fcdonders.ru.nl" target="_blank">a.stolk@fcdonders.ru.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Hi Inna,<br><br>Are you using the same design matrix as on the wiki page? That one covers the primary head translations and rotations, but also their derivatives. You could try using the primary measures only (3 translastions, and 3 rotations of the circumcenter, totaling 6 + 1 constant regressors). It is also mentionworthy that there should be a balance between the number of regressors and the number of observations (i.e. trials). I believe on the respective wiki page on head movement regression it states that the ratio is recommended to be not larger than 1:10 (regressors:trials), accompanied with a reference. Accordingly, I'd suggest to use those 7 regressors, and your data (120s resting state) split in segments of 1 or 2 seconds, totaling 60 or 120 trials. These specifications might hopefully also allow working around your memory issue.<br>
<br>Second, it may be worth mentioning what you would like to do with the data post-movement-regression. Namely, the movement compensation will remove contributions from head movement to the signal. But this requires that signal to behave consistently over trials, which does not seem the case with the signal in your resting study? That is, with an ERP study, the signal fluctuations appear consistent over trials, with amplitudes being modulated by head movement (i.e. sensor-source distance, see our neuroimage paper - 2013) in a predictable fashion. So if you're planning on doing frequency analysis, or maybe connectivity analysis, after head movement compensation, I'd recommend reversing that order. The rule of thumb is to use ft_regressconfound just prior to ft_xxxstatistics, removing otherwise unexplained variance (over trials) due to head movement, benefitting your statistical assessments. <br>
<br>Hope these suggestions may help you with further analyses. I'm not familiar with anyone implementing this method to resting state analyses, but maybe someone else has some first-hand experience here. Furthermore, too late for your current dataset, but for a next one I'd recommend using the online head position monitoring/respositioning tool that we have developed for CTF systems (a neuromag version is approaching the final stage). This tool is routinely used in our lab to monitor and reduce head movment throughout recording (after which ft_regressconfound is being used to deal with the trial-by-trial crumbles). <br>
<br>Yours,<br>Arjen</div><br>_______________________________________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="http://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">http://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br></blockquote></div><br></div></div></div>