BUG: SourceMorph spacing-attribute inconsistent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start at the compute_source_morph entry point and reproduce the two calls from the issue with oct6 and ico5 source spaces. Trace how src_to and spacing determine SourceMorph.spacing, then add or update coverage so the result matches the target source-space spacing in both directions.
Written by the indexing model from the issue text.
Description
Description of the problem
When src_to is supplied to compute_source_morph and is has a spacing other then "ico5", the spacing-attribute of the resulting SourceMorph doesn't seem to be consistent (see example below)
Steps to reproduce
import mne
from mne.datasets import sample
data_path = sample.data_path()
subjects_dir = data_path / "subjects"
# oct6 spacing
src_from = mne.read_source_spaces(subjects_dir / "sample" / "bem" / "sample-oct-6-src.fif")
subject_from = "sample"
# ico5 spacing
src_to = mne.read_source_spaces(subjects_dir / "fsaverage" / "bem" / "fsaverage-ico-5-src.fif")
subject_to = "fsaverage"
morph = mne.compute_source_morph(
src_from,
subject_from=subject_from,
subject_to=subject_to,
src_to=src_to,
subjects_dir=subjects_dir,
)
assert morph.spacing == 5
# When you switch src_from and src_to, the spacing should be 6 since the target source-space has a spacing of oct6.
# But it is still 5.
morph = mne.compute_source_morph(
src_to,
subject_from=subject_to,
subject_to=subject_from,
src_to=src_from,
subjects_dir=subjects_dir,
)
# This fails
assert morph.spacing == 6
Link to data
No response
Expected results
SourceMorph.spacing being consistent with spacing of src_to
Actual results
It's always 5 (or the value currently supplied to spacing, which should be ignored when src_to is supplied)
Additional information
Platform Windows-10-10.0.22621-SP0
Python 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:29:11) [MSC v.1935 64 bit (AMD64)]
Core
├☑ mne 1.6.0.dev24+g22ffe6f7a
├☑ numpy 1.24.4 (OpenBLAS 0.3.24 with 32 threads)
├☑ scipy 1.11.3
├☑ matplotlib 3.8.0 (backend=QtAgg)
├☑ pooch 1.7.0
└☑ jinja2 3.1.2
Numerical (optional)
├☑ sklearn 1.3.1
├☑ numba 0.57.1
├☑ nibabel 5.1.0
├☑ nilearn 0.10.2
├☑ dipy 1.7.0
├☑ openmeeg 2.5.6
├☑ pandas 2.1.1
└☐ unavailable cupy
Visualization (optional)
├☑ pyvista 0.42.3 (OpenGL 4.6.0 Compatibility Profile Context 23.9.3.230915 via AMD Radeon(TM) Graphics)
├☑ pyvistaqt 0.0.0
├☑ vtk 9.2.6
├☑ qtpy 2.4.0 (PyQt5=5.15.8)
├☑ ipympl 0.9.3
├☑ pyqtgraph 0.13.3
├☑ mne-qt-browser 0.6.0.dev13+g481264d
└☐ unavailable ipyvtklink
Ecosystem (optional)
├☑ mne-bids 0.14.dev0
├☑ mne-connectivity 0.6.0dev0
└☐ unavailable mne-nirs, mne-features, mne-icalabel, mne-bids-pipeline
- Dominant language
- Python
- Stars
- 3.5k
- Forks
- 1.6k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 100
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mne-tools/mne-python
-
ENH
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mne-tools/mne-python#13743 · 2 comments ·
-
ENH
Difficulty 3/5 1-2 days Newbie friendliness 68/100
mne-tools/mne-python#14318 ·
-
BUG
Difficulty 3/5 1-2 days Newbie friendliness 68/100
mne-tools/mne-python#14317 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
mne-tools/mne-python#14311 · 1 comment · 1 reaction ·
-
ENH
Difficulty 5/5 Over a week Newbie friendliness 35/100
mne-tools/mne-python#14309 · 1 comment ·
All issues in mne-tools/mne-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100