nwb-schema icon indicating copy to clipboard operation
nwb-schema copied to clipboard

What to do with biopotential signals (e.g. EEG. ECoG, EMG, etc)

Open h-mayorquin opened this issue 3 months ago • 2 comments

[Draft]

The following biopotential signals are described in The Handbook of Human Physiological Recording by Alan Macy, see Chapter 10: Biopotential Signals.

  • Electrocardiography (ECG)
  • Electrodermal Activity (EDA)
  • Electroencephalography (EEG)
  • Electrogastrography (EGG)
  • Electromyography (EMG)
  • Electrooculography (EOG)
  • Electrocorticography (ECoG)

I will be using the term biopotential signals as defined in the citation above to differentiate them from other electrophysiology signals such as extracellular recordings (for example, multi-unit spikes or local field potentials with silicon probes) and intracellular recordings (for example, sharp electrode or patch clamp). I have also added ECoG to the list, since it naturally falls under the same umbrella of electrode based potentials even if it was not in the cited reference.

The question of how to store these signals has come up before, see https://github.com/NeurodataWithoutBorders/nwbinspector/issues/579. We currently do not have dedicated neurodata types for them, so this issue is intended as an umbrella discussion.

Some signals are standardized enough that they would benefit from dedicated extensions, since their electrode placement and lead configurations are already well defined and widely adopted:

  • EEG: uses standards like the international 10–20 system which provide consistent electrode naming, coordinates, and reference schemes.
  • ECoG: relies on grids with systematic numbering and spacing, often documented in surgical notes and imaging coregistration. See here for an example.
  • ECG: follows the globally standardized 12-lead configuration, based on Einthoven’s triangle, augmented limb leads, and precordial leads.

In these cases, schema extensions could explicitly capture electrode placement, geometry, and lead configuration in a way that is both structured and reusable across datasets.

For other signals such as EMG and EOG, my cursory read is that the setups are less standard across labs and devices. While it would be nice to have extensions for those experimental setups I think that at the moment, a TimeSeries linked to a Device may be sufficient, where the device metadata specifies the electrode type (for example surface vs needle EMG, or vertical vs horizontal EOG). This could be enabled by the proposal discussed in NWB schema issue #602.

h-mayorquin avatar Sep 03 '25 17:09 h-mayorquin

@oruebel @stephprince and I discussed this further today and agree that dedicated types for these signals makes a little more sense than adding a signal_type attribute, especially because each type may have different metadata and terminology/documentation. Dedicated types also provide flexibility in case additional metadata for only a specific type is useful. I think it is also helpful to model data types based on how scientists think about them and will use them. To me at least, it does not feel intuitive to group metadata about depth electrodes and ecog electrodes in the same ElectrodesTable, or their data in the same ElectricalSeries. The downside of this approach is a potential explosion of types, especially for newer methods, which can lead to confusion for users over which to use, but the methods listed above are quite well established. I think the advantages slightly outweigh the disadvantages.

Following up with the discussion in https://github.com/NeurodataWithoutBorders/nwbinspector/issues/579, this is a deviation from the organization of ndx-microscopy and ndx-ophys-devices where there is a PlanarMicroscopySeries that links to a MicroscopyRig that has an ExcitationSourceModel with excitation_mode = "one-photon", "two-photon", etc. This model for ophys data works because the data/metadata are otherwise the same for different excitation modes (as far as I know).

rly avatar Sep 05 '25 20:09 rly

Relevant: https://github.com/Defense-Circuits-Lab/ndx_ecg

h-mayorquin avatar Oct 06 '25 20:10 h-mayorquin