[electrophysiology_browser] Dynamic channel metadata and visualization#10470
Draft
MaximeBICMTL wants to merge 6 commits intoaces:mainfrom
Draft
[electrophysiology_browser] Dynamic channel metadata and visualization#10470MaximeBICMTL wants to merge 6 commits intoaces:mainfrom
MaximeBICMTL wants to merge 6 commits intoaces:mainfrom
Conversation
add raisinbread sql [SQL/MEG] Add the MEG CTF head shape tables (aces#10412) The MEG CTF format uses a `headshape.pos` file to register the head shape of the participant. This file is CTF-specific but BIDS-standard (the BIDS MEG specification basically allows to use native files of all specific data types), and is usually shared across all the MEG acquisitions of a session. This adds some tables to register this data in the LORIS physiological database and link it to the relevant MEG files. The `headshape.pos` file format is unfortunately very sparsely documented. It is a textual file format whose contents looks like this: ``` 85 1 5.60644227 -6.38055462 0.79194871 2 8.06310971 -4.72750212 0.59046631 3 7.58675759 -5.78050209 3.05185917 ... NAS 8.57169649 -0.14219376 -3.33998151 LPA -0.58286578 7.02263278 0.27529669 RPA -1.40471662 -7.10183109 0.57320080 ``` The first line is the number of points. The coordinates are in centimeters. It might be useful to use a proper `physiological_coord_system` in the future, but this can easily be added later IMO, so I'd like to start by merging this minimal implementation.
dc1fc25 to
55eccc5
Compare
0b778c6 to
15b85a9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #10403
Description
This PR adds support for usable MEG display in the electrophysiology browser by replacing hard-coded EEG values with dynamic values based on the channel metadata and signal.
Features
Design choices
channels.tsvfields, read through the LORIS API (just like the type in the channel types).Architecture
This PR also moves the channel metadata and BIDS channel information from the Redux-based state management to React contexts, which reduces prop drilling and makes them easier to use throughout the electrophysiology browser.
Backward-compatibility
This PR is backward-compatible with existing EEG acquisitions. If some metadata is not found, this PR falls back to assuming the acquisition is an EEG acquisition.
Performance:
This PR adds a O(n) scan on the signal values of visible channels to get the signal range. This did not cause noticeable lags in my tests even with 64 displayed channels.
Potential improvements
All these improvements can be added later IMO (although more metadata extract requires re-running the electrophysiology chunker script) and are easier to implement after this PR rather than before.
Screenshots
For the MPN MEG dataset:
[TODO]
For the EEG Face13 dataset:
[TODO]