Platform: Windows-10-10.0.22621-SP0
Python: 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)]
mne: 1.3.1
Problem initially posted on the Brainstorm forum:
I could reproduce the error on my end with an example dataset provided by the user.
I confirmed that the problem is not coming too obviously from Brainstorm in the creation of the RawArray
object to be passed to maxwell_filter
, as I can all other MNE methods on it.
Example dataset to reproduce the error (zipped pickle - first 10s of the Yokogawa .con file shared by the user):
Code:
import pickle
import mne
filehandler = open('pyRaw10s.pickle', 'rb')
raw = pickle.load(filehandler)
filehandler.close()
mne.preprocessing.maxwell_filter(raw, int_order=8, ext_order=3, origin='auto', coord_frame='head', regularize='in', ignore_ref=False, st_duration=10, st_correlation=0.98, st_fixed=True, st_only=False, mag_scale=100, skip_by_annotation=['edge','bad_acq_skip'])
Output (same error as from Brainstorm):
>>> mne.preprocessing.maxwell_filter(raw, int_order=8, ext_order=3, origin='auto', coord_frame='head', regularize='in', ignore_ref=False, st_duration=10, st_correlation=0.98, st_fixed=True, st_only=False, mag_scale=100, skip_by_annotation=['edge','bad_acq_skip'])
Maxwell filtering raw data
No bad MEG channels
Processing 0 gradiometers and 128 magnetometers (of which 125 are actually KIT gradiometers)
<stdin>:1: RuntimeWarning: Only 5 head digitization points of the specified kind ("extra",), fitting may be inaccurate
<stdin>:1: RuntimeWarning: (X, Y) fit (-7.9, 42.7) more than 20 mm from head frame origin
Automatic origin fit: head of radius 73.8 mm
Using origin -7.9, 42.7, 5.3 mm in the head frame
Processing data using tSSS with st_duration=10.0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<decorator-gen-457>", line 12, in maxwell_filter
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\preprocessing\maxwell.py", line 353, in maxwell_filter
raw_sss = _run_maxwell_filter(raw, **params)
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\preprocessing\maxwell.py", line 555, in _run_maxwell_filter
_get_this_decomp_trans(info['dev_head_t'], t=0.)
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\preprocessing\maxwell.py", line 1012, in _get_decomp
S_decomp, reg_moments, n_use_in = _regularize(
File "<decorator-gen-460>", line 12, in _regularize
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\preprocessing\maxwell.py", line 1066, in _regularize
in_removes, out_removes = _regularize_in(
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\preprocessing\maxwell.py", line 1947, in _regularize_in
u, s, v = _safe_svd(this_S, full_matrices=False, **check_disable)
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\mne\fixes.py", line 84, in _safe_svd
return linalg.svd(A, **kwargs)
File "C:\Users\franc\AppData\Local\Programs\Python\Python310\lib\site-packages\scipy\linalg\_decomp_svd.py", line 133, in svd
raise ValueError('illegal value in %dth argument of internal gesdd'
ValueError: illegal value in 4th argument of internal gesdd
Is the problem in the creation of the RawArray
object in Brainstorm, or in MNE?