Accessing EDF header info

Hi,

I am using pyEDFwriter to generate an EDF file. This is then loaded in another python script using mne.io.read_raw_edf.

        self.raw = mne.io.read_raw_edf(file, preload=True)

        print(self.raw.info)
        print(self.raw.info["subject_info"])

        print(self.raw.info["chs"][0])
        print(self.raw.info["device_info"])

The data contained in “info” does not seem to include technician and equipment, although these were recorded in the EDF file (using pyedflib.EdfWriter.setTechnician and simlar for equipment and additional recording information).
Is there a way to access this data from MNE?

info[“device_info”] (the last line in the code above) returns None.

I am running MNE 1.8.0 on Python 3.11.0, Windows 10/VS Code.

No, MNE does not expose these format-specific fields. Some custom header fields are available in raw._raw_extras, but (1) this is a private attribute which can change with every new release and (2) for whatever reason the “technician” field is not exposed for EDF (only for GDF) as far as I can tell.

If you need these header fields, consider using edfio to read your EDF files (or just the header fields).

1 Like