Closed mjcourte closed 11 months ago
read_info
is really only meant to read FIF info files. You should be able to use
info = mne.io.read_raw_ctf(...).info
instead. If this makes sense would you be up for making a PR to improve the documentation of read_info
to mention that it's designed for FIF info only but you can use code like the above to get info for other file formats?
I confirm that read_info
works with sample_audvis_raw.fif.
I must have had a typo, as after going back to my script, the ctf raw.info appears to do the job.
I'll get to a PR for the read_info docs this afternoon.
@larsoner Why don't we fail early if the filename extension is not .fif?
Checking for .fif
/ .fif.gz
is a good idea. I think check_fname
could do that and emit a warning
Why just a warning and not fail hard?
Technically you can read and write FIF (and many other formats) just fine with no file extension. IIRC for many other functions like read raw fif etc we just emit a warning when you use non standard naming so we should continue that practice
Description of the problem
Hi all,
I have CTF 275 channel .ds, which reads normally with
mne.io.read_raw_ctf()
.When imported, the
raw.info
attribute 'appears' to be a completemne.Info
object, with about 19 keys.However,
mne.io.read_info()
returns error:IsADirectoryError: [Errno 21] Is a directory 'path/to/my/data.ds'
,When, later in script, I run(Edit: this was a typo on my behalf)mne.make_forward_solution()
, which requires anmne.Info
arg, I get the sameIsADirectoryError
while checking the inputs, if I passraw.info
(as opposed to trying aread_info()
earlier).While this is technically correct that the CTF .ds spec is a directory, is this expected behaviour? I don't see any specific docs about doing format conversion for CTF (eg .ds to .fif) to produce an info object.
Thanks, Matt
Steps to reproduce
Link to data
No response
Expected results
mne.io.read_info
of CTF data returns anmne.Info
object, or,raw.info
frommne.io.read_raw_ctf
is interpreted as anmne.Info
objectActual results
Additional information
Windows 11/WSL2/Ubuntu 22.04 (such that FreeSurfer is accessible also within WSL)