<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
yes, sure I can give some further details.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I have recorded EEG data and extracted ERPs for two different conditions. At the scalp level, I have found significant differences between conditions in two separate time intervals: one over central electrodes around 250 ms after the stimulus presentations
 (P200), and the second one over occipital electrodes after 190 ms (N190). Then, I wanted to look for the source generators of these differences. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
For each participant, I reconstructed the source activity using the ft_sourceanalysis function, with the mne method. </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Here you can fine the line of codes:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        cfg               = [];
<div>        cfg.method        = 'mne';</div>
<div>        cfg.grid          = leadfield;</div>
<div>        cfg.headmodel     = vol.vol;</div>
<div>        cfg.mne.lambda    = 3;</div>
<div>        cfg.mne.scalesourcecov = 'yes';</div>
<div>        sourceLow            = ft_sourceanalysis(cfg, dataAvgLow);</div>
        sourceHigh            = ft_sourceanalysis(cfg, dataAvgHigh);<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Thus, I created a cell array with data of all subjects:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
        brain_lhh{i} = sourceHigh;<br>
        brain_hlm{i} = sourceLow;<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As concerns the statistical analysis, I have used the same script of the tutorial
<a href="https://www.fieldtriptoolbox.org/example/source_statistics/" id="LPNoLPOWALinkPreview">
https://www.fieldtriptoolbox.org/example/source_statistics/</a>, just adding information about the time range that I wanted to test:</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    cfg=[];
<div>    cfg.method      = 'montecarlo';</div>
<div>    cfg.latency = [0.200 0.400];  % This was the significant time interaval where I found differences at the scalp level</div>
<div>    cfg.avgovertime = 'yes';</div>
<div>    cfg.statistic   = 'ft_statfun_depsamplesT';</div>
<div>    cfg.parameter   = 'pow';</div>
<div>    cfg.correctm    = 'cluster';</div>
<div>    %cfg.clusterstatistic = 'wcm';</div>
<div>    cfg.numrandomization = 1000;</div>
<div>    cfg.alpha       = 0.05; % note that this only implies single-sided testing</div>
<div>    cfg.tail        = 0;</div>
<div>    </div>
<div>    nsubj=numel(brain_hlm);</div>
<div>    cfg.design(1,:) = [1:nsubj 1:nsubj];</div>
<div>    cfg.design(2,:) = [ones(1,nsubj)*1 ones(1,nsubj)*2];</div>
<div>    cfg.uvar        = 1; % row of design matrix that contains unit variable (in this case: subjects)</div>
<div>    cfg.ivar        = 2; % row of design matrix that contains independent variable (the conditions)</div>
<div>    </div>
    statP200 = ft_sourcestatistics(cfg, brain_hlm{:}, brain_lhh{:});<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This function returned the "statP200" variable where I can find information about the significant dipoles over the whole areas of the cortex.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
What I want to do now is try to restrict the area of analysis to specific regions of interest. I see that the function ft_sourcestatistics gives the user the possibility to specify the ROIs, by populating the field cfg.atlas and cfg.roi. Hence, I added to the
 previous lines of code the following ones: </div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgba(0, 0, 0, 0);">    aal = ft_read_atlas('D:\Matlab Analysis\Toolbox\eeglab2021.0\plugins\Fieldtrip-lite20210601\template\atlas\aal\ROI_MNI_V4.nii');</span><br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
    cfg.atlas        = aal;
<div>    cfg.roi          = aal.tissuelabel;</div>
    cfg.avgoverroi   = 'yes';<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
However,  the statP200 variable returned by the <span style="background-color:rgb(255, 255, 255);display:inline !important">ft_sourcestatistics did not contain any kind of information about differences over ROIs. Even if I try to specify some ROIs in the cfg.roi,
 it does not change anything in the results</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">Hope I now provided more details!</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important"><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">Thanks</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="background-color:rgb(255, 255, 255);display:inline !important">Paolo </span></div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Da:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> per conto di Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip@science.ru.nl><br>
<b>Inviato:</b> lunedì 13 giugno 2022 10:14<br>
<b>A:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Cc:</b> Schoffelen, J.M. (Jan Mathijs) <janmathijs.schoffelen@donders.ru.nl><br>
<b>Oggetto:</b> Re: [FieldTrip] ft_sourcestatistics on restricted regions of interest</font>
<div> </div>
</div>
<div class="" style="word-wrap:break-word; line-break:after-white-space">Ciao Paolo,
<div class=""><br class="">
</div>
<div class="">Can you please expand a little bit? From the formulation of your question I get the impression that you already tried out a few things, but probably you ran into problems. At this point, it is a bit random guessing to the readership as to in which
 direction the for you optimal answer would go.</div>
<div class=""><br class="">
</div>
<div class="">So, some details as to what you have tried in terms of cfg, data objects etc. would be helpful.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 13 Jun 2022, at 09:44, Paolo PRESTI via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:</div>
<br class="x_Apple-interchange-newline">
<div class="">
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Hi all,</div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
I want to perform some statistical comparisons between ROIs using the function ft_sourcestatistics. I see that one can specify the cfg.atlas and cfg.roi fields to restrict the analysis on specific ROIs. However, I am not sure that such a configuration has been
 already implemented. </div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Does anyone know if this function actually permits performing such an analysis? Does exist an alternative way?</div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<br class="">
