[Mne_analysis] issue with TFCE and permutation_cluster_1samp_test

Eric Larson larson.eric.d at gmail.com
Thu Apr 16 10:11:36 EDT 2020
Search archives:

        External Email - Use Caution        

As a first step, we could do
`np.max(np.abs(tvalues[np.isfinite(tvalues)]))`. Can you try it with your
data? If you could make a PR to implement this it would be great!

Eric


On Thu, Apr 16, 2020 at 8:35 AM Fleur GAUDFERNAU <
fleur.gaudfernau at pasteur.fr> wrote:

>         External Email - Use Caution
>
> Hello,
>
> I encountered a mistake when running permutation_cluster_1samp_test with
> TFCE.
>
> clu = permutation_cluster_1samp_test(X, n_permutations = n_permutations,
>                                             connectivity = connectivity,
>
>                                             threshold=threshold, tail=tails,
>                                             out_type = 'indices')
> => File
> "C:\Users\XX\Anaconda3\lib\site-packages\mne\stats\cluster_level.py", line
> 385, in _find_clusters
>
>     threshold['step'], float)
> ValueError: arange: cannot compute length
>
>
> X is shape (n subjects x n sources). This mistake actually comes from the
> T-value computation. It seems that the activity of some of the sources is 0
> for all subjects, hence creating nans when computing the t value :
>
>   t = np.mean(X, axis=0) / np.sqrt(var / X.shape[0])
>
> with var =[8.09150634e-43 5.30338813e-43 5.90491142e-43 ... 0.00000000e+00
>
> 0.00000000e+00 0.00000000e+00]
>
> Then, in function _find_clusters, mne tries to set the stop limit of TFCE
> as np.max(np.abs(tvalues)), hence generating the error at this line:
> thresholds = np.arange(threshold['start'], stop, threshold['step'], float)
>
> Does anyone has a solution for this issue?
> Thanks in advance,
> Fleur
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200416/091c63c7/attachment.html 


More information about the Mne_analysis mailing list