ndx-brainstem
An NWB extension that stores BrainSTEM experimental metadata inside an NWB file: the BrainSTEM records the file was made from, with every field, and the links between them.
Files are written by brainstem-nwb (brainstem-nwb export --extension brainstem). Core NWB fields (Subject, Devices, electrode groups, epochs and the text fields) describe the experiment for every NWB reader. This extension adds the structured detail behind them, so nothing BrainSTEM records is lost.
Status: pre-release (0.2.0). The schema may change before 1.0.
Installation
pip install ndx-brainstem
What a file contains
/general/brainstem (BrainstemMetadata, a LabMetaData) holds:
- Provenance attributes: export format version and scope, export time, the checksum of the source export (
source_sha256) and of the file's content (content_sha256), the BrainSTEM project, session, subject and unit ids, and the exporter and mapping versions. - One
BrainstemTableper kind of record, for exampleprocedures,materials,interfaces,acquisitions,manipulations,behaviors,specimen_sets,specimens,logs,log_entries,regions,catalog,lab_resourcesandpeople. Each row is one BrainSTEM record. The spec fixes no table names; the writer's current list is in brainstem-nwb's extensions documentation. schemas(BrainstemSchemaTable): every BrainSTEM JSON schema the tables name, with its stable URL (published versions never change) and, when embedded, the schema itself.
BrainstemTable columns
| Column | Type | Contents |
|---|---|---|
brainstem_id, brainstem_model |
required text | The record's BrainSTEM id and model label (e.g. modules.procedure) |
| one per BrainSTEM field | text | Strings as stored. Other values (numbers, booleans, JSON objects such as type_json) are JSON text. An empty string means no value |
| one per link field | ragged DynamicTableRegion |
Rows of another BrainstemTable, or of /intervals/epochs |
details_schema, coordinates_schema |
text | <Family>/<Type>@<version> of the record's typed details or coordinates, e.g. Procedure/VirusInjection@3.0.0 |
unresolved_links |
text | JSON {field: [ids]} of links to records not in the file |
| writer-defined | text or DynamicTableRegion |
Columns the writer adds beyond the fields, such as nwb_device (the NWB device a row became), nwb_epochs (rows of /intervals/epochs), log and catalog_entry (links to the parent log or catalog entry). A field whose name a DynamicTable reserves is written as record_<field>; a *_time field also gets an ISO 8601 copy named <field>_iso |
The table attribute brainstem_models lists the model labels of the table's rows.
Reading
from pynwb import NWBHDF5IO
with NWBHDF5IO("sub-X_ses-Y.nwb", "r") as io:
nwbfile = io.read()
brainstem = nwbfile.lab_meta_data["brainstem"]
procedures = brainstem.brainstem_tables["procedures"].to_dataframe()
NWB stores the extension's schema in every file, so pynwb (and MatNWB) can read these files without installing this package.
Installation (development)
pip install -e . --group dev # pip 25.1 or newer; or: pip install -e . && pip install pytest
python src/spec/create_extension_spec.py # regenerate spec/*.yaml after changing the spec
pytest
This extension was created with ndx-template.
Metadata
Release files for ndx-brainstem 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ndx_brainstem-0.2.0.tar.gz | 17.8 kB | Without provenance | Details for ndx_brainstem-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ndx_brainstem-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for ndx_brainstem-0.2.0-py3-none-any.whl |
Total release size: 24.4 kB
Release files / ndx_brainstem-0.2.0.tar.gz
| Download URL | ndx_brainstem-0.2.0.tar.gz |
|---|---|
| Size | 17.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b8c4502457083fc107b60cafa9ab96aad39f7de291ae236b5388c1519125077
|
|
BLAKE2b-256 checksum How to use checksums |
1e8346f6766b7ecafd41d9a651a713af6213fd83ef87b9629780d358b9cef6d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.16
|
Release files / ndx_brainstem-0.2.0-py3-none-any.whl
| Download URL | ndx_brainstem-0.2.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
062cc8f6e6ef8ef2cce45a0db14128fea015a9864e9c44a8e2bd43c7a09d8b55
|
|
BLAKE2b-256 checksum How to use checksums |
1f959afd2bab2f123d7ae70975083cc703c6efce644d3f60571edc8add0dcc8e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.16
|
Security for ndx-brainstem 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.