<div dir="ltr">
<p class="MsoNormal">Hi Jan-Mathijs,<br><br></p>


<p class="MsoNormal">Thank you for your reply. I tried using different atlases
(HCP52 with 360 parcels, Schaefer400 with 400 parcels), but I’m still seeing a
high variation in the number of sources per parcel. I was planning to perform a
sort of semi-searchlight by chunking the data into parcels based on an
anatomical atlas and using those parcels as input for the spatial searchlight.
However, this isn’t really possible with such a high variation in sources per
parcel.<br><br></p>


<p class="MsoNormal">Instead, do you think it would work to manually define the
neighboring dipoles (e.g., identifying the direct neighbors for each dipole)
instead of using parcels for the searchlight?<br><br></p>


<p class="MsoNormal">Thank you very much!</p>


<p class="MsoNormal">Marisa</p>


</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">Il giorno mar 18 feb 2025 alle ore 13:58 Schoffelen, J.M. (Jan Mathijs) 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>
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="m_8409709580238285708lineBreakAtBeginningOfMessage">
<div><br>
<blockquote type="cite">
<div>On 17 Feb 2025, at 15:53, Marisa Monika Amalie Birk via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" target="_blank">fieldtrip@science.ru.nl</a>> wrote:</div>
<br>
<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%7C84276ac2aee147f9fd5e08dd50f16fb8%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638755720529905417%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=PuawuD8uIkC7NqxKKMY4uHPDCZhFP0Dk0PB5%2BGPC8Cs%3D&reserved=0" originalSrc="https://github.com/mcvinding/warpimg/blob/main/benchmarking/source_c_virtualchan.m" shash="RKrpwB8qFiN732BcL1YgbwVNwQgHWd44utFMje8Qo+bshPYIKYnDnkfczx//1flc06lx6hWYpQ8BGBIjjtazMOUCidw/+sCAR0Ys6kiRrzwi1293mP3/16MFFwCawjG5eKwfcWLd1Vb5dJBf6DcTbfZj1jv61z87DF4ackzcmec=" target="_blank">
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>
<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%7C84276ac2aee147f9fd5e08dd50f16fb8%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638755720529953349%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=Ffbicac4obmg5aNWSfEZ9YJyMVSKwWORpxWIRmpJJA0%3D&reserved=0" originalSrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="sOI3WC0nf6MZQaP2QWDquCLGpgFMbB54rb41Q/SnP3Wa+tmfc7arxOw1S/728lgEtNk9SPk1nDzoFBtQ2B8OXbUZWtWp/Siv/mjMpzHZP5YF0z/N2VECrk+pm7R4SZKCpWLDp+j+lpCP9Vt2l9MOppCF9lPk4WTzxLbhOSlgJQQ=" 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%7C84276ac2aee147f9fd5e08dd50f16fb8%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638755720529994980%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=oE3WftAlNGkiozfqFgMEdIK8XF8ezyJ89gmDhDGAbK0%3D&reserved=0" originalSrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="t4yYKa/TKl0WFrwkHtQWz7JXqmTrDZ4fQu7Ms+El6lEUpudrX6rq+pCbdoZf16syS9Erh+pWEQis0epv4xqrEVKnoqQgPDd3XESfwwNilDH6cg42YTFmUyGBZuZrHLn7IUTBwdjdjR8oSbSiQksSVo0nIWEiczd5gcQVwbjpZ/M=" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</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%7C84276ac2aee147f9fd5e08dd50f16fb8%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638755720530037745%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=shuvxl57JoqWJDmlcMC5lfEyvyL3Q4s%2FtcETAMEo1p0%3D&reserved=0" originalSrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="jnL/F7VvjSD5J3kIU0nV14WO/rJypFgHhjTABXgHrBYUoXcODQnz+RDX+tWmpMMx8cKnyZqs3zZZUHM2cJYaPx6aaLXy/0RMlMyvy2xw0sFOShYBL0KNThorVmGiYZNK5DTIYFuyrZlaMNLZj9tILLqHOC3eOuzpA3c6t1sAp5A=" 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%7C84276ac2aee147f9fd5e08dd50f16fb8%7C084578d9400d4a5aa7c7e76ca47af400%7C1%7C0%7C638755720530070460%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C80000%7C%7C%7C&sdata=GixSJuZSanlytEOh3zZsTAhl7R6cr8MoaPYgnCXd7GY%3D&reserved=0" originalSrc="https://doi.org/10.1371/journal.pcbi.1002202" shash="kAZj2qfjeQ7FCZeImm5NlYA6MH3TfTxFANK0UdwbR+retjZIYcCyG6FxFsJEfOUALSq07ZdsMbzUF7DDQ81l3UAfpM0IjxJmdtrZhf5GAMKbCf4hmHmJFbRT44scxAUHdZotQkAHxcjK48VqC4epTRTmJHZq8Cr67/tFk5ySvxs=" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>