Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
76f322c
FIX: correct spacing attribute in SourceMorph when src_to is provided
Famous077 Feb 25, 2026
b1ca08a
FIX: correct spacing attribute in SourceMorph when src_to is provided
Famous077 Feb 26, 2026
a21f2c2
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Feb 26, 2026
1fd056b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Feb 26, 2026
3dd17f0
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Feb 27, 2026
2518e6b
DOC: fix changelog filename to match PR number and fix contributor name
Famous077 Mar 5, 2026
4121abd
DOC: remove incorrectly named changelog file
Famous077 Mar 5, 2026
8ddbfc4
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Mar 5, 2026
bb7c20b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 5, 2026
af85b48
DOC: add changelog entry for PR 13687
Famous077 Mar 6, 2026
c489a69
DOC: fix RST formatting in changelog entry for PR 13687
Famous077 Mar 6, 2026
e545ad0
DOC: fix contributor name in names.inc to match changelog entry
Famous077 Mar 6, 2026
a042a90
DOC: remove stray changelog file 13680.bugfix.rst
Famous077 Mar 6, 2026
0c0de0c
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Mar 6, 2026
616658d
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Mar 10, 2026
94104ef
TEST: add regression test for GH-12101 spacing attribute with src_to
Famous077 Mar 15, 2026
f04f9dd
Merge branch 'fix/source-morph-spacing-inconsistent' of https://githu…
Famous077 Mar 15, 2026
efd504c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 15, 2026
41e8dcc
Merge branch 'main' into fix/source-morph-spacing-inconsistent
Famous077 Mar 15, 2026
35e3166
TST: move spacing=None assert into existing test_surface_vector_sourc…
Famous077 Mar 19, 2026
4a46e4c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 19, 2026
db4c35e
DOC: fix contributor name to Famous Raj Bhat
Famous077 Mar 19, 2026
2269b6e
DOC: revert contributor name to Famous077 for consistency
Famous077 Mar 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changes/dev/13687.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug in :func:`~mne.compute_source_morph` where :attr:`mne.SourceMorph.spacing` was set incorrectly when ``src_to`` is provided, by `Famous077`_.
1 change: 0 additions & 1 deletion doc/changes/names.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@
.. _Evgenii Kalenkovich: https://github.com/kalenkovich
.. _Evgeny Goldstein: https://github.com/evgenygoldstein
.. _Ezequiel Mikulan: https://github.com/ezemikulan
.. _Ezequiel Mikulan: https://github.com/ezemikulan
.. _Fahimeh Mamashli: https://github.com/fmamashli
.. _Famous077: https://github.com/Famous077
.. _Farzin Negahbani: https://github.com/Farzin-Negahbani
Expand Down
3 changes: 3 additions & 0 deletions mne/morph.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,11 @@ def compute_source_morph(
assert morph_mat.shape[0] == n_verts

vertices_to = vertices_to_surf + vertices_to_vol

if src_to is not None:
assert len(vertices_to) == len(src_to)
# set spacing to None when src_to is provided
spacing = None
morph = SourceMorph(
subject_from,
subject_to,
Expand Down
11 changes: 11 additions & 0 deletions mne/tests/test_morph.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,17 @@ def test_surface_vector_source_morph(tmp_path):
source_morph_surf = compute_source_morph(
inverse_operator_surf["src"], subjects_dir=subjects_dir, smooth=1, warn=False
) # smooth 1 for speed
src_to_fs = mne.read_source_spaces(
subjects_dir / "fsaverage" / "bem" / "fsaverage-ico-5-src.fif"
)
morph_with_src_to = compute_source_morph(
inverse_operator_surf["src"],
subjects_dir=subjects_dir,
src_to=src_to_fs,
smooth=1,
warn=False,
)
assert morph_with_src_to.spacing is None
assert source_morph_surf.subject_from == "sample"
assert source_morph_surf.subject_to == "fsaverage"
assert source_morph_surf.kind == "surface"
Expand Down
Loading