You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow for roundtrip between DigMontage.save() and mne.channels.read_dig_fif #12994
Actually, one could already set a montage to an info object, and save the info, and then use the get method to get the montage back. That would preserve channel names ... But it's a bit unclean to recommend doing that, as an info object also needs to be set with a sampling frequency, which may not be applicable if you really only have a montage.
An additional point is that for most fif files we save, we recommend a suffix like raw, ave, or info. However for a dig montage, there is no such recommendation.
Currently, ch_names are not saved, and I don't know which parts of FIF would need to change to allow for this.
I don't think any parts of the FIF spec would need to change, in principle I think you can use write_name_list_sanitized and the corresponding read function
Activity
sappelhoff commentedon Nov 30, 2024
Actually, one could already set a montage to an info object, and save the info, and then use the get method to get the montage back. That would preserve channel names ... But it's a bit unclean to recommend doing that, as an info object also needs to be set with a sampling frequency, which may not be applicable if you really only have a montage.
An additional point is that for most fif files we save, we recommend a suffix like raw, ave, or info. However for a dig montage, there is no such recommendation.
larsoner commentedon Dec 2, 2024
I don't think any parts of the FIF spec would need to change, in principle I think you can use
write_name_list_sanitizedand the corresponding read functionmne-python/mne/_fiff/write.py
Line 152 in 096243f
Similar to how we do here for bads
mne-python/mne/_fiff/meas_info.py
Line 2092 in 096243f
Because you are writing a CH_NAME_LIST, but instead of
"bads"you would have"ch_names".