<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Marisa,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs<br id="lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 17 Feb 2025, at 15:53, Marisa Monika Amalie Birk via fieldtrip <fieldtrip@science.ru.nl> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">
<div>Dear Fieldtrippers,<br>
<br>
I am currently doing source reconstructing for MEG data and I’ve run into an issue I’m hoping someone can help with.<br>
<br>
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.<br>
<br>
I closely followed the scripts from <a href="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" originalsrc="https://github.com/mcvinding/warpimg/blob/main/benchmarking/source_c_virtualchan.m" shash="KkRBc9iZI9gIjRzenmPtxDL8Is3FxP5YpJBdSC5BcW2N39GhFGXnKUsAISDiz8B/PKlQNveWTVP8xcuCEuT4ZO6EkhYx6zsQ43FhXdJEm2eCXqcDNwwhnpr3mI1JewS8OfoBsMA7Syi2hMsJ8b50qdZ/Gagit6hFj8pxPtEy94Y=" originalsrc="https://github.com/mcvinding/warpimg/blob/main/benchmarking/source_c_virtualchan.m" shash="F7RL0xXSNxhVoMQJrxQO15D/Q7VQhgNQCB7Ge4HNVMGwBy+pciIbtjthvU+j7vnL5aGoeui/0t5fOLJjLgB0a89DuwojOMfPHyiDI/YhNAXiz4/Y6l+7rD3WWPfkIixkKtWoep3e2y769hnnfSLaTiHWw0/oaamETQYRCcneAxE=">
Mikkel Vinding and Robert Oostenveld</a>: I created the spatial filters using the LCMV beamformer and interpolated the AAL atlas onto the sourcemodel, then used the ft_virtualchannel function.<br>
<br>
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.<br>
<br>
Is this expected behavior? Or have I made an error somewhere in the process?</div>
<div><br>
</div>
<div><br>
My code is as follows:<br>
<br>
%% Interpolate Atlas<br>
load(fullfile(ftpath, '/template/sourcemodel/standard_sourcemodel3d4mm'));<br>
atlas = ft_read_atlas([ftpath filesep 'template/atlas/aal/ROI_MNI_V4.nii']);<br>
<br>
cfg = [];<br>
cfg.interpmethod = 'nearest'; % Or another interpolation method if needed<br>
cfg.parameter = 'tissue'; % or other relevant parameters based on the atlas<br>
sourcemodel_atlas = ft_sourceinterpolate(cfg, atlas, sourcemodel);<br>
sourcemodel_atlas.tissuelabel = atlas.tissuelabel;<br>
<br>
atlas_grid = ft_checkdata(sourcemodel_atlas, 'datatype', 'source');<br>
atlas_grid.inside = sourcemodel.inside;<br>
<br>
%% Create Common Filters using LCMV beamformer<br>
cfg = [];<br>
cfg.method = 'lcmv';<br>
cfg.channel = 'meg';<br>
cfg.lcmv.keepfilter = 'yes';<br>
cfg.lcmv.fixedori = 'yes';<br>
cfg.lcmv.lambda = '5%';<br>
cfg.lcmv.kappa = kappa;<br>
cfg.lcmv.projectmom = 'yes';<br>
cfg.headmodel = headmodel;<br>
cfg.sourcemodel = grid; %leadfield<br>
commonfilter_sub = ft_sourceanalysis(cfg, tlckw); %tlckw is time-locked data<br>
<br>
%% add atlas to Filter<br>
commonfilter_sub.tissue = atlas_grid.tissue;<br>
commonfilter_sub.tissuelabel = atlas_grid.tissuelabel;<br>
<br>
% Create virtual channels<br>
cfg = [];<br>
cfg.parcellation = 'tissue';<br>
cfg.method = 'none';<br>
virtualData = ft_virtualchannel(cfg, data_av, commonfilter_sub); % data_av is averaged data over trials<br>
<br>
<br>
<div>Thanks in advance for your help!<br>
</div>
Marisa Birk<br>
<div><br>
</div>
<br>
<br>
<br>
<br>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip<br>
https://doi.org/10.1371/journal.pcbi.1002202<br>
</div>
</blockquote>
</div>
<br>
</div>
</body>
</html>