This directory contains Jupyter notebooks that provide interactive workflows for annotation, validation, and analysis.
📖 For detailed documentation, see the Jupyter notebooks section
| Notebook | Purpose |
|---|---|
| extract_json_template.ipynb | Create JSON sidecar template from all event files in dataset |
| find_event_combinations.ipynb | Extract unique combinations of column values |
| merge_spreadsheet_into_sidecar.ipynb | Merge edited 4-column spreadsheet back into JSON sidecar |
| sidecar_to_spreadsheet.ipynb | Convert JSON sidecar to 4-column spreadsheet for editing |
| summarize_events.ipynb | Summarize event file contents and value distributions |
| validate_bids_dataset.ipynb | Validate HED annotations in a BIDS dataset |
| validate_bids_dataset_with_libraries.ipynb | Validate with HED library schemas |
| validate_bids_datasets.ipynb | Batch validate multiple BIDS datasets |
- Python 3.10+ required
- These notebooks are only available in the GitHub repository, not in the PyPI distribution
# Clone the repository
git clone https://github.com/hed-standard/hed-python.git
cd hed-python/examples
# Install dependencies
pip install hedtools jupyter notebook
# Launch Jupyter
jupyter notebook# Download just the examples directory
svn export https://github.com/hed-standard/hed-python/trunk/examples
cd examples
pip install hedtools jupyter notebook
jupyter notebookA recommended workflow for annotating a new BIDS dataset:
- 📊 Summarize events → Understand your event structure
- 📝 Extract template → Create initial JSON sidecar
- 📋 Convert to spreadsheet → Easier editing format
- ✏️ Edit annotations → Add HED tags in spreadsheet
- 🔄 Merge back → Convert spreadsheet to JSON
- ✅ Validate → Check for errors, iterate until valid
Creates a JSON sidecar template based on all unique values found across all event files in your BIDS dataset.
Key parameters: dataset_path, exclude_dirs, skip_columns, value_columns
Extracts all unique combinations of values across specified columns, useful for understanding column relationships or creating recoding mappings.
Key parameters: dataset_path, key_columns, output_path
Merges a 4-column spreadsheet (with edited HED annotations) back into a BIDS JSON sidecar file (which could be empty).
Key parameters: spreadsheet_path, sidecar_path, description_tag, output_path
Converts the HED content of a JSON sidecar into a 4-column spreadsheet for easier viewing and editing.
Output format: column_name | column_value | description | HED
Provides an overview of event file structure, column names, and value distributions across the entire dataset.
Key parameters: dataset_path, exclude_dirs, skip_columns, value_columns
Validates all HED annotations in a BIDS dataset against the specified schema.
Key parameters: dataset_path, check_for_warnings
Note: This validates HED only, not full BIDS compliance.
Demonstrates validation using multiple schemas (base schema + library schemas like SCORE).
Use case: Datasets using specialized vocabularies beyond the base HED schema.
Convenience notebook for batch validation across multiple BIDS datasets.
- 📚 Full documentation: docs/user_guide.md
- 🔧 API reference: docs/api/index.rst
- 🌐 Online tools: hedtools.org/hed - No programming required
- 📖 HED specification: www.hedtags.org/hed-specification
- 🎓 HED resources: www.hedtags.org/hed-resources
- 💬 Get help: GitHub issues
- BIDS structure required: These notebooks expect standard BIDS directory structure
- Inheritance handling: Automatically processes BIDS sidecar inheritance
- Exclude directories: Always exclude
derivatives,code,stimuli,sourcedata - Skip columns: Typically skip
onset,duration,sample(BIDS-predefined) - Value columns: Columns with continuous data (annotated with
#placeholder)