nwb-video-widgets 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. nwb_video_widgets-0.1.0/.github/workflows/auto-publish.yml +39 -0
  2. nwb_video_widgets-0.1.0/.github/workflows/tests.yml +31 -0
  3. nwb_video_widgets-0.1.0/.gitignore +214 -0
  4. nwb_video_widgets-0.1.0/LICENSE +21 -0
  5. nwb_video_widgets-0.1.0/PKG-INFO +174 -0
  6. nwb_video_widgets-0.1.0/README.md +141 -0
  7. nwb_video_widgets-0.1.0/assets/pose_estimation_preprocessed.gif +0 -0
  8. nwb_video_widgets-0.1.0/assets/video_widget_preprocessed.gif +0 -0
  9. nwb_video_widgets-0.1.0/documentation/design/intro.md +129 -0
  10. nwb_video_widgets-0.1.0/documentation/design/pose_estimation_widget/intro.md +503 -0
  11. nwb_video_widgets-0.1.0/documentation/design/video_widget/intro.md +271 -0
  12. nwb_video_widgets-0.1.0/documentation/design/video_widget/local_video_serving.md +149 -0
  13. nwb_video_widgets-0.1.0/documentation/design/video_widget/video_synchronization.md +178 -0
  14. nwb_video_widgets-0.1.0/pyproject.toml +69 -0
  15. nwb_video_widgets-0.1.0/src/nwb_video_widgets/__init__.py +16 -0
  16. nwb_video_widgets-0.1.0/src/nwb_video_widgets/_utils.py +328 -0
  17. nwb_video_widgets-0.1.0/src/nwb_video_widgets/dandi_pose_widget.py +356 -0
  18. nwb_video_widgets-0.1.0/src/nwb_video_widgets/dandi_video_widget.py +155 -0
  19. nwb_video_widgets-0.1.0/src/nwb_video_widgets/local_pose_widget.py +334 -0
  20. nwb_video_widgets-0.1.0/src/nwb_video_widgets/local_video_widget.py +130 -0
  21. nwb_video_widgets-0.1.0/src/nwb_video_widgets/pose_widget.css +624 -0
  22. nwb_video_widgets-0.1.0/src/nwb_video_widgets/pose_widget.js +798 -0
  23. nwb_video_widgets-0.1.0/src/nwb_video_widgets/video_widget.css +484 -0
  24. nwb_video_widgets-0.1.0/src/nwb_video_widgets/video_widget.js +566 -0
  25. nwb_video_widgets-0.1.0/src/nwb_video_widgets/video_widget.py +170 -0
  26. nwb_video_widgets-0.1.0/tests/__init__.py +1 -0
  27. nwb_video_widgets-0.1.0/tests/conftest.py +89 -0
  28. nwb_video_widgets-0.1.0/tests/fixtures/__init__.py +1 -0
  29. nwb_video_widgets-0.1.0/tests/fixtures/synthetic_nwb.py +52 -0
  30. nwb_video_widgets-0.1.0/tests/fixtures/synthetic_video.py +53 -0
  31. nwb_video_widgets-0.1.0/tests/integration/__init__.py +1 -0
  32. nwb_video_widgets-0.1.0/tests/integration/test_local_roundtrip.py +90 -0
  33. nwb_video_widgets-0.1.0/tests/test_local_video_widget.py +96 -0
  34. nwb_video_widgets-0.1.0/tests/test_utils.py +126 -0
