Hi everyone,
I learned a lot browsing the forum! Thx for that!
Unfortunately I have some unresolved problems, I hope I can describe it well:
First of all: I’m currently unsing MNE version 0.24.1 and am operating on Windows 10 with Spyder and Python 3.9.7.
When trying to interpolate bad channels with raw.interpolate_bads (or evoked.interpolate_bads) i get the ValueError
array must not contain infs or NaNs
with the following traceback:
Traceback (most recent call last):
File “C:\Users\AUDIOM~1\AppData\Local\Temp/ipykernel_1548/1984669639.py”, line 1, in
raw_interp = raw_chosen.copy().load_data().interpolate_bads(reset_bads=False)File “”, line 24, in interpolate_bads
File “C:\ProgramData\Anaconda3\lib\site-packages\mne\channels\channels.py”, line 1183, in interpolate_bads
_interpolate_bads_eeg(self, origin=origin, exclude=exclude)File “”, line 24, in _interpolate_bads_eeg
File “C:\ProgramData\Anaconda3\lib\site-packages\mne\channels\interpolation.py”, line 159, in _interpolate_bads_eeg
interpolation = _make_interpolation_matrix(pos_good, pos_bad)File “C:\ProgramData\Anaconda3\lib\site-packages\mne\channels\interpolation.py”, line 108, in _make_interpolation_matrix
C_inv = linalg.pinv(C)File “C:\ProgramData\Anaconda3\lib\site-packages\scipy\linalg\basic.py”, line 1315, in pinv
a = _asarray_validated(a, check_finite=check_finite)File “C:\ProgramData\Anaconda3\lib\site-packages\scipy_lib_util.py”, line 293, in _asarray_validated
a = toarray(a)File “C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\function_base.py”, line 488, in asarray_chkfinite
raise ValueError(
I think it has something to do with setting the montage to the standard_1020 but one channel not matching. The raised warning says:
RuntimeWarning: DigMontage is only a subset of info. There are 1 channel position not present in the DigMontage. The required channels are:
[‘IO’].
Consider using inst.set_channel_types if these are not EEG channels, or use the on_missing parameter if the channel positions are allowed to be unknown in your analyses.
(wich is totally fine until i want to interpolate the bad channels )
Unfortuantely when I don’t set the montage I also get an error from the interpolation function:
Cannot fit headshape without digitization , info[“dig”] is None
I think my question is: Is the montage really the problem here and (if yes) is there some kind of workaround for this? Maybe setting the position for the IO-channel (wich is the reference channel) manually?
Kind regards,
Leoni