Skip to content

Conversation

@yarikoptic
Copy link
Collaborator

@yarikoptic yarikoptic commented Feb 14, 2024

Replaces #1352 submitted from a fork outside of bids-specification.

Add specification for microelectrode electrohpysiology datasets based on the BEP032 proposal. old google doc

Note

We meet regularly and everyone is welcome

Next meeting: insert date on URL to join

Communication channel: https://framalistes.org/sympa/info/neuroscience-data-structure


DONEs

TODOs

Issues this PR would likely to address

Issues to see being addressed while working on this BEP (likely to move above) or not (moved below):

Other issues which relate but not in scope here and provided for reference/backreference

Spreadsheet with correspondence to ProbeInterface: https://docs.google.com/spreadsheets/d/1O0bZzD-n4MjR68r1GlcH3d2JLXBLAU1PfsDceD3IPeo/edit?usp=sharing

@TheChymera TheChymera closed this Mar 7, 2024
@TheChymera TheChymera deleted the bep032 branch March 7, 2024 22:13
@TheChymera TheChymera restored the bep032 branch March 7, 2024 22:15
@TheChymera TheChymera reopened this Mar 11, 2024
@TheChymera
Copy link
Collaborator

TheChymera commented Mar 12, 2024

@TheChymera
Copy link
Collaborator

@Remi-Gau Remi-Gau changed the title [ENH] Add BEP032 (microelectrode electrophysiology) specification [ENH] microelectrode electrophysiology specification (BEP032) Apr 18, 2024
ree-gupta and others added 10 commits December 8, 2025 14:39
Document the stream_id column format for linking channels to their
corresponding data streams. Include specifications for:
- NWB files with internal HDF5 paths to ElectricalSeries objects
- NIX files referencing data arrays following NIX/Neo organization
- Handling multiple data streams with comma-separated lists
- Cross-file references using filename:path syntax
docs(ephys): add stream_id column documentation for channels.tsv
@bendichter
Copy link
Contributor

I took a look at how filtering is represented in iEEG vs the current microephys draft, and I think it would be beneficial to align microephys with the iEEG approach.

What iEEG does today

  • The canonical, detailed filter specification lives in the sidecar JSON:
    • SoftwareFilters is REQUIRED in *_ieeg.json
    • HardwareFilters is RECOMMENDED in *_ieeg.json
  • In addition, iEEG also captures the effective per-channel frequency response in channels.tsv:
    • low_cutoff and high_cutoff are REQUIRED
    • notch is optional

This gives both (a) structured provenance/parameters and (b) an immediately usable per-channel summary for typical users.

What microephys currently does

  • The sidecar JSON is already very close to iEEG:
    • SoftwareFilters required
    • HardwareFilters recommended
  • But *_channels.tsv doesn’t currently expose the iEEG-style per-channel low_cutoff/high_cutoff. Instead, it has optional hardware_filters / software_filters string columns intended as references back to the JSON.

Why I think aligning makes sense
In practice, downstream users often need the per-channel cutoff values immediately to interpret microephys signals (especially when multiple streams exist: broadband/LFP/high-pass/spikes, etc.). Requiring/recommending low_cutoff + high_cutoff in channels.tsv makes microephys more self-describing in the same way iEEG already is.

Proposed change

  • Add low_cutoff and high_cutoff to microephys *_channels.tsv (at least RECOMMENDED; possibly REQUIRED if we want strict alignment with iEEG).
  • Keep SoftwareFilters (required) and HardwareFilters (recommended) in the datatype sidecars as the place where full filter definitions/parameters are recorded.
  • Optionally keep hardware_filters / software_filters TSV columns as optional “filter chain identifiers” for more complex/multi-stage setups, but make the cutoff fields the primary per-channel summary.

If folks agree, I can open a small follow-up PR adjusting src/schema/rules/tabular_data/microephys.yaml (and any docs/examples) to implement this.

@lzehl
Copy link

lzehl commented Dec 16, 2025

@bendichter sounds like you are combining both approaches and nothing is lost so I think you are right by aligning to iEEG with the filters.

ree-gupta and others added 12 commits December 17, 2025 15:31
- Add new Filtering Information section to microelectrode-electrophysiology.md
  explaining global and channel-specific filter parameters
- Add software_filter_types column definition to columns.yaml for specifying
  filter types with Levels defined in channels.json
- Add low_cutoff, high_cutoff, and notch optional columns to microephysChannels
  for channel-specific filter cutoff frequencies (consistent with iEEG spec)