@@ -0,0 +1,39 @@
1
+ # Publish to PyPI when a GitHub Release is published AND the tag starts with 'v'.
2
+ # Uses PyPI Trusted Publishing (no API token needed).
3
+
4
+ name: Upload Package to PyPI
5
+
6
+ on:
7
+ release:
8
+ types: [published]
9
+
10
+ permissions:
11
+ contents: read
12
+ id-token: write # required for PyPI Trusted Publishing
13
+
14
+ jobs:
15
+ deploy:
16
+ # Only run if the release tag starts with 'v' (e.g., v0.1.0)
17
+ if: startsWith(github.event.release.tag_name, 'v')
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.12"
27
+
28
+ - name: Install build tooling
29
+ run: |
30
+ python -m pip install --upgrade pip
31
+ python -m pip install --upgrade build
32
+
33
+ - name: Build distributions
34
+ run: python -m build
35
+
36
+ - name: Publish to PyPI (OIDC + attestations)
37
+ uses: pypa/gh-action-pypi-publish@v1.12.4
38
+ with:
39
+ attestations: true
@@ -0,0 +1,31 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ${{ matrix.os }}
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ os: [ubuntu-latest, windows-latest, macos-latest]
16
+ python-version: ["3.10", "3.13"]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+
24
+ - name: Set up Python ${{ matrix.python-version }}
25
+ run: uv python install ${{ matrix.python-version }}
26
+
27
+ - name: Install dependencies
28
+ run: uv sync --all-extras
29
+
30
+ - name: Run tests
31
+ run: uv run pytest tests/ -v
@@ -0,0 +1,214 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
208
+ widget_notebook.ipynb
209
+ design_docs/drafts
210
+
211
+ # Original large GIFs (use preprocessed versions instead)
212
+ assets/pose_estimation..gif
213
+ assets/video_widget.gif
214
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 CatalystNeuro
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: nwb-video-widgets
3
+ Version: 0.1.0
4
+ Summary: Interactive Jupyter widgets for NWB video and pose visualization
5
+ Project-URL: Homepage, https://github.com/catalystneuro/nwb-video-widgets
6
+ Project-URL: Repository, https://github.com/catalystneuro/nwb-video-widgets
7
+ Author: Heberto Mayorquin
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Keywords: anywidget,jupyter,neuroscience,nwb,pose,video,widget
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Framework :: Jupyter
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Requires-Python: >=3.10
20
+ Requires-Dist: anywidget>=0.9.0
21
+ Requires-Dist: matplotlib
22
+ Requires-Dist: numpy
23
+ Requires-Dist: pynwb
24
+ Provides-Extra: dandi
25
+ Requires-Dist: dandi>=0.60.0; extra == 'dandi'
26
+ Requires-Dist: h5py; extra == 'dandi'
27
+ Requires-Dist: remfile>=0.1.13; extra == 'dandi'
28
+ Provides-Extra: test
29
+ Requires-Dist: opencv-python-headless; extra == 'test'
30
+ Requires-Dist: pytest-cov; extra == 'test'
31
+ Requires-Dist: pytest>=7.0; extra == 'test'
32
+ Description-Content-Type: text/markdown
33
+
34
+ # nwb-video-widgets
35
+
36
+ [![PyPI version](https://badge.fury.io/py/nwb-video-widgets.svg)](https://badge.fury.io/py/nwb-video-widgets)
37
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
38
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
39
+
40
+ Interactive Jupyter widgets for NWB video and pose estimation visualization. Built with [anywidget](https://anywidget.dev/) for compatibility across JupyterLab, Jupyter Notebook, VS Code, and Google Colab.
41
+
42
+ ## Table of Contents
43
+
44
+ - [Installation](#installation)
45
+ - [Video Player Widgets](#video-player-widgets)
46
+ - [Pose Estimation Widgets](#pose-estimation-widgets)
47
+ ## Installation
48
+
49
+ For local only NWB file usage:
50
+
51
+ ```bash
52
+ pip install nwb-video-widgets
53
+ ```
54
+
55
+ For DANDI integration and streaming support:
56
+
57
+ ```bash
58
+ pip install nwb-video-widgets[dandi]
59
+ ```
60
+
61
+ ## Video Player Widgets
62
+
63
+ Multi-camera synchronized video player with configurable layout (Row, Column, or Grid).
64
+
65
+ ![Video Widget Demo](assets/video_widget_preprocessed.gif)
66
+
67
+ **Features:**
68
+
69
+ - Interactive settings panel for video selection
70
+ - Multiple layout modes (Row, Column, Grid)
71
+ - Synchronized playback across all videos
72
+ - Session time display with NWB timestamps
73
+
74
+ ### DANDI Streaming
75
+
76
+ Use `NWBDANDIVideoPlayer` for videos hosted on DANDI:
77
+
78
+ ```python
79
+ from dandi.dandiapi import DandiAPIClient
80
+ from nwb_video_widgets import NWBDANDIVideoPlayer
81
+
82
+ client = DandiAPIClient()
83
+ dandiset = client.get_dandiset("000409", "draft")
84
+ asset = dandiset.get_asset_by_path("sub-NYU-39/sub-NYU-39_ses-..._behavior.nwb")
85
+
86
+ widget = NWBDANDIVideoPlayer(asset=asset)
87
+ widget
88
+ ```
89
+
90
+ ### Local Files
91
+
92
+ Use `NWBLocalVideoPlayer` for local NWB files:
93
+
94
+ ```python
95
+ from pynwb import read_nwb
96
+ from nwb_video_widgets import NWBLocalVideoPlayer
97
+
98
+ nwbfile = read_nwb("experiment.nwb")
99
+ widget = NWBLocalVideoPlayer(nwbfile)
100
+ widget
101
+ ```
102
+
103
+ ---
104
+
105
+ ## Pose Estimation Widgets
106
+
107
+ Overlays DeepLabCut keypoints on streaming video with support for camera selection.
108
+
109
+ ![Pose Estimation Widget Demo](assets/pose_estimation_preprocessed.gif)
110
+
111
+ **Features:**
112
+
113
+ - Camera selection via settings panel
114
+ - Keypoint visibility toggles (All/None/individual)
115
+ - Label display toggle
116
+ - Session time display (NWB timestamps)
117
+ - Custom keypoint colors via colormap or explicit hex values
118
+ - Supports split files (videos in raw file, pose in processed file)
119
+
120
+ ### DANDI Streaming
121
+
122
+ Use `NWBDANDIPoseEstimationWidget` for DANDI-hosted files:
123
+
124
+ ```python
125
+ from dandi.dandiapi import DandiAPIClient
126
+ from nwb_video_widgets import NWBDANDIPoseEstimationWidget
127
+
128
+ client = DandiAPIClient()
129
+ dandiset = client.get_dandiset("000409", "draft")
130
+
131
+ # Single file (videos + pose in same file)
132
+ asset = dandiset.get_asset_by_path("sub-.../sub-..._combined.nwb")
133
+ widget = NWBDANDIPoseEstimationWidget(asset=asset)
134
+
135
+ # Or split files (videos in raw, pose in processed)
136
+ raw_asset = dandiset.get_asset_by_path("sub-.../sub-..._desc-raw.nwb")
137
+ processed_asset = dandiset.get_asset_by_path("sub-.../sub-..._desc-processed.nwb")
138
+ widget = NWBDANDIPoseEstimationWidget(
139
+ asset=processed_asset,
140
+ video_asset=raw_asset,
141
+ )
142
+ widget
143
+ ```
144
+
145
+ ### Local Files
146
+
147
+ Use `NWBLocalPoseEstimationWidget` for local NWB files:
148
+
149
+ ```python
150
+ from pynwb import read_nwb
151
+ from nwb_video_widgets import NWBLocalPoseEstimationWidget
152
+
153
+ # Single file
154
+ nwbfile = read_nwb("experiment.nwb")
155
+ widget = NWBLocalPoseEstimationWidget(nwbfile)
156
+ widget
157
+
158
+ # Or split files
159
+ nwbfile_raw = read_nwb("raw.nwb")
160
+ nwbfile_processed = read_nwb("processed.nwb")
161
+ widget = NWBLocalPoseEstimationWidget(
162
+ nwbfile=nwbfile_processed,
163
+ video_nwbfile=nwbfile_raw,
164
+ )
165
+ widget
166
+ ```
167
+
168
+ **Parameters:**
169
+
170
+ | Parameter | Type | Description |
171
+ |-----------|------|-------------|
172
+ | `keypoint_colors` | `str` or `dict` | Matplotlib colormap name (e.g., `'tab10'`) or dict mapping keypoint names to hex colors |
173
+ | `default_camera` | `str` | Camera to display initially |
174
+
@@ -0,0 +1,141 @@
1
+ # nwb-video-widgets
2
+
3
+ [![PyPI version](https://badge.fury.io/py/nwb-video-widgets.svg)](https://badge.fury.io/py/nwb-video-widgets)
4
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+
7
+ Interactive Jupyter widgets for NWB video and pose estimation visualization. Built with [anywidget](https://anywidget.dev/) for compatibility across JupyterLab, Jupyter Notebook, VS Code, and Google Colab.
8
+
9
+ ## Table of Contents
10
+
11
+ - [Installation](#installation)
12
+ - [Video Player Widgets](#video-player-widgets)
13
+ - [Pose Estimation Widgets](#pose-estimation-widgets)
14
+ ## Installation
15
+
16
+ For local only NWB file usage:
17
+
18
+ ```bash
19
+ pip install nwb-video-widgets
20
+ ```
21
+
22
+ For DANDI integration and streaming support:
23
+
24
+ ```bash
25
+ pip install nwb-video-widgets[dandi]
26
+ ```
27
+
28
+ ## Video Player Widgets
29
+
30
+ Multi-camera synchronized video player with configurable layout (Row, Column, or Grid).
31
+
32
+ ![Video Widget Demo](assets/video_widget_preprocessed.gif)
33
+
34
+ **Features:**
35
+
36
+ - Interactive settings panel for video selection
37
+ - Multiple layout modes (Row, Column, Grid)
38
+ - Synchronized playback across all videos
39
+ - Session time display with NWB timestamps
40
+
41
+ ### DANDI Streaming
42
+
43
+ Use `NWBDANDIVideoPlayer` for videos hosted on DANDI:
44
+
45
+ ```python
46
+ from dandi.dandiapi import DandiAPIClient
47
+ from nwb_video_widgets import NWBDANDIVideoPlayer
48
+
49
+ client = DandiAPIClient()
50
+ dandiset = client.get_dandiset("000409", "draft")
51
+ asset = dandiset.get_asset_by_path("sub-NYU-39/sub-NYU-39_ses-..._behavior.nwb")
52
+
53
+ widget = NWBDANDIVideoPlayer(asset=asset)
54
+ widget
55
+ ```
56
+
57
+ ### Local Files
58
+
59
+ Use `NWBLocalVideoPlayer` for local NWB files:
60
+
61
+ ```python
62
+ from pynwb import read_nwb
63
+ from nwb_video_widgets import NWBLocalVideoPlayer
64
+
65
+ nwbfile = read_nwb("experiment.nwb")
66
+ widget = NWBLocalVideoPlayer(nwbfile)
67
+ widget
68
+ ```
69
+
70
+ ---
71
+
72
+ ## Pose Estimation Widgets
73
+
74
+ Overlays DeepLabCut keypoints on streaming video with support for camera selection.
75
+
76
+ ![Pose Estimation Widget Demo](assets/pose_estimation_preprocessed.gif)
77
+
78
+ **Features:**
79
+
80
+ - Camera selection via settings panel
81
+ - Keypoint visibility toggles (All/None/individual)
82
+ - Label display toggle
83
+ - Session time display (NWB timestamps)
84
+ - Custom keypoint colors via colormap or explicit hex values
85
+ - Supports split files (videos in raw file, pose in processed file)
86
+
87
+ ### DANDI Streaming
88
+
89
+ Use `NWBDANDIPoseEstimationWidget` for DANDI-hosted files:
90
+
91
+ ```python
92
+ from dandi.dandiapi import DandiAPIClient
93
+ from nwb_video_widgets import NWBDANDIPoseEstimationWidget
94
+
95
+ client = DandiAPIClient()
96
+ dandiset = client.get_dandiset("000409", "draft")
97
+
98
+ # Single file (videos + pose in same file)
99
+ asset = dandiset.get_asset_by_path("sub-.../sub-..._combined.nwb")
100
+ widget = NWBDANDIPoseEstimationWidget(asset=asset)
101
+
102
+ # Or split files (videos in raw, pose in processed)
103
+ raw_asset = dandiset.get_asset_by_path("sub-.../sub-..._desc-raw.nwb")
104
+ processed_asset = dandiset.get_asset_by_path("sub-.../sub-..._desc-processed.nwb")
105
+ widget = NWBDANDIPoseEstimationWidget(
106
+ asset=processed_asset,
107
+ video_asset=raw_asset,
108
+ )
109
+ widget
110
+ ```
111
+
112
+ ### Local Files
113
+
114
+ Use `NWBLocalPoseEstimationWidget` for local NWB files:
115
+
116
+ ```python
117
+ from pynwb import read_nwb
118
+ from nwb_video_widgets import NWBLocalPoseEstimationWidget
119
+
120
+ # Single file
121
+ nwbfile = read_nwb("experiment.nwb")
122
+ widget = NWBLocalPoseEstimationWidget(nwbfile)
123
+ widget
124
+
125
+ # Or split files
126
+ nwbfile_raw = read_nwb("raw.nwb")
127
+ nwbfile_processed = read_nwb("processed.nwb")
128
+ widget = NWBLocalPoseEstimationWidget(
129
+ nwbfile=nwbfile_processed,
130
+ video_nwbfile=nwbfile_raw,
131
+ )
132
+ widget
133
+ ```
134
+
135
+ **Parameters:**
136
+
137
+ | Parameter | Type | Description |
138
+ |-----------|------|-------------|
139
+ | `keypoint_colors` | `str` or `dict` | Matplotlib colormap name (e.g., `'tab10'`) or dict mapping keypoint names to hex colors |
140
+ | `default_camera` | `str` | Camera to display initially |
141
+