From fb8804f1742ca0fad63fb3f12f05685f8e84eda2 Mon Sep 17 00:00:00 2001 From: Antoine Collas Date: Mon, 6 Jan 2025 16:59:27 +0100 Subject: [PATCH] use self.info instead of old_info --- mne/channels/channels.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/mne/channels/channels.py b/mne/channels/channels.py index 96a94e29000..be6bc772795 100644 --- a/mne/channels/channels.py +++ b/mne/channels/channels.py @@ -1007,13 +1007,6 @@ def interpolate_to(self, montage, method="spline", reg=0.0): new_info = create_info(ch_names=target_ch_names, sfreq=sfreq, ch_types=ch_types) new_info.set_montage(montage) - # Create a simple old_info - sfreq = self.info["sfreq"] - ch_names = self.info["ch_names"] - ch_types = ["eeg"] * len(ch_names) - old_info = create_info(ch_names=ch_names, sfreq=sfreq, ch_types=ch_types) - old_info.set_montage(self.info.get_montage()) - # Compute mapping from current montage to target montage if method == "spline": pos_from = np.array( @@ -1023,7 +1016,7 @@ def interpolate_to(self, montage, method="spline", reg=0.0): mapping = _make_interpolation_matrix(pos_from, pos_to, alpha=reg) elif method == "MNE": mapping = _map_meg_or_eeg_channels( - old_info, new_info, mode="accurate", origin="auto" + self.info, new_info, mode="accurate", origin="auto" ) # Apply the interpolation mapping