Release Notes#
Version 1.0.0#
Migration to PyNWB 4.0.0. NWBEP001 (EventsTable, MeaningsTable, TimestampVectorData,
DurationVectorData, etc.) has been merged into PyNWB core, so ndx-hed no longer depends on the
standalone ndx-events extension.
Breaking Changes
Requires
pynwb>=4.0.0andhdmf>=6.1.0; thendx-eventsdependency has been removed. ImportEventsTable,TimestampVectorData, andDurationVectorDatafrompynwb.event, andMeaningsTablefromhdmf.common. Use the standardpynwb.NWBFile.There is no
CategoricalVectorDatatype (the categorical column type formerly provided by thendx-eventsextension); anyDynamicTablecolumn can be annotated by aMeaningsTable.A
MeaningsTableis now bound to the column it annotates via a requiredtargetargument and is named"{column_name}_meanings"automatically. Attach it withtable.add_meanings_table()and retrieve it withtable.get_meanings_for_column(col_name).HED column rules: a
HedTagscolumn must be named"HED"(so at most one perDynamicTable); inside aMeaningsTableit provides categorical HED, elsewhere per-row HED. AHedValueVectormust not appear in aMeaningsTable. TheHedValueVectorschema doc was corrected (it previously stated “Always has the name HED”).
Changes
bids2nwbutilities updated for the new API (categorical columns are plainVectorDataannotated by an attachedMeaningsTable).HedNWBValidator.validate_file()runs assembled (BIDS-style) validation on everyDynamicTableexceptMeaningsTable. Categorical HED is validated as part of the target table it annotates (its levels are folded into that table’s sidecar), so aMeaningsTableis not validated on its own; it is only checked against the structural rule that it must not contain aHedValueVectorcolumn (which raisesValueError). Validation is temporal (timeline) when the table has anonsetcolumn and non-temporal otherwise.HedLabMetaDatais unchanged (still named “hed_schema”).
Version 0.2.0 (October 18, 2025)#
Major rewrite and expansion of the ndx-hed extension with three core classes and comprehensive tooling.
New Features
Core Classes#
HedLabMetaData: Required metadata container for storing HED schema version and optional custom definitions
Must be added to
NWBFilebefore using any HED annotationsSupports both standard and library schemas
Includes
DefinitionDictfor custom HED definitionsMethods:
get_hed_schema(),get_definition_dict(),add_definitions(),extract_definitions()
HedTags: VectorData subclass for row-specific HED annotations in DynamicTables
Must be named “HED” (enforced by constructor)
Stores one HED string per row
Works with any NWB DynamicTable (trials, units, epochs, etc.)
HedValueVector: VectorData subclass for column-wide HED templates with value placeholders
Stores numerical/categorical data with associated HED annotation template
Uses
#placeholder for values (e.g., “Duration/# s”)HED annotation applies to entire column
Validation System#
HedNWBValidator: Comprehensive validation class for HED annotations in NWB files
validate_file(): Validates entireNWBFilevalidate_dynamic_table(): Validates specific DynamicTablevalidate_hed_tags(): Validates individual HedTags columnvalidate_hed_value_vector(): Validates HedValueVector columnsSupports both in-memory and file-based validation
BIDS Integration#
Bidirectional BIDS ↔ NWB conversion utilities in
utils/bids2nwb.py:extract_meanings(): Converts BIDS JSON sidecars to meanings dictionaryget_categorical_meanings(): Creates MeaningsTable from BIDS categorical columnsget_events_table(): Converts BIDS events.tsv + sidecar to NWB EventsTableget_bids_events(): Converts EventsTable back to BIDS format (DataFrame + sidecar)extract_definitions(): Extracts HED definitions from BIDS sidecars
ndx-events Integration#
Full support for EventsTable, MeaningsTable, CategoricalVectorData
Three integration patterns:
Direct HED column for event-specific annotations
HedValueVector columns for shared annotations with values
Categorical columns with HED in MeaningsTable
Examples
Seven comprehensive runnable examples demonstrating all features:
01_basic_hed_classes.py: Introduction to HedLabMetaData, HedTags, and HedValueVector02_trials_with_hed.py: Adding HED annotations to NWB trials table03_events_table_integration.py: Three patterns for EventsTable integration04_bids_conversion.py: Bidirectional BIDS ↔ NWB conversion workflows05_hed_validation.py: Comprehensive validation examples06_complete_workflow.py: End-to-end workflow with file I/O07_hed_definitions.py: Custom HED definitions and expansion
Dependencies
Updated to
hedtools>=0.7.1(released to PyPI)pynwb>=2.8.2hdmf>=3.14.1Optional:
ndx-events>=0.4.0for EventsTable support
Testing
116+ comprehensive test cases
Full coverage of all core classes and utilities
File I/O roundtrip testing
Validation testing with valid and invalid HED
BIDS conversion roundtrip testing
Definition handling and persistence testing
Breaking Changes from 0.1.0
HedTags constructor changes: Removed
hed_versionparameter (now uses HedLabMetaData)New requirement: HedLabMetaData must be added to
NWBFilebefore using HED annotationsName enforcement: HedTags must be named “HED”, HedLabMetaData must be named “hed_schema”
Documentation
Updated user guide for 0.2.0 architecture
Comprehensive example suite with runnable code
Updated README with Quick Start guide
Version 0.1.0 (July 25, 2024)#
Initial Release
Implements a
HedTagsclass that extends NWBVectorDataValidates tags in the constructor and as they are added
The
HedTagsclass can be used alone or added to anyDynamicTableInitial release only supports string HED version specifications, not tuples or lists
Features
Basic HED tag validation
Integration with NWB DynamicTables
Support for standard HED schemas
Limitations
No centralized schema management
No support for custom definitions
No validation utilities
No BIDS integration