<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Dear Johannes,
<div class=""><br class="">
</div>
<div class="">Could you explain a bit more what you attempt to do? Specifically: what is the parcellation that you are using? Ideally, you should use one that is defined on exactly the same surface as your data.  Otherwise (e.g. when using a parcellation defined
 in 3D space) some on-the-fly interpolation is required, and this may not work robustly enough. One possible cause is the fact that some parcels in the input parcellation will not get assigned any of the locations at which your functional data is represented.
 Which is probably the cause of the error you are facing.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class="">PS: as a side note, in general I would recommend to compute connectivity in parcellated space, rather than in ‘dipole space’. Apart from potential memory issues, the sheer number of pairwise combination makes the interpretation / statistical evaluation
 quite complicated.<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 7 Oct 2021, at 09:08, Johannes Gehrig via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear Stefan,</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
thanks for your reply. At the moment I use simple "coherence" following the „whole brain connectivity“ tutorial. However, if there was a memory efficient solution for dwPLI that is also an option. If I followed the discussion correctly, this is not yet fully
 implemented?</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Have you tried to parcellate your data before doing the connectivity analysis? I suspect that my problem could be related with ft_sourceinterpollate, because the output of the source analysis (avg.csd, avg.mom, avg.noisecsd, computed withels pcc) is no longer
 present after ft_sourceinterpolate and without the source interpolation the source parcellation doesn't work, so far my impression...</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thanks and best regards,</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Johannes<span lang="EN-GB" class=""><o:p class=""></o:p></span></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif; border: none; padding: 0cm;" class="">
<b class="">Von:<span class="Apple-converted-space"> </span></b><a href="mailto:stefan.dvoretskii@tum.de" style="color: blue; text-decoration: underline;" class="">Stefan Dvoretskii</a><br class="">
<b class="">Gesendet:<span class="Apple-converted-space"> </span></b>Mittwoch, 6. Oktober 2021 17:39<br class="">
<b class="">An:<span class="Apple-converted-space"> </span></b><a href="mailto:fieldtrip@science.ru.nl" style="color: blue; text-decoration: underline;" class="">FieldTrip discussion list</a><br class="">
<b class="">Cc:<span class="Apple-converted-space"> </span></b><a href="mailto:jgehrig@med.uni-frankfurt.de" style="color: blue; text-decoration: underline;" class="">Johannes Gehrig</a>;<span class="Apple-converted-space"> </span><a href="mailto:cristina.gil@tum.de" style="color: blue; text-decoration: underline;" class="">Gil
 Avila, Cristina</a><br class="">
<b class="">Betreff:<span class="Apple-converted-space"> </span></b>Re: [FieldTrip] problem using ft_sourceparcellate</div>
</div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear Johannes, </div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
which connectivity measure are you using? There is a potential bottleneck in the 'ft_connectivityanalysis', which can however be circumvented with custom code, at least for dwPLI. Then you won't even need to parcelate.</div>
</div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
We are currently working to incorporate it into the Fieldtrip code.</div>
</div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Best regards,</div>
</div>
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Stefan</div>
</div>
<p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<o:p class=""> </o:p></p>
<div class="">
<div class="">
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
пн, 4 окт. 2021 г., 11:06 Johannes Gehrig via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" style="color: blue; text-decoration: underline;" class="">fieldtrip@science.ru.nl</a>>:</div>
</div>
<blockquote style="border-style: none none none solid; border-left-width: 1pt; border-left-color: rgb(204, 204, 204); padding: 0cm 0cm 0cm 6pt; margin: 5pt 0cm 5pt 4.8pt;" class="">
<div class="">
<p class="">Dear Fieldtrip-user,</p>
<p class="">I am facing a problem using ft_sourceinterpolate. I am following the "Whole brain connectivity and network analysis"- Tutorial and as I can not compute the connectivity directly with the source data ("out of memory") I would like to perform the
 source parcellation before computing the connectivity. Unfortunately (fieldtrip 20211001 and matlab2018b) ft_sourceparcellate crashes after calling it. Before computing the source data the sourcemodel was interpolated with the atlas using ft_sourceinterpolate.
 Therefore the amount of positions in the atlas and the source data is the same (8004).</p>
<p class="">load('atlas_MMP1.0_4k.mat');<span class="Apple-converted-space"> </span><br class="">
cfg = [];<br class="">
cfg.parcellation = 'parcellation';<br class="">
cfg.method       = 'mean';<br class="">
cfg.parameter    = 'all';<span class="Apple-converted-space"> </span><br class="">
parc_sourceOn = ft_sourceparcellate(cfg, source_ON, atlas);</p>
<p class="">Error message:"<br class="">
there are in total 8004 positions, 4544 positions are inside the brain, 8004 positions have a label<br class="">
4544 of the positions inside the brain have a label<br class="">
4544 of the labeled positions are inside the brain<br class="">
0 of the positions inside the brain do not have a label<br class="">
creating 362 parcels for parameter csd by taking the mean<br class="">
computing parcellation<br class="">
232           tmp(j,:,:) = cellmean1(dat(tissue==j));<br class="">
computing parcellation for L_V1_ROI<br class="">
Index exceeds array bounds.<br class="">
<br class="">
Error in ft_sourceparcellate>cellmean1 (line 494)<br class="">
y = x{1};<br class="">
<br class="">
Error in ft_sourceparcellate (line 232)<br class="">
          tmp(j,:,:) = cellmean1(dat(tissue==j));</p>
<p class="">"</p>
<p class="">Any help and ideas are very much appreciated!</p>
<p class="">Best regards, Johannes</p>
</div>
</blockquote>
</div>
</div>
<div style="margin: 0cm 0cm 0cm 4.8pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank" style="color: blue; text-decoration: underline;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!pg0W3nFXzJCE9mE1pvYfYPxllCL06pTokAzKEH8cYGsjnXbtXGbXLrC_6SLHcu0eFLPB1lmxevpST48$" target="_blank" style="color: blue; text-decoration: underline;" class="">https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</a></div>
<div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">fieldtrip
 mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!pg0W3nFXzJCE9mE1pvYfYPxllCL06pTokAzKEH8cYGsjnXbtXGbXLrC_6SLHcu0eFLPB1lmxevpST48$" style="color: blue; text-decoration: underline; font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!pg0W3nFXzJCE9mE1pvYfYPxllCL06pTokAzKEH8cYGsjnXbtXGbXLrC_6SLHcu0eFLPB1lmxevpST48$</a><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span></span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>