Skip to content

Commit b9a0d2e

Browse files
CodyCBakerPhDJuliaSprengeryarikopticTheChymeraRemi-Gau
authored
Squashing BEP032 state in preparation for review (#2305)
* Add first BEP032 objects * Add ephys modality, start adding _channels but ran into a question on _acq- * Add _acq- to ephys, add _channels and _coords * Draft for probes TSV file * Fix preferably typo * Comment out not yet defined iephys and add ephys to datatypes where it was missing * Added probes file * Describe modality/datatype as "Microelectrode Electrophysiology" otherwise "Electrophysiology" is too broad. Thanks @dorahermes for the note * Remove iephys entirely since I think it was just inspired by DANDI layout not BEP032 * Initial content for ephys document and initial filename template tree * pacify pre-commit * add to TOC * semantic line break and fix * Addressed minor left over lint complains * Add "Microelectrode" specialization for Electrophysiology in the context menu * Fix up for bad latin and adjust wording a bit * Replace fancy unicode “ with simple " . I think this is what might have freaked out `schemacode_ci / windows-latest with Python 3 (pull_request) ` (windows only!) fails with a bunch of ``` 2024-04-19T19:13:44.2815607Z self = <encodings.cp1252.IncrementalDecoder object at 0x0000028D6A14D850> 2024-04-19T19:13:44.2818292Z input = b'---\nHED:\n name: HED\n display_name: HED Tag\n description: |\n Hierarchical Event Descriptor (HED) Tag.\n ...ed or ideal position along the z axis.\n anyOf:\n - type: number\n - type: string\n enum:\n - n/a\n' 2024-04-19T19:13:44.2820386Z final = True 2024-04-19T19:13:44.2820609Z 2024-04-19T19:13:44.2820821Z def decode(self, input, final=False): 2024-04-19T19:13:44.2821664Z > return codecs.charmap_decode(input,self.errors,decoding_table)[0] 2024-04-19T19:13:44.2823260Z E UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 2105: character maps to <undefined> 2024-04-19T19:13:44.2824229Z 2024-04-19T19:13:44.2824768Z C:\hostedtoolcache\windows\Python\3.12.3\x64\Lib\encodings\cp1252.py:23: UnicodeDecodeError ``` * Use redirected to www.datalad.org and www.nwb.org website URLs and few others * BEP032: ephys -> microephys with {icephys, ecephys} modalities/suffixes (#1806) * RF: to have "microephys" (Microelectrode physiology) for modality and icephys and ecephys for suffixes and datatypes * Reflecting decision of having two separate datatypes under the Microelectrode Electrophysiology #1800 (comment) Consensus reached during working group meeting on 2024-05-15: - modality = "Microelectrode Electrophysiology" - datatypes = "icephys" and "ecephys" - suffixes = "_icephys" and "_ecephys" * Adjust wording to Horea's recommendation * Various fixups and tune ups to wording from code review * Clarify wording and do mention `microephys` as shorthand for Microelectrode Electrophysiology * Adding markdown portion of the Bep032 (#1960) * test * MACROS___make_suffix_table * markdown * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * undoing changes to yaml files * adding chanell * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * adding General ephys metadata * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Examples of real datasets * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Minor tuneups to formatting --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * [ENH] Schema changes related to BEP032 (#1826) * [FIX] Minor YAML formatting * [ENH] Added additional birthdate column for participants.tsv * [ENH] Added age_category, age_type and corresponding enums * [ENH] Added surgery_date column * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Reverted changes that better suit in a PR against master * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [ENH] Added tabular_data file and columns for _probes.tsv * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [ENH] Added tabular_data rules and columns for _electrodes.tsv * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [ENH] Added tabular_data rules for _electrodes.tsv * [ENH] Added tabular_data rules and columns for _channels.tsv * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * [FIX] Fixed pre-commit errors * [ENH] Added additional ephys columns for events.tsv * [ENH] Added tabular data rules for events.tsv to include ephys related columns * [ENH] Added metadata entities for ephys setup metadata * [ENH] Created sidecar rule file for ephys metadata and added data origin and setup fields * Made schema changes to match microephys data type * Renamed rule files from ephys to microephys * Made schema changes to match microephys data type * [ENH] Added objects and rules for coordinate system sidecar file * [ENH] Added processing microephys metadata field in rules * [ENH] Added pharmaceuticals microephys metadata field in rules * [ENH] Added supplementary microephys metadata field and rules * [ENH] Added sample microephys metadata rules * [ENH] Added task microephys metadata rules * Fixed example language convention * Added microephys in schema rule modality * Corrected SampleThickness to SliceThickness * Add yaml document separator for microephys rules file It is optional, and adding does not solve anything but makes it consistent with the other files in the folder * BF: should be a dict, not a list of dicts --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Some fixes of formatting and URLs * Adjusted some formatting and some wording at the beginning of the section * Few fixes to the schema from review Co-authored-by: Peyman Najafi <najafe.peyman@gmail.com> * Adopting the markdown line lengths for BEP032 (#2012) * cutting line lenghts * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * marking json examples * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * microephysChannels --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Fix tabulation in a .tsv + convert to use yaw, pitch, roll Co-authored-by: Ben Dichter <ben.dichter@gmail.com> * Add types and min/max for roll,pitch,yaw + fix typo for microephysChannels * Replace Pharmaceuticals with already existing fields and fix few more references * Make use of merged fancing for tsvs and add a note about spotted Pharmaceuticals * Remove some "bad latin" * Fix a link to be final, before redirects * using MACROS___make_sidecar_table * numbering * Adding icephys and ecephys to filename template * [ENH] Added microephys tag to electrode related enums * [ENH] Added additional channel enums for microphys * [ENH] Enlisted microphys channel types in type__channels * Various small fixes from code-review Co-authored-by: Lyuba Zehl <lyuba.zehl@ebrains.eu> Co-authored-by: Ben Dichter <ben.dichter@gmail.com> * [BEP032] Moved coord system related entities to correct yaml * Minor tuneups from code review (mostly on wording) Co-authored-by: Ben Dichter <ben.dichter@gmail.com> * A pass to harmonize to use "microephys" in favor over "ephys" Also used appropriate suffix in a few spots when encountered * Encode in schema that ATM we do require _electodes and _probes Also extended for microephys for channels and coordsystems * One more ephys -> microephys * Add .json to data (nwb and nix) and _probes files * [DATALAD RUNCMD] replace fancy unicode double quote with a simpler one === Do not change lines below === { "chain": [], "cmd": "sed -i -e 's,[“”],\",g' src/modality-specific-files/microelectrode-electrophysiology.md", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * Address many remark lint issues using npx remark src/modality-specific-files/microelectrode-electrophysiology.md --frail --rc-path .remarkrc --output and then subselecting some changes and fixing some manually * One more tune up * items * [DATALAD RUNCMD] Fix up itemized things indentation === Do not change lines below === { "chain": [], "cmd": "sed -i -e 's,^\\([0-9]\\.\\|- \\) *,\\1 ,g' src/modality-specific-files/microelectrode-electrophysiology.md", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * Address leftover of remark lint warnings * Remove custom paragraph on participants, replaced angles with yaw, pitch, roll Co-authored-by: Lyuba Zehl <lyuba.zehl@ebrains.eu> * [FIX] BEP032 - Correcting validations against real data example (#2132) * fix: schemapath resolution in Windows dev mode installation of bidsschematools * fix: schema validation through testing * chore: resolve conflict * fix: validation rules for events * doc: Reorder required metadata files for microephys sessions and clarify channel information * remove unneeded fields * move to task.yaml with __ * remove from microephys * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * chore: linting * Add comprehensive stereotaxic coordinate documentation with visual guides - 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 probe position columns for AP and ML axes and standardize units - 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 * Update microelectrode electrophysiology documentation - Add ProbeInterface format links and JSON schema requirements for custom probes - Standardize requirement language (MUST/SHOULD) for coordsystem fields - Remove deprecated ProbeContours section * Updated probe tabular rule to match AP, ML, DV * Removed coordystem completely * Removes coordsys macro to fix failing mkdocs build * change the electrode positions back from AP/ML/DV to x,y,z * Update _probes.tsv example with standardized coordinate system and ProbeInterface fields Replace x/y/z coordinates with AP/ML/DV notation, add angle fields, and include probeinterface_manufacturer/model columns for better compatibility with ProbeInterface library * Update microephys entity rules and remove task/run requirements * Fix linter issues * Reorganized to match other modalities * Clarify DV axis description in microelectrode electrophysiology documentation * Update src/modality-specific-files/microelectrode-electrophysiology.md * Adds space entity for microephys electrodes * Add coordinate system metadata fields for microephys * Added rules to 1) override rule for coorsystem to be present for electrode.tsv 2) If coorsystem present, corresponding electrode.tsv must be present 3. Match the space between corresponding coordystem and electrodes files * Added entities for the photo specific to microephys * Rewrote the coordsystem JSON and photo section to align with ieeg but adopt to animal electrophysiology * Minor change to the default probe relative coordinate system * Probe interface exaple file tree * Add omission of microephys datatypes for overall channel file rule * Update src/modality-specific-files/microelectrode-electrophysiology.md * Update src/modality-specific-files/microelectrode-electrophysiology.md * Update src/modality-specific-files/microelectrode-electrophysiology.md * Fix indentation for note and example alerts * [MISC] Use Levels and custom json for probe interface files * Update src/modality-specific-files/microelectrode-electrophysiology.md * Update src/schema/objects/columns.yaml * Update src/modality-specific-files/microelectrode-electrophysiology.md * [MISC] Replace image syntax with HTML for anatomical reference diagrams * Fix formatting in example *_electrodes.tsv for improved readability * Apply suggestion from @bendichter * Remove channel_id def and use name__channels same as ieeg * Update microephys electrode.tsv to match ieeg * Changed probe_id to probe_name to avoid use of the concept ID against BIDS conventions * Add missing probe_height def and rewrite desc to match current markdown * Fixed minor typo failing schema validation * Fix remark linting issues * Added and modified texts for coordsystem requirements * Added icephys and ecephys distinction and restructured first section a little * Fixed initial_column to match AP, ML, DV * Update mock TSV and JSON and fix heading levels to match ieeg * Updated toy data section and links to example to match current spec * Minor formatting and style issues * Fix mock data tsv and JSON * Apply various wording suggestions from code review Co-authored-by: Ben Dichter <ben.dichter@gmail.com> * Apply suggestion from @yarikoptic Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> * Apply suggestion from @bendichter * add back type info that was accidentally removed from whole_blood_radioactivity * Update link to iEEG stimulation documentation for clarity * Update src/modality-specific-files/microelectrode-electrophysiology.md * feat: add anatomical reference point to microelectrode electrophysiology schema * Fix up units and clarify that we need TODO work on the units/space more * Fix typo Update src/schema/objects/suffixes.yaml fixing a typo * rf: move "ProbeInterface Library" subsection down after probes.tsv * Revert "Apply suggestion from @bendichter" to bring back width__probes This reverts commit d1835cf . spotted by seeing na na in the table. We have height and depth so makes sense to keep width, and now we get ❯ git grep __probes -- src/schema/objects/columns.yaml src/schema/objects/columns.yaml:AP__probes: src/schema/objects/columns.yaml:depth__probes: src/schema/objects/columns.yaml:DV__probes: src/schema/objects/columns.yaml:height__probes: src/schema/objects/columns.yaml:hemisphere__probes: src/schema/objects/columns.yaml:manufacturer__probes: src/schema/objects/columns.yaml:material__probes: src/schema/objects/columns.yaml: name: material__probes src/schema/objects/columns.yaml:ML__probes: src/schema/objects/columns.yaml:type__probes: src/schema/objects/columns.yaml:width__probes: Ideally the rendered should have failed and not just added na's row but that shouldn't be fixed here... * docs: consolidate electrode coordinate system documentation Reorganize coordinate system documentation in microelectrode electrophysiology spec by removing standalone "Coordinate Systems for Electrode Positions" section and consolidating the information into a new "Electrode Position Coordinates" subsection under the electrodes description. This improves document flow and places coordinate guidance closer to the relevant table definition. * docs(appendices): add microelectrode surgical coordinates appendix Add new appendix documenting stereotaxic coordinate conventions for intracranial probe placement during surgery, including: - Anatomical reference points (Bregma and Lambda) - AP/ML/DV coordinate system conventions - Angle definitions for probe orientation (AP, ML, rotation) - Reference to BrainSTEM documentation source * Add probes related schema changes * docs: add microelectrode electrophysiology coordinate systems Add new section defining restricted keywords for MicroephysCoordinateSystem field in coordsystem.json for icephys and ecephys datasets. Includes: - Pixels (2D electrode localization) - Stereotaxic (generic animal neuroscience coordinates) - AllenCCFv3 (mouse brain reference space) - WaxholmSpace (rat brain coordinate system) - WistarRatAtlas * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * docs: convert RRID identifiers to hyperlinks in coordinate-systems * docs(ephys): add stream_id column documentation for channels.tsv 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): clarify electrode name uniqueness requirement * Changed hemisphere cardinality from required to recommended * fix: correct typo in description for reference__microephys * fix: clarify electrode position coordinates for single electrode cases * fix: fix the name of matrial: material_probes -> material * fix: remove unnecessary brackets in coordsystem selectors * fix: change tables from pipe syntax to html syntax. This removes linter errors and is easier to maintain. * Fix yamllint and codespell issues * feat(microephys): add channel-level filtering columns and documentation - 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 * fix: add missing closing brace in JSON example for task description * fix: update description of MicroephysCoordinateSystem axes and link to surgical coordinates appendix * feat(schema): add model column for probes and fix electrode descriptions - 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 * fix: update description for IntendedFor field in microephysCoordsystemGeneral * fix: correct name and type for associated_brain_region_id field in columns.yaml * fix: remove deprecated hardware_filters and software_filters columns in extracellular electrophysiology example * feat: add micrometer (um) as a valid unit for MicroephysCoordinateUnits * fix(schema): correct stereotaxic coordinate system axis definitions 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 * feat(microephys): add recording metadata fields to setup schema 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". * docs(ephys): correct JSON metadata filename convention 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. * fix: correct pluralization in TODO comment for PharmaceuticalDoseUnits * fix(schema): update electrode position descriptions for clarity and consistency with space entities * fix(schema): rename x/y/z columns to x/y/z__electrodes in microephys 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. * docs(ephys): update coordinate system names and fix Stereotaxic spelling - 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 * feat(microephys): add brain atlas coordinate systems for rodents and 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. * fix(linter): fix yamllint and remark errors * fix(schema): remove unused column defintions * Reverted commit and readded the removed type column for software_filters * fix: reconciling software_filter defintion with master * Update src/schema/objects/metadata.yaml * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Reema Gupta <59512969+ree-gupta@users.noreply.github.com> * fix: microephys electrodes/coordsystem validation with space entity support * fix(convention): update the schema selector convention from == to using intersects * fix(convention): use __ instead of _ for microephys context * cleanup(schema): remove old unused probe suffix * cleanup(schema): remove unsused column contact_count * fix(convention): fix display name capitalization and hypenation * [BEP032] Review and clean-up suggestions (#2293) * enhancement(units): Remove dimension_unit and add default mm for probe * cleanup: remove resolved comment * cleanup: remove resolved comment * cleanup(schema): mark hemisphere__probes for future unification with base hemispher column * cleanup: comments about unifying probes and electrodes column * fix(schema): use um² for microephys electrode size Microelectrodes require micrometer-scale measurements different from iEEG. Added size__microephys with um² units. * fix(schema): remove use of dimension_unit in microephys * cleanup: remove unused surgery_date column (moved as comment to PR #1839) * fix(desc): include microephys for channel column in events * fix(typo): microeelectrode in events * refactor(schema): use base x/y/z columns with addendums for electrodes * change(units): remove unavailble dimension_unit reference and add um in accordance with ProbeInterface norms * fix(docs): add link to markdown for 2D coordinate systems * cleanup: remove resolved TODO comment by 6284d36 * cleanup(rule): remove unsused older check for coordystem file * future cleanup(schema): add a comment of a potential column desc unification * refactor(schema): use base unit column like iEEG for channels * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Cody Baker <51133164+CodyCBakerPhD@users.noreply.github.com> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * enh(schema): add electrode_name, make reference optional and generalize probe_name * Remove dimension_unit from electrode table description * Remove redundant statement about required columns order in *_electrodes.tsv file * move description of electrode position columns in microelectrode electrophysiology documentation * cleanup: remove additions to events that are not microephys specific * Remove outdated comments and streamline pharmaceuticals section in microelectrode electrophysiology documentation * update source attribution to BrainSTEM * fix(linter): fix remark linter error * fix(build): add missing closing ticks for TSV in md * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * Update src/modality-specific-files/microelectrode-electrophysiology.md Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de> * docs(ephys): add electrode_name column to channels table example Add electrode_name column to the extracellular electrophysiology channels.tsv example to show the mapping between channels and their corresponding electrodes. * fix(microephys): move reference__microephys to be optional in channels schema * move reference__microephys * fix(coordinate-systems): update link format for Microelectrode Surgical Coordinates appendix to markdown * fix: Correct formatting in electrode data table for clarity * fix: Correct electrode name formatting in electrophysiology examples for consistency * docs: correct coordinate system descriptions and references - Fix WaxholmSpace species from rat to mouse and update DOI reference - Remove RRID links from SwansonRat, CHARM, D99, and MarmosetBrainAtlas - Add DOI link for SwansonRat reference - Correct PaxinosRhesusMonkey author list (Toga AW -> Evrard, H) * fix: Add ignore rule for SciCrunch URLs in link checker --------- Co-authored-by: Julia Sprenger <julia.sprenger@rwth-aachen.de> Co-authored-by: Yaroslav Halchenko <debian@onerussian.com> Co-authored-by: Horea Christian <chr@chymera.eu> Co-authored-by: Remi Gau <remi_gau@hotmail.com> Co-authored-by: Peyman Najafi <najafe.peyman@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Reema Gupta <59512969+ree-gupta@users.noreply.github.com> Co-authored-by: Ben Dichter <ben.dichter@gmail.com> Co-authored-by: Reema Gupta <reema.gupta@lmu.de> Co-authored-by: Lyuba Zehl <lyuba.zehl@ebrains.eu> Co-authored-by: Chris Markiewicz <markiewicz@stanford.edu> Co-authored-by: christinerogers <christinerogers@users.noreply.github.com> Co-authored-by: Thomas Wachtler <wachtler@bio.lmu.de>
1 parent 92e5400 commit b9a0d2e

34 files changed

Lines changed: 2247 additions & 13 deletions

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
--ignore-url 'https://jsoneditoronline.org' \
5050
--ignore-url 'https://rrid.site.*' \
5151
--ignore-url 'https://jsr.io/.*' \
52+
--ignore-url 'https://scicrunch.org/resolver/.*' \
5253
~/project/site/*html ~/project/site/*/*.html
5354
else
5455
echo "Release PR - do nothing"

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ nav:
2424
- Near-Infrared Spectroscopy: modality-specific-files/near-infrared-spectroscopy.md
2525
- Motion: modality-specific-files/motion.md
2626
- Magnetic Resonance Spectroscopy: modality-specific-files/magnetic-resonance-spectroscopy.md
27+
- Microelectrode Electrophysiology: modality-specific-files/microelectrode-electrophysiology.md
2728
- Electromyography: modality-specific-files/electromyography.md
2829
- Derivatives:
2930
- BIDS Derivatives: derivatives/introduction.md
@@ -45,6 +46,7 @@ nav:
4546
- MEG file formats: appendices/meg-file-formats.md
4647
- MEG systems: appendices/meg-systems.md
4748
- Coordinate systems: appendices/coordinate-systems.md
49+
- Microelectrode surgical coordinates: appendices/microelectrode-surgical-coordinates.md
4850
- Quantitative MRI: appendices/qmri.md
4951
- Arterial Spin Labeling: appendices/arterial-spin-labeling.md
5052
- Cross modality correspondence: appendices/cross-modality-correspondence.md

src/appendices/coordinate-systems.md

Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,162 @@ Please note that `space-scanner` SHOULD NOT be used, it is mentioned in this spe
255255
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
256256
| scanner | The intrinsic coordinate system of the original image (the first entry of `RawSources`) after reconstruction and conversion to NIfTI or equivalent for the case of surfaces and dual volume/surface files. |
257257

258+
## Microelectrode Electrophysiology Specific Coordinate Systems
259+
260+
Restricted keywords for the `MicroephysCoordinateSystem` field in the
261+
`coordsystem.json` file for microelectrode electrophysiology datasets (both `icephys` and `ecephys`):
262+
263+
<table>
264+
<thead>
265+
<tr>
266+
<th><strong>Coordinate System</strong></th>
267+
<th><strong>Description</strong></th>
268+
<th><strong>Reference</strong></th>
269+
</tr>
270+
</thead>
271+
<tbody>
272+
<tr>
273+
<td>Pixels</td>
274+
<td>
275+
If electrodes are localized in 2D space (x and y are specified and z is <code>n/a</code>), then the
276+
positions in this file must correspond to the locations expressed in pixels on the
277+
photo/drawing/rendering of the electrodes on the brain. In this case, coordinates must be
278+
(row,column) pairs, with (0,0) corresponding to the upper left pixel and (N,0) corresponding
279+
to the lower left pixel.
280+
</td>
281+
<td></td>
282+
</tr>
283+
<tr>
284+
<td>Stereotaxic</td>
285+
<td>
286+
A generic stereotaxic coordinate system commonly used in animal neuroscience for surgical targeting
287+
and electrode localization. The origin is at bregma, a skull landmark defined as the intersection
288+
of the coronal and sagittal sutures. The three axes are: AP (Anterior-Posterior) with positive values
289+
anterior to the reference point, ML (Medial-Lateral) with positive values to the right of midline,
290+
and DV (Dorsal-Ventral) with positive values ventral to the reference point.
291+
See the [Microelectrode Surgical Coordinates](microelectrode-surgical-coordinates.md)
292+
appendix for detailed axis conventions and angle definitions.
293+
Units are typically in millimeters or micrometers.
294+
</td>
295+
<td></td>
296+
</tr>
297+
<tr>
298+
<td>AllenCCFv3</td>
299+
<td>
300+
Allen Common Coordinate Framework version 3 (<a href="https://scicrunch.org/resolver/RRID:SCR_020999">RRID:SCR_020999</a>),
301+
a 3D reference space for the mouse brain based on average anatomy. The framework provides a systematic
302+
way to map and compare data across different experiments and labs. Origin and orientation follow the
303+
Allen Institute conventions.
304+
</td>
305+
<td><a href="https://doi.org/10.1016/j.cell.2020.04.007">doi:10.1016/j.cell.2020.04.007</a></td>
306+
</tr>
307+
<tr>
308+
<td>WaxholmSpace</td>
309+
<td>
310+
A standardized 3D coordinate system for the mouse brain (<a href="https://scicrunch.org/resolver/RRID:SCR_001592">RRID:SCR_001592</a>)
311+
based on high-resolution imaging data.
312+
</td>
313+
<td><a href="https://doi.org/10.1016/j.neuroimage.2010.06.067">doi:10.1016/j.neuroimage.2010.06.067</a></td>
314+
</tr>
315+
<tr>
316+
<td>WistarRatAtlas</td>
317+
<td>
318+
A multidimensional magnetic resonance histology atlas of the adult Wistar rat brain
319+
(<a href="https://scicrunch.org/resolver/RRID:SCR_006288">RRID:SCR_006288</a>). This atlas provides
320+
high-resolution anatomical reference for rat brain studies.
321+
</td>
322+
<td><a href="https://doi.org/10.1016/j.neuroimage.2012.05.041">doi:10.1016/j.neuroimage.2012.05.041</a></td>
323+
</tr>
324+
<tr>
325+
<td>PaxinosWatson</td>
326+
<td>
327+
The Paxinos and Watson rat brain atlas (<a href="https://scicrunch.org/resolver/RRID:SCR_006369">RRID:SCR_006369</a>),
328+
a widely used stereotaxic coordinate system for the rat brain.
329+
Provides standardized coordinates based on skull landmarks (bregma, lambda) for targeting brain structures.
330+
Multiple editions available; users should specify the edition used in <code>MicroephysCoordinateSystemDescription</code>.
331+
</td>
332+
<td>Paxinos G, Watson C. The Rat Brain in Stereotaxic Coordinates. Academic Press.</td>
333+
</tr>
334+
<tr>
335+
<td>FranklinPaxinos</td>
336+
<td>
337+
The Franklin and Paxinos mouse brain atlas (<a href="https://scicrunch.org/resolver/RRID:SCR_007127">RRID:SCR_007127</a>),
338+
a widely used stereotaxic coordinate system for the mouse brain.
339+
Provides standardized coordinates based on skull landmarks (bregma, lambda) for targeting brain structures.
340+
Multiple editions available; users should specify the edition used in <code>MicroephysCoordinateSystemDescription</code>.
341+
</td>
342+
<td>Franklin KBJ, Paxinos G. The Mouse Brain in Stereotaxic Coordinates. Academic Press.</td>
343+
</tr>
344+
<tr>
345+
<td>SwansonRat</td>
346+
<td>
347+
The Swanson rat brain atlas, a widely used stereotaxic coordinate system for the rat brain.
348+
Provides detailed cytoarchitectonic parcellation and standardized coordinates for targeting brain structures.
349+
Multiple editions available; users should specify the edition used in <code>MicroephysCoordinateSystemDescription</code>.
350+
</td>
351+
<td><a href="https://doi.org/10.1002/cne.24381">Swanson LW. Brain Maps: Structure of the Rat Brain. Elsevier.</a></td>
352+
</tr>
353+
<tr>
354+
<td>CHARM</td>
355+
<td>
356+
Cortical Hierarchy Atlas of the Rhesus Macaque, a modern MRI-based atlas for the macaque brain.
357+
Provides hierarchical cortical parcellation based on anatomical connectivity patterns.
358+
</td>
359+
<td><a href="https://doi.org/10.1016/j.neuroimage.2021.117997">doi:10.1016/j.neuroimage.2021.117997</a></td>
360+
</tr>
361+
<tr>
362+
<td>D99</td>
363+
<td>
364+
Digital version of the Saleem and Logothetis macaque brain atlas.
365+
Provides detailed parcellation of the rhesus macaque brain based on histological sections.
366+
</td>
367+
<td><a href="https://doi.org/10.1093/cercor/bhw248">doi:10.1093/cercor/bhw248</a></td>
368+
</tr>
369+
<tr>
370+
<td>PaxinosMacaque</td>
371+
<td>
372+
The Paxinos rhesus macaque brain atlas, a stereotaxic coordinate system for the macaque brain.
373+
Provides standardized coordinates based on stereotaxic landmarks for targeting brain structures.
374+
Multiple editions available; users should specify the edition used in <code>MicroephysCoordinateSystemDescription</code>.
375+
</td>
376+
<td>Paxinos G, Huang XF, Petrides M, Evrard, H. The Rhesus Monkey Brain in Stereotaxic Coordinates. Academic Press.</td>
377+
</tr>
378+
<tr>
379+
<td>MarmosetBrainAtlas</td>
380+
<td>
381+
A standardized 3D coordinate system for the common marmoset brain.
382+
Provides high-resolution anatomical reference for marmoset brain studies.
383+
</td>
384+
<td><a href="https://doi.org/10.1016/j.neuroimage.2017.12.004">doi:10.1016/j.neuroimage.2017.12.004</a></td>
385+
</tr>
386+
<tr>
387+
<td>individual</td>
388+
<td>
389+
Subject-specific anatomical coordinate system derived from the individual subject's anatomy. The origin
390+
and orientation should be specified in <code>MicroephysCoordinateSystemDescription</code>. This coordinate
391+
system requires specifying an additional, subject-specific file to be fully defined.
392+
</td>
393+
<td></td>
394+
</tr>
395+
<tr>
396+
<td>Other</td>
397+
<td>
398+
Use this for other coordinate systems and specify all required details in the
399+
<code>MicroephysCoordinateSystemDescription</code> field.
400+
</td>
401+
<td></td>
402+
</tr>
403+
</tbody>
404+
</table>
405+
406+
If you believe a specific coordinate system should be added to the list
407+
of restricted keywords for microelectrode electrophysiology, please open a new issue on the
408+
[bids-standard/bids-specification GitHub repository](https://github.com/bids-standard/bids-specification/issues/new/choose).
409+
410+
For detailed information about coordinate systems in microelectrode electrophysiology,
411+
including probe angles and anatomical reference points, see the
412+
[Microelectrode Electrophysiology specification](../modality-specific-files/microelectrode-electrophysiology.md#coordinate-system-json-_coordsystemjson).
413+
258414
<!-- Link Definitions -->
259415

260416
[common file level metadata fields]: ../derivatives/common-data-types.md#common-file-level-metadata-fields
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Microelectrode Surgical Coordinates
2+
3+
The surgical coordinates system provides a standard way to describe the placement of an intracranial probe implantation during surgery.
4+
5+
## Anatomical Reference Points
6+
7+
In neurosurgery and research, it can be important to define coordinates for where in the brain a surgical intervention will take place.
8+
These coordinates rely on anatomical markers that are uniform across individuals.
9+
There are two major anatomical markers on the dorsal surface of the brain that are formed when the plates of the skull fuse during development, and these markers are often used to identify the location of various anatomical structures of the brain.
10+
11+
<img src="../modality-specific-files/images/bregma_and_lambda.png" alt="Bregma and Lambda anatomical reference points" style="max-width: 600px;">
12+
13+
**Bregma**: the anatomical point on the skull at which the coronal suture (between frontal and parietal bones) is intersected perpendicularly by the sagittal suture (between left and right parietal bones).
14+
15+
**Lambda**: the meeting point of the sagittal suture (between left and right parietal bones) and the lambdoid suture (between parietal and occipital bones).
16+
17+
Both points serve as standard reference points for stereotaxic coordinates in neuroscience research. `(0,0,0)` is assumed to be Bregma when working with rodents. It may optionally be defined differently using `anatomical_reference_point`, and MUST be defined for other species.
18+
19+
## Stereotaxic Coordinate System Conventions
20+
21+
All stereotaxic coordinate systems follow a right-handed coordinate system with the following conventions:
22+
23+
<img src="../modality-specific-files/images/AP_ML_DV.png" alt="AP_ML_DV coordinate system" style="max-width: 600px;">
24+
25+
- **AP (Anterior-Posterior) axis:** Positive values are anterior to reference point
26+
- **ML (Medial-Lateral) axis:** Positive values are to the right (as seen from behind)
27+
- **DV (Dorsal-Ventral) axis:** Positive values are ventral (following right-hand rule). For humans, this is the superior-inferior axis, and positive values point to inferior.
28+
29+
Proper understanding and application of these angles is critical for accurate probe placement and experimental reproducibility. All stereotaxic measurements use three angles to specify orientation:
30+
31+
### AP angle (Anterior-Posterior rotation)
32+
33+
<img src="../modality-specific-files/images/AP_angle.png" alt="AP angle rotation diagram" style="max-width: 600px;">
34+
35+
- Measured as rotation from the vertical axis in the sagittal plane
36+
- 0° represents vertical along DV axis
37+
- Range: -180° to +180°
38+
- Positive values indicate anterior rotation
39+
- Example: +15° indicates probe tilted 15° anteriorly from vertical
40+
41+
### ML angle (Medial-Lateral rotation)
42+
43+
<img src="../modality-specific-files/images/ML_angle.png" alt="ML angle rotation diagram" style="max-width: 600px;">
44+
45+
- Measured as rotation from the vertical axis in the coronal plane
46+
- 0° represents vertical along DV axis
47+
- Range: -180° to +180°
48+
- Positive values indicate rightward/clockwise rotation (as seen from behind)
49+
- Example: +20° indicates probe tilted 20° to the right from vertical
50+
51+
### Rotation angle (around probe axis)
52+
53+
<img src="../modality-specific-files/images/rotation_angle.png" alt="Rotation angle diagram" style="max-width: 600px;">
54+
55+
- 0° when probe features align with the coronal plane
56+
- Range: -180° to +180° (or 0° to 360°)
57+
- Positive rotation is clockwise when viewed from above
58+
59+
!!! note "Source Attribution"
60+
61+
The coordinate system conventions and angle definitions presented in this section are adapted from the [BrainSTEM documentation](https://support.brainstem.org/datamodel/schemas/coordinates/). MIT License; Copyright (c) 2025 Peter C. Petersen
108 KB
Loading
298 KB
Loading
209 KB
Loading
132 KB
Loading
132 KB
Loading
125 KB
Loading

0 commit comments

Comments
 (0)