Skip to content

[ENH] microelectrode electrophysiology specification (BEP032) #1705

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

Open
wants to merge 82 commits into
base: master
Choose a base branch
from

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

steps to use bids-validator-deno against this modified schema
cd ../bids-specification-bep032
cd tools/schemacode/
uv venv
source .venv/bin/activate
uv pip install -e .
bst export > schema-bep032.json  # From bep032 branch
uv pip install bids-validator-deno
rehash  # zsh specific
python -m http.server 8899 &
bids-validator-deno --schema http://0.0.0.0:8899/schema-bep032.json /home/yoh/proj/bids/bids-examples/asl001/ --ignoreNiftiHeaders  # or localhost on windows

@@ -42,6 +42,38 @@ age:
for privacy purposes.
type: number
unit: year
alpha_rotation:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd really recommend renaming the rotation axes to yaw, roll, and pitch (that would be the analogous angle order). There was no consensus either way on the google docs discussion. Someone said both are confusing, which I guess might be expected, but alpha, beta, gamma, are just more confusing...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree -- very adhoc. Let's discuss in google doc

Copy link
Collaborator

Choose a reason for hiding this comment

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

https://docs.google.com/document/d/1oG-C8T-dWPqfVzL2W8HO3elWK8NIh2cOCPssRGv23n0/edit?disco=AAAA4fkI4eY

Could you chime in? I think the other guy commenting might be amenable to accepting this as well.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I agree that both are confusing, but at least alpha, beta and gamma are SO confusing that everyone realizes that additional specification is needed to define them properly. With roll, yaw and pitch it seems at first that all is clear, until you have a number of different people go through different use cases. See the more challenging examples that I posted on the google doc under https://docs.google.com/document/d/1oG-C8T-dWPqfVzL2W8HO3elWK8NIh2cOCPssRGv23n0/edit?disco=AAAA4fkI4eY

Copy link
Collaborator

@TheChymera TheChymera Apr 17, 2024

Choose a reason for hiding this comment

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

@robertoostenveld sorry, I only now saw the update, reply there. I don't think confusion on purpose is good in this case, because the documentation is very eclectic so we might be sending people down rabbit holes. Wiki, where people will invariably go first, does a particularly poor job explaining both euler and TB angles for the casual non-mathematics-versed user. The only thing that wiki has going for it here are the aircraft animations on the TB page. Yaw, Pitch, Roll, will be intuited correctly as long as we specify the starting postion. That we can do (1) as (I think, it's pretty vague) is currently proposed, aligning the implant with the world coordinate system (meaning most implants will be at yaw 0 pitch -90 roll 0) or (2) relative to the implantation stereotax normal (meaning most implants will be at 0 0 0).

For comparison, Euler commonly has the normal pointing up so most implants will be.... 0 -180 0 🤔

Copy link

Choose a reason for hiding this comment

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

in the last BEP032 meeting we discussed further and wanted to follow this approach now (based on the Allen Inst. standard and IBL standard):

Assumption: x,y,z is posterior, ventral, right (unit needs to be specified).

Translational origin (0,0,0) needs to be defined (typically Bregma for rodents).

Rotational origin (0,0,0) is the probe facing up with the tip facing forward. Rotations are all clockwise in degrees and around the tip. For multi-shank probes, the “tip” of the probe is defined as the end of the left shank if you are looking at the electrodes.

  • yaw: clockwise when looking down
  • pitch: In the direction of the electrode face
  • roll: clockwise when looking down at the probe

The depth (unit needs to be specified) is a translation in the direction that the tip is pointing.

We need to add a “probe_model”, which references probeinterface_library

  • versioning of probe library files (raised here)
  • annotation of “tip” position (raised here)

NOTE: We need to change the electrode x,y,z.
X,y,z in BIDS refers to location in brain, not on probe.

@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
@CodyCBakerPhD
Copy link
Contributor

CodyCBakerPhD commented Jun 5, 2025

Hello all,

I am working diligently on bringing nwb2bids up to date with the latest state of this specification in conjunction with some real data examples

I have scoured this discussion to the best of my ability, so apologies if this has come up before - has it been firmly decided to call the 'physical recording entities' on the probes electrodes instead of contacts? Note that Probeinterface (including their lovely diagram above) prefers contacts, as does the ndx-anatomical-localization NWB extension

EDIT: from meeting on 6/18/25, electrodes has been firmly decided

* fix: schemapath resolution in Windows dev mode installation of bidsschematools

* fix: schema validation through testing

* chore: resolve conflict
@CodyCBakerPhD
Copy link
Contributor

Update on 6/18/25

PR requires further testing on more extreme real datasets (both ecephys and icephys) with particular focus on probes and coordinate metadata (including insertion):

It also requires some external changes to be merged first:

We will be ramping up the regular working group meeting to every 2 weeks to try to gain momentum to get this done (hopefully by end of summer)

CodyCBakerPhD and others added 9 commits July 30, 2025 09:48
…ides

- Replace x,y,z coordinates with standardized AP/ML/DV system
- Add anatomical reference points (Bregma/Lambda) explanations
- Include detailed angle measurement conventions with diagrams
- Add 6 illustrative images for coordinate system understanding
- Update electrode table example to use new coordinate naming
- Add AP__probes column for Anterior-Posterior probe positioning
- Add ML__probes column for Medial-Lateral probe positioning
- Add missing unit specification (mm) to existing DV__probes column
- Add ProbeInterface format links and JSON schema requirements for custom probes
- Standardize requirement language (MUST/SHOULD) for coordsystem fields
- Remove deprecated ProbeContours section
Add comprehensive stereotaxic coordinate documentation with visual guides
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.