Skip to content

Commit

Permalink
use self.info instead of old_info
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinecollas committed Jan 6, 2025
1 parent a249321 commit fb8804f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions mne/channels/channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand Down

0 comments on commit fb8804f

Please sign in to comment.