How to realign the CTF MEG runs to a common head position using maxwell_filter?

@Clemens here is a quick hack using MNE internal functions that could help you

# %%
import mne

raw = mne.io.read_raw_ctf('S01_G15BNU_20220405_01.ds')

# %%

info_from = raw.copy().pick('meg').info
info_to = raw.copy().pick('meg').info
map = mne.forward._map_meg_or_eeg_channels(
    info_from, info_to, mode='fast', origin=(0., 0., 0.04))

map.shape

# %%
data = raw.get_data(picks='meg')
data_new_pos = map @ data

big disclaimer it’s not tested…

but it could be a start of a PR to make such a feature part of the public API without relying on maxfilter

Alex

3 Likes