[FieldTrip] Merging runs with different grad.tra matrix
Konstantinos Tsilimparis
konstantinos.tsilimparis at outlook.com
Wed Nov 6 14:14:04 CET 2024
Hi Marisa,
To cancatenate data you can use ft_appenddata. Since in your data there are missing channels in some of your runs (rejected from ICA), the function will return a data structure containing only the channels which are present in all runs.
One workaround is to add NaNs as data for the missing channels, bringing them back in your data structure and then concatenate. To remove the NaNs before your source reconstruction, you can then set cfg.nanmean = 'yes' in ft_timelockanalysis.
I hope that helps,
Konstantinos
Konstantinos Tsilimparis
MSc graduate
Donders Institute for Brain, Cognition and Behaviour・Radboud University
Nijmegen・The Netherlands
contsili.github.io
From: fieldtrip <fieldtrip-bounces at science.ru.nl> On Behalf Of Marisa Monika Amalie Birk via fieldtrip
Sent: Tuesday, November 5, 2024 6:32 PM
To: fieldtrip at science.ru.nl
Cc: Marisa Monika Amalie Birk <marisa.birk at unitn.it>
Subject: [FieldTrip] Merging runs with different grad.tra matrix
Dear FieldTrippers,
I am working with MEG data from multiple runs, each ca. 8 min long and saved as separate files. I have applied MaxFilter with a target head position and preprocessed each run individually, including ICA, and now want to concatenate the data before doing source reconstruction.
Up until the ICA, the grad struct was identical between runs. However, using ft_componentanalysis and ft_rejectcomponent changed the grad.tra matrix, leading to differences across runs. This means I can't simply merge the datasets. This tutorial<https://www.fieldtriptoolbox.org/faq/how_are_electrodes_magnetometers_or_gradiometers_described/> emphasizes how important the grad.tra field is for computing the leadfields and that it should remain consistent with the data manipulations - so I assume that I can not simply use the grad.tra matrix from before the ICA.
Do you have suggestions on how I should proceed? Should I perform source reconstruction separately for each run, or is it better to concatenate the runs first and then do the ICA on the full dataset? The runs are also rank-deficient and have slightly different ranks due to MaxFiltering, so I am unsure about merging them before ICA to avoid rank mismatches.
Are there alternative approaches you would recommend?
Thank you!
Best regards
Marisa
Marisa Birk
PhD Student in Cognitive and Brain Sciences,
Action Recognition and Concepts Group (CIMeC)<https://www.cimec.unitn.it/en/929/action-recognition-and-concepts-group>
Center for Mind and Brain Sciences (CIMeC),
University of Trento, Italy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20241106/b5ede0b9/attachment.htm>
More information about the fieldtrip
mailing list