<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr"><p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;"> External Email - Use Caution </span></p><p></p>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, "EmojiFont", "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Hello,</p>
<p>I encountered a mistake when running <span>permutation_cluster_1samp_test</span> with TFCE.</p>
<p></p>
<div>clu = permutation_cluster_1samp_test(X, n_permutations = n_permutations,<br>
<div> connectivity = connectivity,<br>
threshold=threshold, tail=tails,<br>
out_type = 'indices')</div>
</div>
=><span style="color:rgb(255,0,0)"> File "C:\Users\XX\Anaconda3\lib\site-packages\mne\stats\cluster_level.py", line 385, in _find_clusters</span><br>
<p></p>
<p></p>
<div><span style="color:rgb(255,0,0)"> threshold['step'], float)</span><br>
<span style="color:rgb(255,0,0)">ValueError: arange: cannot compute length</span></div>
<p></p>
<p><br>
</p>
<p>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 :</p>
<p><span> t = np.mean(X, axis=0) / np.sqrt(var / X.shape[0])</span></p>
<p>with var =[8.09150634e-43 5.30338813e-43 5.90491142e-43 ... 0.00000000e+00<br>
</p>
<p></p>
<div>0.00000000e+00 0.00000000e+00]</div>
<div><br>
</div>
<div>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:<br>
</div>
<div>thresholds = np.arange(threshold['start'], stop, threshold['step'], float)</div>
<div><br>
</div>
<div>Does anyone has a solution for this issue?</div>
<div>Thanks in advance,</div>
<div>Fleur<br>
</div>
<p></p>
</div>
</body>
</html>