<div dir="ltr">Hi there,<div><br></div><div>I just wanted to follow up and note that cluster-statistics are certainly implemented for source-level reconstructed data (as a pointer to start, see: <a href="http://www.fieldtriptoolbox.org/example/source_statistics">http://www.fieldtriptoolbox.org/example/source_statistics</a>)</div><div>I strongly suggest to use the functionality as intended in which most of the typical user cases should be supported.</div><div><br></div><div>Best wishes,</div><div>Stephen </div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 15 January 2018 at 22:04, Vahab Yousofzadeh <span dir="ltr"><<a href="mailto:bioeng.yoosofzadeh@gmail.com" target="_blank">bioeng.yoosofzadeh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear Vincent,<br>
<br>
For cluster correction at source space, you would need to trick the<br>
ft_prepare_neighbours because (as far as I know) it only works with<br>
sensor-space data - so you just need to update the pos. with those<br>
from the source model. Here's a piece of scripts:<br>
<br>
s = timePost; % timePost is the output of ft_timelockanalysis.<br>
s.grad.chanpos = headmodel_time.pos(headmodel_<wbr>time.inside,:);<br>
s.grad.chanori = s.grad.chanpos;<br>
s.grad.chanunit(1:size(s.grad.<wbr>chanpos,1)) = s.grad.chanunit(1);<br>
s.grad.chantype(1:size(s.grad.<wbr>chanpos,1)) = s.grad.chantype(1);<br>
s.grad.tra    = ones(size(s.grad.chanpos,1),<wbr>size(s.grad.tra,2));<br>
for i=1:size(s.grad.chanpos,1)<br>
    s.grad.label{i} = num2str(i);<br>
    s.label{i} = num2str(i);<br>
    s.grad.labelold =  num2str(i);<br>
end<br>
% prepare_neighbours determines what sensors may form clusters<br>
cfg_neighb.method   = 'distance';<br>
% cfg.method      = 'triangulation';<br>
neighbours          = ft_prepare_neighbours(cfg_<wbr>neighb, s);<br>
<br>
%% inspecting random neighbours (#1200)<br>
neighbours2 = [];<br>
neighbours2 = neighbours(1200);<br>
% neighbours2.neighblabel = neighbours2.neighblabel(1:20);<br>
% plotting neighbours for inspection<br>
cfg            = [];<br>
cfg.neighbours = neighbours2;<br>
ft_neighbourplot_source(cfg, s);<br>
<br>
Now for cluster-correction, you need to have your source trials as<br>
inputs, and do something like:<br>
<br>
%% Cluster-correction<br>
cfg = [];<br>
cfg.parameter        = 'pow';<br>
cfg.dim              = sourcemodel.dim;<br>
cfg.method           = 'montecarlo';<br>
% cfg.statistic        = 'ft_statfun_depsamplesT';<br>
cfg.statistic        = 'depsamplesT';<br>
% cfg.statistic         = 'indepsamplesT';<br>
cfg.correctm         = 'cluster';<br>
% cfg.correctm         = 'fdr';<br>
cfg.clusteralpha     = 0.01;<br>
cfg.clusterstatistic = 'max';<br>
% cfg.correcttail = 'prob';<br>
cfg.tail             = 0;<br>
cfg.clustertail      = 0;<br>
cfg.alpha            = 0.05;<br>
cfg.numrandomization = 5000;<br>
cfg.neighbours      = ft_prepare_neighbours(cfg_<wbr>neighb, s);<br>
<br>
ntrials                       = L;<br>
design                        = zeros(2,2*ntrials);<br>
design(1,1:ntrials)           = 1;<br>
design(1,ntrials+1:2*ntrials) = 2;<br>
design(2,1:ntrials)           = 1:ntrials;<br>
design(2,ntrials+1:2*ntrials) = 1:ntrials;<br>
<br>
cfg.design   = design;<br>
cfg.ivar     = 1;<br>
cfg.uvar     = 2;<br>
stat         = ft_sourcestatistics(cfg,<wbr>Source1,Source2);<br>
stat.pos     = souremodel.pos;% keep positions for plotting later<br>
<br>
and for plotting stats,<br>
<br>
cfg              = [];<br>
cfg.voxelcoord   = 'no';<br>
cfg.parameter    = 'stat';<br>
% cfg.interpmethod = 'nearest';<br>
cfg.interpmethod = 'sphere_avg';<br>
statint  = ft_sourceinterpolate(cfg, stat, template_mri);<br>
cfg.parameter    = 'mask';<br>
maskint  = ft_sourceinterpolate(cfg, stat, template_mri);<br>
<br>
statint.mask = maskint.mask;<br>
<br>
atlas = ft_read_atlas('ROI_MNI_V4.nii'<wbr>);<br>
<br>
statint.coordsys  = 'mni';<br>
cfg               = [];<br>
cfg.method        = 'ortho';<br>
% cfg.method = 'slice';<br>
cfg.funparameter  = 'stat';<br>
cfg.maskparameter = 'mask';<br>
cfg.atlas         = atlas;<br>
cfg.location      = 'max';<br>
% cfg.funcolorlim   = [-5 5];<br>
cfg.funcolormap   = 'jet';<br>
% cfg.location = [x,y,z];<br>
ft_sourceplot(cfg,statint);<br>
<br>
Hope this helps, and let me know if you are running into issues.<br>
<br>
Cheers,<br>
Vahab<br>
<br>
On Wed, Jan 10, 2018 at 9:55 AM,  <<a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.<wbr>nl</a>> wrote:<br>
> Send fieldtrip mailing list submissions to<br>
>         <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
><br>
> To subscribe or unsubscribe via the World Wide Web, visit<br>
>         <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
> or, via email, send a message with subject or body 'help' to<br>
>         <a href="mailto:fieldtrip-request@science.ru.nl">fieldtrip-request@science.ru.<wbr>nl</a><br>
><br>
> You can reach the person managing the list at<br>
>         <a href="mailto:fieldtrip-owner@science.ru.nl">fieldtrip-owner@science.ru.nl</a><br>
><br>
> When replying, please edit your Subject line so it is more specific<br>
> than "Re: Contents of fieldtrip digest..."<br>
><br>
><br>
> Today's Topics:<br>
><br>
>    1. 2nd International LSL Workshop (27.9-28.9.2018) - Save    the<br>
>       Date (Martin Bleichner)<br>
>    2. Re: question on cluster-based statistics and source<br>
>       localization (Robert Oostenveld)<br>
><br>
><br>
> ------------------------------<wbr>------------------------------<wbr>----------<br>
><br>
> Message: 1<br>
> Date: Wed, 10 Jan 2018 15:39:55 +0100<br>
> From: Martin Bleichner <<a href="mailto:martin.bleichner@uni-oldenburg.de">martin.bleichner@uni-<wbr>oldenburg.de</a>><br>
> To: <a href="mailto:lsl-l@mailman.ucsd.edu">lsl-l@mailman.ucsd.edu</a>, <a href="mailto:eeglablist@sccn.ucsd.edu">eeglablist@sccn.ucsd.edu</a>,<br>
>         <a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a><br>
> Subject: [FieldTrip] 2nd International LSL Workshop (27.9-28.9.2018) -<br>
>         Save    the Date<br>
> Message-ID: <<a href="mailto:27e861b5-5224-61c5-d02c-3b70140acba2@uni-oldenburg.de">27e861b5-5224-61c5-d02c-<wbr>3b70140acba2@uni-oldenburg.de</a>><br>
> Content-Type: text/plain; charset="utf-8"; Format="flowed"<br>
><br>
> Dear colleagues,<br>
><br>
> We are happy to announce the second international Lab Streaming Layer<br>
> (LSL) workshop, which will take place September 27 - 28, 2018, at the<br>
> Hanse Wissenschaftskolleg, in Delmenhorst, Germany. LSL is an<br>
> open-source project enabling the synchronized streaming of time series<br>
> data coming from different devices, such as EEG amplifiers, audio,<br>
> video, eye tracking, keyboards, etc. LSL features near real-time access<br>
> to data streams, time-synchronization, networking and centralized<br>
> collection (<a href="https://github.com/sccn/labstreaminglayer" rel="noreferrer" target="_blank">https://github.com/sccn/<wbr>labstreaminglayer</a>).<br>
><br>
> Key LSL developers and expert users have confirmed attendance. The<br>
> workshop will provide a general introduction to LSL. We will present how<br>
> LSL can be used for a multitude of different experimental setups, using<br>
> a variety of experimental software, hardware and?operating systems. In a<br>
> hands-on session, participants can learn to stream data from their own<br>
> hardware or play with hardware provided by us and external partners. We<br>
> will name pitfalls and discuss how to test and ensure the best possible<br>
> timing accuracy when recording multimodal data. We will also provide a<br>
> best practice guide and present different use cases of LSL. We will also<br>
> use the workshop to discuss future software and hardware developments.<br>
><br>
> Participants are invited to contribute to the workshop by presenting<br>
> their LSL use cases.<br>
><br>
> More information on the workshop will follow soon. For further<br>
> enquiries, please contact: <a href="mailto:martin.bleichner@uol.de">martin.bleichner@uol.de</a><br>
> <mailto:<a href="mailto:martin.bleichner@uol.de">martin.bleichner@uol.<wbr>de</a>><br>
><br>
> Best,<br>
><br>
> Martin Bleichner<br>
><br>
> --<br>
> Dr. Martin Bleichner<br>
> Neuropsychology    Lab<br>
> Department of Psychology<br>
> University of Oldenburg<br>
> D-26111 Oldenburg<br>
> Germany<br>
><br>
> <a href="mailto:martin.bleichner@uni-oldenburg.de">martin.bleichner@uni-<wbr>oldenburg.de</a><br>
> Tel.: <a href="tel:%2B49%20%280%29441%20-%20798-2940" value="+494417982940">+49 (0)441 - 798-2940</a><br>
> <a href="http://www.uni-oldenburg.de/psychologie/neuropsychologie/team/martin-bleichner/" rel="noreferrer" target="_blank">http://www.uni-oldenburg.de/<wbr>psychologie/neuropsychologie/<wbr>team/martin-bleichner/</a><br>
><br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180110/71ab956b/attachment-0001.html" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/<wbr>pipermail/fieldtrip/<wbr>attachments/20180110/71ab956b/<wbr>attachment-0001.html</a>><br>
><br>
> ------------------------------<br>
><br>
> Message: 2<br>
> Date: Wed, 10 Jan 2018 15:55:57 +0100<br>
> From: Robert Oostenveld <<a href="mailto:r.oostenveld@donders.ru.nl">r.oostenveld@donders.ru.nl</a>><br>
> To: FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
> Cc: Vincent Wens <<a href="mailto:vwens@ulb.ac.be">vwens@ulb.ac.be</a>><br>
> Subject: Re: [FieldTrip] question on cluster-based statistics and<br>
>         source  localization<br>
> Message-ID: <<a href="mailto:E1AC378D-E513-472B-A443-6E1439FE0A50@donders.ru.nl">E1AC378D-E513-472B-A443-<wbr>6E1439FE0A50@donders.ru.nl</a>><br>
> Content-Type: text/plain; charset="utf-8"<br>
><br>
> Hi Vincent,<br>
><br>
> Let me reply through the email list, where other people might learn something and/or want to chime in.<br>
><br>
>> On 10 Jan 2018, at 13:22, Vincent Wens <<a href="mailto:vwens@ulb.ac.be">vwens@ulb.ac.be</a>> wrote:<br>
>><br>
>> Dear Pr. Oostenveld,<br>
>><br>
>> I am Vincent Wens, a physicist working in the MEG unit at Erasme Hospital, Brussels. We've been recently trying to play with the cluster-based statistics that you developed and included in Fieldtrip, but hit a difficulty in our analysis pipeline and I wondered if you would be so kind to take a few minutes and provide advice on this?<br>
><br>
> The cluster-based statistics is a method for statistical inference, i.e. statistical decision making based on a hypothesis and estimated probability distribution. The hypothesis H0 states that the data can be exchanged (between conditions). If it is very unlikely that the data can be exchanged (under H0), we decide that the data must be different somehow. The clusters provide evidence for the data being different, but the clusters are not the difference itself. The tip of an iceberg above the sea level provides evidence for there being an iceberg, but the tip is not the iceberg itself.<br>
><br>
> An important FAQ is this <a href="http://www.fieldtriptoolbox.org/faq/how_not_to_interpret_results_from_a_cluster-based_permutation_test" rel="noreferrer" target="_blank">http://www.fieldtriptoolbox.<wbr>org/faq/how_not_to_interpret_<wbr>results_from_a_cluster-based_<wbr>permutation_test</a><br>
><br>
> Let me give the other commens in-line in your email below<br>
><br>
>> Globally, my question is how to go from sensor-level cluster statistics results to the source space.<br>
>><br>
>> More precisely: Assume we run the cluster statistics analysis on, say, N-channels time-frequency plots and obtain significance for the maximum cluster statistic.<br>
><br>
> So you obtain evidence that the channel level data is different. That logically implies that the cortical activity is different. Note that the other way arround would not hold per see; there can be different activity in the brain without it showing up as a difference in the scalp data.<br>
><br>
>> We thus find one (and possibly more) supra-threshold cluster(s) whose "spatio-spectral-temporal localization" can be assessed.<br>
><br>
> You could look at the visible tip (i.e. the cluster), you could also take a broader approach and look at the phenomenom under the tip (the iceberg).<br>
><br>
>> See for example the attached picture depicting the plot of those T-values within the significant cluster associated with an ERD. The next step would then be to source localize this,<br>
><br>
> You would not localize the cluster (you already have it, it is at the channel level). You localize the cortical activity that causes the data to appear different at the channel level. It?s the part of the iceberg under the sea level that causes the tip to appear above sea level.<br>
><br>
>> and our initial idea was to use the time and frequency region from this cluster as a prior on the time and frequency used for source projection. However the very complex shape of the cluster does not make this step so obvious. There are multiple possibilities that would come to mind, most of them absolutely ad-hoc, so I wondered your opinion on what would be the most rigorous, or at least least unacceptable way to go (or even just the most standard way, if there's one).<br>
><br>
> Based on the resulls (the multiplot), you should wonder whether there is only a single feature in the brain that is different or whether there are multiple. The hypothesis you started with was ?is there any difference in this massive multiple-comparision space?? and the (only) answer you got to that question was ?yes?.<br>
><br>
> You now have the question ?what is the difference?, which pertains to interpreting the data. That question has no binary answer and a statistical test based of a p-value being small enough (which gives you a "yes/no" answer) does not help.<br>
><br>
> I cannot offer specific advice on how to interpret your data, but recommend that you consider whether your true quest is for ?the (one and only) effect? or ?the effects? that causes the data in the two conditions to be different. Of course you can argue that the effect(s) show at certain frequency ranges and/or latencies and/or locations, and therefore you may decide to look for the interpretation of the effect(s) at or around those parts of the cluster.<br>
><br>
> In general (not any more for this dataset) it is worthwile to consider that narrow a-priori hypotheses provide more valuable and specific information. This is something that we often rely on in sequential studies, where in the 2nd study we don?t repeat the full hypothesis of the 1st study (e.g. ?is there any difference?), but a more specific sub-hypothesis that we generated on basis of the first study (e.g. is there a difference around this specific time-frequency range).<br>
><br>
>> Thanks in advance for your invaluable help, and still my best wishes for the New Year.<br>
><br>
> You?re welcome. Please follow up questions on the email discussion list.<br>
><br>
> best regards,<br>
> Robert<br>
><br>
><br>
> -------------- next part --------------<br>
> An HTML attachment was scrubbed...<br>
> URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180110/dedffb0b/attachment.html" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/<wbr>pipermail/fieldtrip/<wbr>attachments/20180110/dedffb0b/<wbr>attachment.html</a>><br>
> -------------- next part --------------<br>
> A non-text attachment was scrubbed...<br>
> Name: cluster_1_grad.png<br>
> Type: image/png<br>
> Size: 191076 bytes<br>
> Desc: not available<br>
> URL: <<a href="http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20180110/dedffb0b/attachment.png" rel="noreferrer" target="_blank">http://mailman.science.ru.nl/<wbr>pipermail/fieldtrip/<wbr>attachments/20180110/dedffb0b/<wbr>attachment.png</a>><br>
><br>
> ------------------------------<br>
><br>
> ______________________________<wbr>_________________<br>
> fieldtrip mailing list<br>
> <a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
> <a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
><br>
> End of fieldtrip Digest, Vol 86, Issue 6<br>
> ******************************<wbr>**********<br>
<br>
______________________________<wbr>_________________<br>
fieldtrip mailing list<br>
<a href="mailto:fieldtrip@donders.ru.nl">fieldtrip@donders.ru.nl</a><br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/<wbr>mailman/listinfo/fieldtrip</a><br>
</blockquote></div><br></div>