- MNE-Python version: 0.22.0
- operating system: Ubuntu 20.04.2 LTS
Dear MNE community,
I want to perform ’ mne.stats.spatio_temporal_cluster_1samp_test’ between two groups, each with 33 subjects. Data was preprocessed and a TFR_morlet was conducted to compute the time-frequency representation of my data.
Then I saved the dfh5 files in two different arrays (according to group), and now I want to subtract one array from another, to obtain a contrast-array ‘X’ as input for my ‘mne.stats.spatio_temporal_cluster_1samp_test’ function.
When I subtract them ( X = X_OGT_ogt - X_OGT_low ) I got the following error:
runcell(4, '/home/.../4._Spatial_Temporal_Cluster_Perm.py')
Traceback (most recent call last):
File "/home/.../4._Spatial_Temporal_Cluster_Perm.py", line 63, in <module>
X = X_OGT_ogt - X_OGT_low
File "/home/bruno/anaconda3/envs/mne/lib/python3.8/site-packages/mne/time_frequency/tfr.py", line 1950, in __sub__
out.data -= tfr.data
ValueError: operands could not be broadcast together with shapes (62,46,3401) (64,46,3401) (62,46,3401)
So, apparently some of my tfr files have a different number of channels (62 or 64). I don’t know what could have caused this… Maybe something during the preprocessing.
I tried to subtract data from just two subjects at a time in order to find the subjects with distict numbers of channels:
X = []
for i in range(33):
try:
X.append(X_OGT_ogt[i] - X_OGT_low[i])
except:
print(i)
Output:
runcell(6, '/home/.../4._Spatial_Temporal_Cluster_Perm.py')
0
1
5
8
9
10
17
22
23
26
28
So 11 pairs out of 33 could not be subtracted.
Does anyone know how to solve this problem? I would really appreciate any help.
Best,
Bruno