-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
ENH: Enable sensor-specific OPM coregistration in mne coreg #11405
Conversation
@larsoner at Martinos we are currently at the stage of experimenting with subject-specific helmets ... I am not sure when/if we will transition to generic helmets. The question of optimal helmet needs some research ... Whatever pipeline is developed in MNE should hopefully be a little flexible so that it's not too specific to a particular system. Things are still under flux in my opinion. |
Indeed, I think that's going to be the case with the plan above |
The way I am thinking, one could define 5 or so index points on the helmet that need to be coregistered with the index points from the CAD file to get the The head-MRI |
* upstream/main: (37 commits) Use constrained layout in matplotlib visualization (mne-tools#12050) Add raw stc (mne-tools#12001) [MRG] update codeowners (mne-tools#12089) DOC: Morlet wavelet length in tfr_morlet (mne-tools#12073) BUG: Fix bug with mne browser backend (mne-tools#12078) Cache avatars (mne-tools#12077) BUG: Fix bug with ch_name resolution (mne-tools#12086) add unicode roundtrip for FIF (mne-tools#12080) add Ivan to names.inc (mne-tools#12081) MAINT: Work around PySide 6.5.3 event loop error (mne-tools#12076) mne-tools#11608, buggfix and docstring update (mne-tools#12066) MAINT: Fix broken examples (mne-tools#12074) Add UI Event linking to DraggableColorbar (mne-tools#12057) handle lazy loading through .pyi type stubs (mne-tools#12072) BUG: Fix bug with sensor_colors (mne-tools#12068) clean up some deprecations (mne-tools#12067) Allow not dropping bads when creating or plotting Spectrum objs (mne-tools#12006) Collapsible html repr for raw/info (mne-tools#12064) BUG: Fix bug with pickling MNEBadsList (mne-tools#12063) add details for Denis (mne-tools#12065) ...
* upstream/main: (35 commits) [DOC] Add documentation for setting montage order (mne-tools#12160) Fix inferring fiducials from EEGLAB (mne-tools#12165) Try to fix ICA Report (mne-tools#12167) BUG: Fix bug with Report.add_ica component number (mne-tools#12156) MAINT: Add rstcheck to CIs and pre-commit (mne-tools#12163) DOC: fix sphinx style typos (mne-tools#12161) MAINT: Fix linkcheck (mne-tools#12162) ENH: Add multiple label support to source_band_induced_power, source_induced_power (mne-tools#12026) Allow automated metadata generation to be bounded by "row events" instead of explicit time windows (mne-tools#12118) ENH: Collapse only in doc gen (mne-tools#12145) [pre-commit.ci] pre-commit autoupdate (mne-tools#12155) BUG: Fix bug with interior points not showing (mne-tools#12148) ENH: Warn about versions in sys_info (mne-tools#12146) Fix in conftest.py (mne-tools#12150) ENH: set color for bad channel with spatial_colors=True (mne-tools#12142) DOC: Better documentation of realign_raw (mne-tools#12135) Add mne-icalabel wildcard (mne-tools#12143) Remove LGTM.com configuration file (mne-tools#12139) DOC: Fix typo found by codespell (mne-tools#12140) DOC: Document governance updates (mne-tools#12133) ...
* upstream/main: MAINT: Add branch coverage (mne-tools#12174) OpenSSF (mne-tools#12175) fix docstring in 60_sleep.py (mne-tools#12171) FIX: skip empty lines in read_raw_eyelink (mne-tools#12172) FIX: Fix bug with coreg scalars (mne-tools#12164) Changed casting rule in np.clip to allow reading of raw GDF files (mne-tools#12168)
from the PR description
@larsoner can you open issues for items 1 and 2 (if you haven't already)? I think item 3 (add built-in models of other mfg's helmets) doesn't need an issue, we can just add them when folks ask for them. |
@drammock FYI I did end up adding a kernel dataset example. It should be building now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed just the new example this time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I got all the comments @drammock !
logger.info( | ||
"Using untransformed helmet, not enough sensors found to deform to match " | ||
f"acquisition based on sensor positions (got {len(fro)}, need at least 4)" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@drammock took a stab at improving these, see if you think they make more sense now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that works, thanks!
* upstream/main: ENH: Enable sensor-specific OPM coregistration in mne coreg (mne-tools#11405) Tweak README.rst (mne-tools#12166) [pre-commit.ci] pre-commit autoupdate (mne-tools#12177) MAINT: Add branch coverage (mne-tools#12174) OpenSSF (mne-tools#12175) fix docstring in 60_sleep.py (mne-tools#12171) FIX: skip empty lines in read_raw_eyelink (mne-tools#12172)
* upstream/main: BUG: Fix bug with spectrum warning (mne-tools#12186) Add argument splash to disable splash-screen from Qt-browser (mne-tools#12185) BUG: Fix bug with logging and n_jobs>1 (mne-tools#12154) Use gray logo (works in light and dark modes) (mne-tools#12184) Tweak logo for dark mode (mne-tools#12176) ENH: Improve Covariance.__repr__ (mne-tools#12181) ENH: Enable sensor-specific OPM coregistration in mne coreg (mne-tools#11405) Tweak README.rst (mne-tools#12166) [pre-commit.ci] pre-commit autoupdate (mne-tools#12177) MAINT: Add branch coverage (mne-tools#12174) OpenSSF (mne-tools#12175) fix docstring in 60_sleep.py (mne-tools#12171) FIX: skip empty lines in read_raw_eyelink (mne-tools#12172) FIX: Fix bug with coreg scalars (mne-tools#12164) Changed casting rule in np.clip to allow reading of raw GDF files (mne-tools#12168) [DOC] Add documentation for setting montage order (mne-tools#12160) Fix inferring fiducials from EEGLAB (mne-tools#12165)
…o-pyproject.toml * upstream/main: MAINT: Fix CIs (mne-tools#12188) BUG: Fix bug with default alpha and axes (mne-tools#12187) BUG: Fix bug with spectrum warning (mne-tools#12186) Add argument splash to disable splash-screen from Qt-browser (mne-tools#12185) BUG: Fix bug with logging and n_jobs>1 (mne-tools#12154) Use gray logo (works in light and dark modes) (mne-tools#12184) Tweak logo for dark mode (mne-tools#12176) ENH: Improve Covariance.__repr__ (mne-tools#12181) ENH: Enable sensor-specific OPM coregistration in mne coreg (mne-tools#11405) Tweak README.rst (mne-tools#12166)
This PR does a few things:
mne.viz.plot_alignment
by passing dict tomeg
With this I get the following coreg:
Output
I think in follow-up PRs we'l want
mne coreg
fix/adjust thehead
coordinate frame definition. Even with our existing OPM dataset from years ago, the head and MRI coordinate frames are taken as equal, which they shouldn't be. We should allow for using the current (in the GUI) head<->MRI transformation and current LPA/Nasion/RPA (from the MRI) to be used to adjust LPA/Nasion/RPA ininfo['dig']
, which in turn should update the head coordinate frame definition, which in turn should change the rest ofinfo['dig']
andinfo['chs][ii]['loc']
etc. We'll need some buttons and/or UI for this, but in principle I think this makes sense. We can test this easily with our existing OPM dataset by implementing it in the non-GUI Coreg object first.Helps with #11276