[FieldTrip] Using ft_virtualchannel with cfg.method = 'none'

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Tue Feb 18 13:25:43 CET 2025


Hi Marisa,

I don’t think that this is due to an error on your end. It’s just due to the fact that the (interpolated, but also the original) atlas of your choice has a wide wide range of parcel sizes.

Best wishes,
Jan-Mathijs

On 17 Feb 2025, at 15:53, Marisa Monika Amalie Birk via fieldtrip <fieldtrip at science.ru.nl> wrote:

Dear Fieldtrippers,

I am currently doing source reconstructing for MEG data and I’ve run into an issue I’m hoping someone can help with.

Specifically, I am using the ft_virtualchannel function, but with cfg.method = 'none', so that the components of the virtual channels are not combined. For further analysis I need the sources to remain separated per parcel.

I closely followed the scripts from Mikkel Vinding and Robert Oostenveld<https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmcvinding%2Fwarpimg%2Fblob%2Fmain%2Fbenchmarking%2Fsource_c_virtualchan.m&data=05%7C02%7Cfieldtrip%40science.ru.nl%7C3ec77a03c644491875a708dd50175d5d%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638754783455281891%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=R%2FCnzbxF45eNE5FgSmntHQlqa%2BcmdPgewUyqEfl%2B%2Bls%3D&reserved=0>: I created the spatial filters using the LCMV beamformer and interpolated the AAL atlas onto the sourcemodel, then used the ft_virtualchannel function.

The problem is that I'm seeing a highly uneven number of virtual channels per parcel. For example, Heschl_L has only 25 channels, while Frontal_Mid_R has 651. In total, the mean number of virtual channels per parcel is 200, but the standard deviation is 146. This seems quite strange to me, as I would expect the ROIs to be more comparable in size.

Is this expected behavior? Or have I made an error somewhere in the process?


My code is as follows:

%% Interpolate Atlas
load(fullfile(ftpath, '/template/sourcemodel/standard_sourcemodel3d4mm'));
atlas = ft_read_atlas([ftpath filesep 'template/atlas/aal/ROI_MNI_V4.nii']);

cfg = [];
cfg.interpmethod = 'nearest';  % Or another interpolation method if needed
cfg.parameter = 'tissue';      % or other relevant parameters based on the atlas
sourcemodel_atlas = ft_sourceinterpolate(cfg, atlas, sourcemodel);
sourcemodel_atlas.tissuelabel = atlas.tissuelabel;

atlas_grid = ft_checkdata(sourcemodel_atlas, 'datatype', 'source');
atlas_grid.inside = sourcemodel.inside;

%% Create Common Filters using LCMV beamformer
cfg = [];
cfg.method              = 'lcmv';
cfg.channel             = 'meg';
cfg.lcmv.keepfilter     = 'yes';
cfg.lcmv.fixedori       = 'yes';
cfg.lcmv.lambda         = '5%';
cfg.lcmv.kappa          = kappa;
cfg.lcmv.projectmom     = 'yes';
cfg.headmodel       = headmodel;
cfg.sourcemodel     = grid;  %leadfield
commonfilter_sub              = ft_sourceanalysis(cfg, tlckw);  %tlckw is time-locked data

%% add atlas to Filter
commonfilter_sub.tissue = atlas_grid.tissue;
commonfilter_sub.tissuelabel = atlas_grid.tissuelabel;

% Create virtual channels
cfg = [];
cfg.parcellation = 'tissue';
cfg.method = 'none';
virtualData = ft_virtualchannel(cfg, data_av, commonfilter_sub); % data_av is averaged data over trials


Thanks in advance for your help!
Marisa Birk





_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://doi.org/10.1371/journal.pcbi.1002202

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20250218/ceed2862/attachment.htm>


More information about the fieldtrip mailing list