<div dir="ltr">Dear Julian and Stephan,<div><br></div><div>Thank you for your feedback.</div><div><br></div><div>Answering to Julian, no missing data are present that I'm aware of, at least inspecting the data structures and checking for NaNs. So I'm assuming that's not the problem.</div><div><br></div><div>Answering to Stephan:</div><div>The responses are locked to the EMG onset (so the motor response). </div><div>The interesting fact is that, when I extract the induced response by means of subtracting the faulty "ERF", the sensorimotor responses can be observed (sensorimotor alpha and lateralized beta ERD). The point is, I'm not sure if I'm actually subtracting the evoked response (what I would like to do) or just noise. </div><div>Moreover, in the figure outputs released by the HCP, the ERFs can be observed around the first 200 ms, although they merged the two runs. </div><div>Also, inside each epoch, multiple EMG responses can be present but the problem persists even after appropriately cropping the data and isolating a single EMG response for epoch.</div><div>These are the sanity checks implemented:</div><div><br></div><div>%% Sanity checks suggested<br>allData = reshape([data_rh.trial{:}], [length(data_rh.label),length(data_rh.time{1}),length(data_rh.trial)]);<br>any(isnan(allData(:)))</div><div><br>% Extracting the induced<br>for k = 1:numel(data_rh.trial)<br> data_rh.trial{k} = data_rh.trial{k} - avg_rh.avg;<br>end<br><br></div><div>% Cropping data (because of multiple EMG responses inside an epoch) -> step from Chieti Workshop (2015)<br>cfg = [];<br>cfg.latency = [-.75 .75];<br>data_rh = ft_selectdata(cfg, data_rh); % fake data structure to save as cropped<br><br></div><div>% Wavelet Averaging over trials (Avg TFR) keeping single trials<br>cfg = [];<br>cfg.channel = 'meg';<br>cfg.method = 'wavelet';<br>cfg.output = 'pow';<br>cfg.keeptrials = 'yes';<br>cfg.foi = 1:2:60; % freq range (linearly spaced)</div><div>cfg.toi = data_rh.time{1}(1:25:end); % every 25th timepoint, approximately every 50 ms; time windows<br>tfr_rh = ft_freqanalysis(cfg, data_rh);<br><br></div><div>cfg = [];<br>tfr_rh_pow = ft_freqdescriptives(cfg, tfr_rh);<br><br></div><div>cfg = [];<br>cfg.baseline = [-3 0];<br>cfg.baselinetype = 'relchange';<br>cfg.showlabels = 'yes';<br>cfg.layout = '4d248_helmet.mat';<br></div><div>% cfg.zlim = [0 2];<br>figure('name', 'Right hand TFR responses')<br>ft_multiplotTFR(cfg, tfr_rh_pow);</div><div><div class="gmail-rtcContent" style="padding:30px"><div class="gmail-lineNode" style="font-size:10pt;font-family:Menlo,Monaco,Consolas,"Courier New",monospace"></div></div></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Il giorno mar 3 giu 2025 alle ore 15:55 STEPHAN MORATTI via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>> ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">Dear Fabio,<div><br></div><div>Make sure that the trigger info is correct and precise. Motor responses usually are not phase locked to an external stimulus.</div><div>You could calculate induced frequency activity and see if you get a contra-lateralized beta band desynchronization (that is not</div><div>phase locked to the onset of your stimulus).</div><div><br></div><div>best,</div><div><br></div><div>Stephan</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El mar, 3 jun 2025 a las 13:56, Fabio Strappazzon via fieldtrip (<<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br>
<br>
I'm trying to extract ERFs from HCP MEG minimally preprocessed data<br>
from the motor task (right hand trials) and before doing the trial<br>
averaging I'm computing very simple operations (trial selection,<br>
0.5-60 Hz bandpass filtering and demeaning).<br>
I'm considering each run as independent, giving the fact that the<br>
sensor information is different across the two runs and this might<br>
affect the future source reconstruction.<br>
However, when I then compute the trial average, the evoked activity is<br>
not evident.<br>
Am I missing something?<br>
<br>
This is the script:<br>
<br>
clear all<br>
close all<br>
clc<br>
<br>
filesystem_dir % retrieves directories<br>
ft_init<br>
cd(scriptsdir)<br>
mySub = '177746';<br>
preprocdir = [datadir,mySub,'\MEG\Motort\tmegpreproc']; % preprocessed data dir<br>
subj_resdir = [resdir,mySub]; % results directory<br>
irun = 10;<br>
<br>
% loads minimally preprocessed data and trialinfo<br>
cd(preprocdir)<br>
load(sprintf([mySub,'_MEG_%d-Motort_tmegpreproc_TEMG.mat'],irun)) %<br>
run 1 (t0 is the EMG onset)<br>
load(sprintf([mySub,'_MEG_%d-Motort_tmegpreproc_trialinfo.mat'],irun))<br>
% WARNING: First columns are for EMG onsets, seconds for flash<br>
stimulus onset<br>
<br>
% selecting only right hand data<br>
cfg = [];<br>
cfg.channel = {'MEG'}; % read all MEG channels except EMG channels<br>
cfg.trials = find(data.trialinfo(:, 2) == 4); % select only right hand trials<br>
data_rh = ft_selectdata(cfg, data);<br>
<br>
% Wide-band BP filtering (prior to baseline correction):<br>
cfg = [];<br>
cfg.hpfilter = 'yes';<br>
cfg.hpfreq = .5;<br>
fdata_temp = ft_preprocessing(cfg, data_rh);<br>
<br>
cfg = [];<br>
cfg.lpfilter = 'yes';<br>
cfg.lpfreq = 60;<br>
fdata_rh = ft_preprocessing(cfg, fdata_temp);<br>
<br>
% Baseline correcting epochs;<br>
cfg = [];<br>
cfg.demean = 'yes';<br>
cfg.baselinewindow = [-0.3 0]; % -300 ms to 0 (chosen by HCP)<br>
fdata2avg = ft_preprocessing(cfg, fdata_rh);<br>
<br>
% ERF (avg across bsln corrected trials)<br>
cfg = [];<br>
avg_rh = ft_timelockanalysis(cfg, fdata2avg);<br>
<br>
% Plot<br>
cfg = [];<br>
cfg.showlabels = 'yes';<br>
cfg.fontsize = 6;<br>
cfg.layout = '4d248_helmet.mat';<br>
cfg.ylim = [-3e-13 3e-13]; % problem is present also when the scale is adjusted<br>
ft_multiplotER(cfg, avg_rh);<br>
<br>
Thanks in advance.<br>
Best regards,<br>
<br>
Fabio.<br>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd8c8bc3ca77e42ff461608dda2ae8323%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845592584748640%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=C17BG5J%2B3qZ7r8AmtRqqECr2lhIn%2B4YXF1BKiBO2llI%3D&reserved=0" originalSrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd8c8bc3ca77e42ff461608dda2ae8323%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845592584786798%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=G4WtmPddYG8mYEFR7mLe0SGjRMkZx1BmY0HGlGCDCSo%3D&reserved=0" originalSrc="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Un cordial saludo,<br><br><img src="http://www.ucm.es/logo/ucm.png"><br>Stephan Moratti, PhD<br>Profesor de Psicología Básica I<br>Universidad Complutense de Madrid<br>91 394 3141<br><a href="mailto:smoratti@ucm.es" target="_blank">smoratti@ucm.es</a><br><br>La información contenida en este correo es CONFIDENCIAL, de uso exclusivo del destinatario/a arriba mencionado. Si ha recibido este mensaje por error, notifíquelo inmediatamente por esta misma vía y proceda a su eliminación, ya que ud. tiene totalmente prohibida cualquier utilización del mismo, en virtud de la legislación vigente.<br><br>Los datos personales recogidos serán incorporados y tratados en el fichero 'Correoweb', bajo la titularidad del Vicerrectorado de Tecnologías de la Información, y en él el interesado/a podrá ejercer los derechos de acceso, rectificación, cancelación y oposición ante el mismo (artículo 5 de la Ley Orgánica 15/1999, de 13 de diciembre, de Protección de Datos de Carácter Personal).<br><br><img src="http://www.ucm.es/logo/ambiente.png"> <span style="color:rgb(56,118,29)">Antes de imprimir este correo piense si es necesario: el medio ambiente es cosa de todos.</span><br><br>This message is private and confidential and it is intended exclusively for the addressee. If you receive this message by mistake, you should not disseminate, distribute or copy this e-mail. Please inform the sender and delete the message and attachments from your system, as it is completely forbidden for you to use this information, according to the current legislation. No confidentiality nor any privilege regarding the information is waived or lost by any mistransmission or malfunction.<br><br>The personal data herein will be collected in the file “Correoweb”, under the ownership of the Vice-Rectorate for Information Technologies, in which those interested may exercise their right to access, rectify, cancel or protest the contents (article 5 of Organic Law 15/1999 dated 13 December, on the Protection of Personal data).<br><br><img src="http://www.ucm.es/logo/ambiente.png"> <span style="color:rgb(56,118,29)">Before printing this mail please consider whether it is really necessary: the environment is a concern for us all.</span><br></div></div></div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd8c8bc3ca77e42ff461608dda2ae8323%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845592584811511%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=F5XszGU1m82rmdyPBybAjPTYGRLzWzA3PYdhPJZibrs%3D&reserved=0" originalSrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7Cd8c8bc3ca77e42ff461608dda2ae8323%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845592584835161%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=U00Nd8VSRsJFE76TMe5w63UkfCubMPKGLX0VCUqQ%2BYc%3D&reserved=0" originalSrc="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>