- Replace hardware_filters and software_filters columns with the new
  software_filter_types column in microephysChannels table
- Add new `model__probes` column to store probe model name/number
  (e.g., Neuropixels 1.0, A1x32-Poly3-5mm-25s-177)
- Mark model__probes as recommended in microephysProbes rules
- Fix typos in x__electrodes description ("there in" → "therein")
- Clarify coordinate units reference in electrode position description
Update axis definitions in Stereotaxic enum to fix incorrect mappings:
- X-axis (AP): Change positive direction from posterior to anterior
- Y-axis: Change from DV to ML axis with right being positive
- Z-axis: Change from ML to DV axis with ventral/inferior being positive
Add RecordingDuration, RecordingType, and EpochLength fields to the
microephysSetup sidecar rules. RecordingDuration and RecordingType are
recommended, while EpochLength is optional but recommended when
RecordingType is "epoched".
Update microelectrode electrophysiology documentation to use the
correct file suffixes `*_ecephys.json` or `*_icephys.json` instead
of the generic `*_ephys.json` to match the actual naming convention
for extracellular and intracellular electrophysiology metadata files.
Comment on lines +2285 to +2288
description: |
A link to a photo or drawing of the microelectrode probe system.
type: string
format: uri
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
description: |
A link to a photo or drawing of the microelectrode probe system.
type: string
format: uri
description: |
Path to the photo or image file defining the coordinate system when
`MicroephysCoordinateUnits` is `"pixels"`.
Should be a [BIDS URI](SPEC_ROOT/common-principles.md#bids-uri).
type: string
format: bids_uri

Suggestion: Update MicroephysCoordinateSystemPhoto to use BIDS URI format

Context

The current implementation of MicroephysCoordinateSystemPhoto in src/schema/objects/metadata.yaml uses format: uri, which only supports external URLs. However, in practice, the photo defining the coordinate system (used when MicroephysCoordinateUnits is "pixels") is typically stored within the dataset itself (e.g., operative photos, histology images).

Comparison with iEEG

iEEG handles a similar use case but takes a different approach:

  • iEEG doesn't have a dedicated photo field
  • Instead, it uses IntendedFor__ds_relative which can point to any reference image (including photos)
  • This field supports both BIDS URIs and dataset-relative paths

Proposed Change

Update MicroephysCoordinateSystemPhoto to use format: bids_uri:

MicroephysCoordinateSystemPhoto:
  name: MicroephysCoordinateSystemPhoto
  display_name: Microephys Coordinate System Photo
  description: |
    Path to the photo or image file defining the coordinate system when
    `MicroephysCoordinateUnits` is `"pixels"`.
    Should be a [BIDS URI](SPEC_ROOT/common-principles.md#bids-uri).
  type: string
  format: bids_uri

Rationale

  1. BIDS URIs are the modern standard - The deprecated participant_relative and dataset_relative formats are being phased out in favor of BIDS URIs
  2. Typical use case is subject-specific - Photos are almost always subject-specific (operative photos, histology), so they're stored within the subject's directory
  3. Consistency - Aligns with how other file references are handled across BIDS

Questions for the team

  1. Should we support external URIs as well? Under what circumstances? If so, we could use anyOf to allow both bids_uri and uri formats.
  2. Is a dedicated field (MicroephysCoordinateSystemPhoto) preferable to reusing IntendedFor like iEEG does?

Rename coordinate columns in microephysElectrodes table to include
__electrodes suffix for disambiguation. Updates both initial_columns
and columns sections to use the new naming convention.
- Change StereoTaxic to Stereotaxic for correct scientific terminology
- Replace PaxinosWatson with WaxholmSpace and WistarRatAtlas coordinate systems
- Remove outdated TODO comment about adding coordinate systems to appendix
- Update file naming examples to use corrected Stereotaxic spelling
…primates

Add new MicroephysCoordinateSystem options for commonly used stereotaxic
atlases:
- PaxinosWatson: rat brain atlas
- FranklinPaxinos: mouse brain atlas
- SwansonRat: rat brain atlas
- CHARM: macaque cortical hierarchy atlas
- D99: Saleem-Logothetis macaque atlas
- PaxinosMacaque: macaque stereotaxic atlas
- MarmosetBrainAtlas: marmoset brain atlas

These additions expand support for microelectrophysiology recordings
across multiple species with widely-used reference coordinate systems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BEP ephys Proposed BEP see https://bids.neuroimaging.io/collaboration/governance.html#proposed-bep

Projects

None yet

Development

Successfully merging this pull request may close these issues.