@Clemens - Does your dataset have a headshape?
I think the error is related to an auxilliary function - fit_sphere_to_headshape - and if there is no headshape, you get the “Only 0 head digitization points …”
Here is the error I get with a CTF dataset and no headshape:
mne.preprocessing.maxwell_filter(raw)
Maxwell filtering raw data
No bad MEG channels
Processing 0 gradiometers and 299 magnetometers (of which 290 are actually KIT gradiometers)
Traceback (most recent call last):
File "<ipython-input-35-980e5af9fd01>", line 1, in <module>
mne.preprocessing.maxwell_filter(raw)
File "<decorator-gen-410>", line 24, in maxwell_filter
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/preprocessing/maxwell.py", line 214, in maxwell_filter
skip_by_annotation=skip_by_annotation, extended_proj=extended_proj)
File "<decorator-gen-411>", line 24, in _prep_maxwell_filter
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/preprocessing/maxwell.py", line 312, in _prep_maxwell_filter
origin = _check_origin(origin, info, coord_frame, disp=True)
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/bem.py", line 996, in _check_origin
units='m')[:2]
File "<decorator-gen-60>", line 22, in fit_sphere_to_headshape
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/bem.py", line 850, in fit_sphere_to_headshape
info, dig_kinds)
File "<decorator-gen-62>", line 24, in _fit_sphere_to_headshape
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/bem.py", line 933, in _fit_sphere_to_headshape
hsp = get_fitting_dig(info, dig_kinds)
File "<decorator-gen-61>", line 24, in get_fitting_dig
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/bem.py", line 896, in get_fitting_dig
return get_fitting_dig(info, ('extra', 'eeg'))
File "<decorator-gen-61>", line 24, in get_fitting_dig
File "/home/jstout/miniconda3/envs/test5/lib/python3.7/site-packages/mne/bem.py", line 924, in get_fitting_dig
raise ValueError(msg + ', at least 4 required')
ValueError: Only 2 head digitization points of the specified kinds ("eeg", "extra",), at least 4 required
This is in the documentation:
origin : array-like, shape (3,) | str
Origin of internal and external multipolar moment space in meters.
The default is ``'auto'``, which means ``(0., 0., 0.)`` when
``coord_frame='meg'``, and a head-digitization-based
origin fit using :func:`~mne.bem.fit_sphere_to_headshape`
when ``coord_frame='head'``. If automatic fitting fails (e.g., due
to having too few digitization points),
consider separately calling the fitting function with different
options or specifying the origin manually.
If you manually assign the origin - it works - I don’t know what an appropriate origin would be, but 0,0,0 sounds like it should be good.:
raw_sss = mne.preprocessing.maxwell_filter(
raw,
origin=(0,0,0),
coord_frame='head',
destination=dev_head_t_ref
)
Maxwell filtering raw data
No bad MEG channels
Processing 0 gradiometers and 299 magnetometers (of which 290 are actually KIT gradiometers)
Using origin 0.0, 0.0, 0.0 mm in the head frame
Using 63/95 harmonic components for 0.000 (48/80 in, 15/15 out)
Using loaded raw data
Processing 45 data chunks
[done]