</div>
<div class="x_elementToProof" style="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; text-decoration:none; font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Thanks,</div>
<div class="" style="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; text-decoration:none">
<div class="x_elementToProof" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
Paolo</div>
<div id="x_Signature" class="">
<div class="">
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<div class="" style="color:rgb(34,34,34); font-family:Arial,Helvetica,sans-serif; font-size:small; text-align:start; background-color:rgb(255,255,255)">
<span class="" style="font-family:monospace; font-size:9pt; background-color:rgba(0,0,0,0)">Paolo Presti, PhD Student</span></div>
<div class="" style="color:rgb(34,34,34); font-family:Arial,Helvetica,sans-serif; font-size:small; text-align:start; background-color:rgb(255,255,255)">
<font face="monospace" class=""><span class="" style="font-family:monospace; font-size:9pt; background-color:rgba(0,0,0,0)">Department of Medicine and Surgery, Unit of Neuroscience</span></font></div>
<div class="" style="color:rgb(34,34,34); font-family:Arial,Helvetica,sans-serif; font-size:small; text-align:start; background-color:rgb(255,255,255)">
<font face="monospace" class=""><span class="" style="font-family:monospace; font-size:9pt; background-color:rgba(0,0,0,0)">Via Volturno 39/E, 43125</span></font></div>
<div class="" style="color:rgb(34,34,34); font-family:Arial,Helvetica,sans-serif; font-size:small; text-align:start; background-color:rgb(255,255,255)">
<font face="monospace" class=""><span class="" style="font-family:monospace; font-size:9pt; background-color:rgba(0,0,0,0)">Parma</span></font></div>
<br class="">
</div>
<div class="" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt">
<span id="x_cid:cf2c31f8-f8b4-4879-a588-b37d6f557c89"><Outlook-5v4ksszb.jpg></span><br class="">
</div>
</div>
</div>
</div>
<div class="" style="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; text-decoration:none">
<br class="">
Firma il tuo 5xmille all’Università di Parma, aiutaci a essere sempre più accoglienti e inclusivi verso le nostre studentesse e i nostri studenti - Indica 00308780345 nella tua denuncia dei redditi.</div>
<span class="" style="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; text-decoration:none; float:none; display:inline!important">_______________________________________________</span><br class="" style="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; text-decoration:none">
<span class="" style="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; text-decoration:none; float:none; display:inline!important">fieldtrip
 mailing list</span><br class="" style="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; text-decoration:none">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmailman.science.ru.nl%2Fmailman%2Flistinfo%2Ffieldtrip&data=05%7C01%7Cpaolo.presti%40unipr.it%7Cc481d8194dab43075ebb08da4d15edcd%7Cbb064bc5b7a841ecbabed7beb3faeb1c%7C0%7C0%7C637907053831077986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=Fjjahtuq%2FfAs%2FGnU%2FOAN3d%2BHhOGuV4Q%2FuD%2Bk%2F7pZ3VE%3D&reserved=0" originalsrc="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" shash="ZUA8euCbEYWSdZshSCd1zeLroUqHQBjBY8OpX/YzcOeiJkBrlBhLVv4Kin27KERqWjDMbyYgvNdQZKB6B2vwh40eMBekmFxrhTiPKijS4Z3PMvyGc872ouGNtS7i24xQWWiqH5dfOGMHtB12yFh56aYlQXRBYkPzy0Ytx5YHD5s=" class="" style="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">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="" style="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; text-decoration:none">
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Furldefense.com%2Fv3%2F__https%3A%2F%2Fdoi.org%2F10.1371%2Fjournal.pcbi.1002202__%3B!!HJOPV4FYYWzcc1jazlU!9FFVtfr7s6PJ7i_gvL_B__SzDuSmLe-MEza_7DIhRW2O1KSNb-MsEj0sa4uHJuBPItfwzpMYYhthjwvDuNDXWGeiUi1EdX3sbDoKSg%24&data=05%7C01%7Cpaolo.presti%40unipr.it%7Cc481d8194dab43075ebb08da4d15edcd%7Cbb064bc5b7a841ecbabed7beb3faeb1c%7C0%7C0%7C637907053831077986%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=i05%2FsHJ2csSoS%2F8HeIZUiKZEtHUWmEJBNNKKhR2Ze1w%3D&reserved=0" originalsrc="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9FFVtfr7s6PJ7i_gvL_B__SzDuSmLe-MEza_7DIhRW2O1KSNb-MsEj0sa4uHJuBPItfwzpMYYhthjwvDuNDXWGeiUi1EdX3sbDoKSg$" shash="lgtvwgkkiHxJjCptRxBTU5I/BTGYrx8MZ0/QrJRX1tDFoLIfTQ/feqsx69X4ukDhsuQUYVROePMXTeGpwNl8uvHTT23D4tgtwatFyD+nORqzkE83lWhhdz0BlrIILLQAMBhkP6ElFeKwVF34oM3PQWngczvQJ1KltopJ1HQsxZs=" class="" style="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">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!9FFVtfr7s6PJ7i_gvL_B__SzDuSmLe-MEza_7DIhRW2O1KSNb-MsEj0sa4uHJuBPItfwzpMYYhthjwvDuNDXWGeiUi1EdX3sbDoKSg$</a><span class="" style="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; text-decoration:none; float:none; display:inline!important"></span></div>
</blockquote>
</div>
<br class="">
</div>
</div>
</body>
</html>