Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take units (m or mm) into account when showing fieldmaps on top of brains #13101

Merged
merged 13 commits into from
Feb 5, 2025

Conversation

wmvanvliet
Copy link
Contributor

@wmvanvliet wmvanvliet commented Feb 4, 2025

Plotting evoked fieldlines on top of distributed source estimates is very cool:

image

But, mne.viz.Brain can use either units="m" or units="mm". The plot_evoked_field function always assumed it would be kept at the default units="mm". This PR makes it actually pay attention to the unit. Another bug fixed is that when plotting in millimeters, the helmet surface would be modified in place: surf["rr"] *= 1000. This causes trouble as now the surface will forever be upscaled and should you plot it again, it will be upscaled again. In this PR a deepcopy() is made first.

@drammock
Copy link
Member

drammock commented Feb 4, 2025

windows pip-pre job: odd failure in test_search_light:

mne/decoding/tests/test_search_light.py::test_search_light_basic ERROR   [ 21%]
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\pyarrow\compute.py:211: RuntimeWarning: Python binding for RankQuantileOptions not exposed
  warnings.warn("Python binding for {} not exposed"
C:\hostedtoolcache\windows\Python\3.12.8\x64\Lib\site-packages\pyarrow\compute.py:211: RuntimeWarning: Python binding for RankQuantileOptions not exposed
  warnings.warn("Python binding for {} not exposed"

ubuntu conda 3.12 had a segfault during test_3d.py, not sure if related.

@larsoner
Copy link
Member

larsoner commented Feb 4, 2025

windows pip-pre job: odd failure in test_search_light:

Ugh probably some sklearn thing, I'll push a quick ignore

Copy link
Member

@larsoner larsoner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking for merge-when-green, thanks in advance @wmvanvliet

(I think the conda segfault is unrelated, I think we just get those sometimes but we'll see...)

@larsoner larsoner enabled auto-merge (squash) February 4, 2025 18:06
@larsoner larsoner merged commit afd69af into mne-tools:main Feb 5, 2025
30 checks passed
@wmvanvliet
Copy link
Contributor Author

wmvanvliet commented Feb 6, 2025

Thanks for the great debugging @larsoner!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants