Skip to content

[BUG] Coordinate Frame not Saved #9635

@alexrockhill

Description

@alexrockhill

I'm not sure if I'm missing something obvious but it looks like the coordinate frame doesn't survive the round trip to and from disk. I'm not sure why that is.

import numpy as np
import mne

for ch_type in ('eeg', 'seeg', 'ecog', 'dbs'):
    raw = mne.io.RawArray(
        np.random.random((10, 1000)),
        mne.create_info([f'ch{i}' for i in range(1, 11)],  1000, [ch_type] * 10))
    montage = mne.channels.make_dig_montage(
        {ch: np.random.random((3,)) for ch in raw.ch_names}, lpa=[1, 0, 0], nasion=[0, 0.1, 0], rpa=[-1, 0, 0],
        coord_frame='mri')
    raw.set_montage(montage)
    raw.save('tmp-raw.fif', overwrite=True, verbose=False)
    print(ch_type)
    print('Before: ', raw.info['chs'][0]['coord_frame'])
    info = mne.io.read_info('tmp-raw.fif')
    print('After : ', info['chs'][0]['coord_frame'])

Note, it appears this is specific to seeg, ecog and dbs, it works for eeg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions