[FieldTrip] Computing ERFs from HCP MEG Motor Task

STEPHAN MORATTI smoratti at ucm.es
Tue Jun 3 15:26:26 CEST 2025


Dear Fabio,

Make sure that the trigger info is correct and precise. Motor
responses usually are not phase locked to an external stimulus.
You could calculate induced frequency activity and see if you get a
contra-lateralized beta band desynchronization (that is not
phase locked to the onset of your stimulus).

best,

Stephan


El mar, 3 jun 2025 a las 13:56, Fabio Strappazzon via fieldtrip (<
fieldtrip at science.ru.nl>) escribió:

> Dear all,
>
> I'm trying to extract ERFs from HCP MEG minimally preprocessed data
> from the motor task (right hand trials) and before doing the trial
> averaging I'm computing very simple operations (trial selection,
> 0.5-60 Hz bandpass filtering and demeaning).
> I'm considering each run as independent, giving the fact that the
> sensor information is different across the two runs and this might
> affect the future source reconstruction.
> However, when I then compute the trial average, the evoked activity is
> not evident.
> Am I missing something?
>
> This is the script:
>
> clear all
> close all
> clc
>
> filesystem_dir % retrieves directories
> ft_init
> cd(scriptsdir)
> mySub = '177746';
> preprocdir = [datadir,mySub,'\MEG\Motort\tmegpreproc']; % preprocessed
> data dir
> subj_resdir = [resdir,mySub]; % results directory
> irun = 10;
>
> % loads minimally preprocessed data and trialinfo
> cd(preprocdir)
> load(sprintf([mySub,'_MEG_%d-Motort_tmegpreproc_TEMG.mat'],irun)) %
> run 1 (t0 is the EMG onset)
> load(sprintf([mySub,'_MEG_%d-Motort_tmegpreproc_trialinfo.mat'],irun))
> % WARNING: First columns are for EMG onsets, seconds for flash
> stimulus onset
>
> % selecting only right hand data
> cfg = [];
> cfg.channel = {'MEG'}; % read all MEG channels except EMG channels
> cfg.trials = find(data.trialinfo(:, 2) == 4); % select only right hand
> trials
> data_rh = ft_selectdata(cfg, data);
>
> % Wide-band BP filtering (prior to baseline correction):
> cfg = [];
> cfg.hpfilter = 'yes';
> cfg.hpfreq = .5;
> fdata_temp = ft_preprocessing(cfg, data_rh);
>
> cfg = [];
> cfg.lpfilter = 'yes';
> cfg.lpfreq = 60;
> fdata_rh = ft_preprocessing(cfg, fdata_temp);
>
> % Baseline correcting epochs;
> cfg = [];
> cfg.demean = 'yes';
> cfg.baselinewindow = [-0.3 0]; % -300 ms to 0 (chosen by HCP)
> fdata2avg = ft_preprocessing(cfg, fdata_rh);
>
> % ERF (avg across bsln corrected trials)
> cfg = [];
> avg_rh = ft_timelockanalysis(cfg, fdata2avg);
>
> % Plot
> cfg = [];
> cfg.showlabels = 'yes';
> cfg.fontsize = 6;
> cfg.layout = '4d248_helmet.mat';
> cfg.ylim = [-3e-13 3e-13]; % problem is present also when the scale is
> adjusted
> ft_multiplotER(cfg, avg_rh);
>
> Thanks in advance.
> Best regards,
>
> Fabio.
> _______________________________________________
> fieldtrip mailing list
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C619c44fd12c34ee0fdc808dda2a246e1%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845540043364315%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=6uererPrDpCH%2B988ansSJgIJ50mLcvyP8gRq98AmY9o%3D&reserved=0
> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C619c44fd12c34ee0fdc808dda2a246e1%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638845540043393089%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=kC7HgcT65sRSvAKBhdaFHYk%2FuSSZpJSj%2FQgCP3TMZ64%3D&reserved=0
>


-- 
Un cordial saludo,


Stephan Moratti, PhD
Profesor de Psicología Básica I
Universidad Complutense de Madrid
91 394 3141
smoratti at ucm.es

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.

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).

 Antes de imprimir este correo piense si es necesario: el medio ambiente es
cosa de todos.

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.

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).

 Before printing this mail please consider whether it is really necessary:
the environment is a concern for us all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250603/52dd3d8b/attachment.htm>


More information about the fieldtrip mailing list