# napari-broadcastable-points
[](https://github.com/ianhi/napari-broadcastable-points/raw/main/LICENSE)
[](https://pypi.org/project/napari-broadcastable-points)
[](https://python.org)
Points layer that can broadcast over arbitrary dimensions. Available here as a workaround until something more complete is implemented in napari core (https://github.com/napari/napari/issues/2343).
**Warning!** This is likely to be very brittle for all the reasons discussed in the napari issue - so while it is useful it should also be used with caution. So don't muck around much with the viewer dims after creating, because who knows what will happen.
### Installation
```bash
pip install napari-broadcastable-points
```
### Usage
Here is an example where we have an image sequence of (TPCZYX) and we broadcast points over the `C` and `Z` axes.
```python
import napari
from napari_broadcastable_points import BroadcastablePoints
import numpy as np
v = napari.Viewer()
# create a fake timelapse
T = 5
P = 4
C = 3
Z = 2
Y, X = 512, 512
images = np.zeros([T, P, C, Z, Y, X])
v.add_image(images)
# Add the relevant components of points data
# fmt: off
dat = np.array([
# T, P, Y, X
[ 0, 0., 340.25071184, 284.13186557],
[ 0, 0., 312.66551847, 309.95630191],
[ 0, 0., 240.76794003, 266.81775485],
[ 0, 0., 240.47448053, 239.81948049],
[ 0, 1., 261.60356481, 260.36164576],
[ 0, 1., 309.43746393, 215.16888217],
[ 0, 1., 371.06395974, 235.12412843]])
# fmt: on
v.dims.axis_labels = ('T', 'P', 'C', 'Z', 'Y', 'X')
points = BroadcastablePoints(dat, broadcast_dims = (2, 3))
v.add_layer(points)
napari.run()
```

**Creating an empty layer**
You can also create an empty layer - but be sure to specify `ndim` otherwise you may run into an error.
```python
points = BroadcastablePoints(None, broadcast_dims = (2, 3), ndim=6)
```
<!-- [](https://github.com/ianhi/napari-broadcastable-points/actions) -->
<!-- [](https://codecov.io/gh/ianhi/napari-broadcastable-points) -->
Raw data
{
"_id": null,
"home_page": null,
"name": "napari-broadcastable-points",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Ian Hunt-Isaak <ianhuntisaak@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/2d/f3/56fe7fee38ff2b193484afadc6af68f9b4c8367117d3a9a6601be3c3ee0c/napari_broadcastable_points-0.5.1.post2.tar.gz",
"platform": null,
"description": "# napari-broadcastable-points\n\n[](https://github.com/ianhi/napari-broadcastable-points/raw/main/LICENSE)\n[](https://pypi.org/project/napari-broadcastable-points)\n[](https://python.org)\n\nPoints layer that can broadcast over arbitrary dimensions. Available here as a workaround until something more complete is implemented in napari core (https://github.com/napari/napari/issues/2343).\n\n**Warning!** This is likely to be very brittle for all the reasons discussed in the napari issue - so while it is useful it should also be used with caution. So don't muck around much with the viewer dims after creating, because who knows what will happen.\n\n### Installation\n```bash\npip install napari-broadcastable-points\n```\n\n\n### Usage\nHere is an example where we have an image sequence of (TPCZYX) and we broadcast points over the `C` and `Z` axes.\n\n```python\nimport napari\nfrom napari_broadcastable_points import BroadcastablePoints\nimport numpy as np\n\nv = napari.Viewer()\n\n# create a fake timelapse\nT = 5\nP = 4\nC = 3\nZ = 2\nY, X = 512, 512\nimages = np.zeros([T, P, C, Z, Y, X])\nv.add_image(images)\n\n# Add the relevant components of points data\n# fmt: off\ndat = np.array([\n # T, P, Y, X\n [ 0, 0., 340.25071184, 284.13186557],\n [ 0, 0., 312.66551847, 309.95630191],\n [ 0, 0., 240.76794003, 266.81775485],\n [ 0, 0., 240.47448053, 239.81948049],\n [ 0, 1., 261.60356481, 260.36164576],\n [ 0, 1., 309.43746393, 215.16888217],\n [ 0, 1., 371.06395974, 235.12412843]])\n# fmt: on\n\nv.dims.axis_labels = ('T', 'P', 'C', 'Z', 'Y', 'X')\n\npoints = BroadcastablePoints(dat, broadcast_dims = (2, 3))\nv.add_layer(points)\nnapari.run()\n```\n\n\n\n\n**Creating an empty layer**\n\nYou can also create an empty layer - but be sure to specify `ndim` otherwise you may run into an error.\n\n```python\npoints = BroadcastablePoints(None, broadcast_dims = (2, 3), ndim=6)\n```\n\n\n\n<!-- [](https://github.com/ianhi/napari-broadcastable-points/actions) -->\n<!-- [](https://codecov.io/gh/ianhi/napari-broadcastable-points) -->\n",
"bugtrack_url": null,
"license": "BSD 3-Clause License",
"summary": null,
"version": "0.5.1.post2",
"project_urls": {
"Documentation": "https://github.com/ianhi/napari-broadcastable-points#napari-broadcastable-points",
"Homepage": "https://github.com/ianhi/napari-broadcastable-points#napari-broadcastable-points",
"Repository": "https://github.com/ianhi/napari-broadcastable-ponts.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "1a6dec28185d4a44cf9621ac21d2f4d96c87e554255c6046c9c36e08c8015d10",
"md5": "8a0794a2e856432fb38a876fb1e104fe",
"sha256": "4eaa94c359dd3d7259fa573a2108c05ba411ac842dc9d67694e6ee18b9f45501"
},
"downloads": -1,
"filename": "napari_broadcastable_points-0.5.1.post2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8a0794a2e856432fb38a876fb1e104fe",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 5347,
"upload_time": "2025-07-31T14:41:22",
"upload_time_iso_8601": "2025-07-31T14:41:22.666717Z",
"url": "https://files.pythonhosted.org/packages/1a/6d/ec28185d4a44cf9621ac21d2f4d96c87e554255c6046c9c36e08c8015d10/napari_broadcastable_points-0.5.1.post2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2df356fe7fee38ff2b193484afadc6af68f9b4c8367117d3a9a6601be3c3ee0c",
"md5": "5d9df33eb067d161f0bb57d9088c2c75",
"sha256": "b7560b95968856c939246380058a5aca354193ddc8b4ab3eb842e0182e484b14"
},
"downloads": -1,
"filename": "napari_broadcastable_points-0.5.1.post2.tar.gz",
"has_sig": false,
"md5_digest": "5d9df33eb067d161f0bb57d9088c2c75",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 200786,
"upload_time": "2025-07-31T14:41:23",
"upload_time_iso_8601": "2025-07-31T14:41:23.475789Z",
"url": "https://files.pythonhosted.org/packages/2d/f3/56fe7fee38ff2b193484afadc6af68f9b4c8367117d3a9a6601be3c3ee0c/napari_broadcastable_points-0.5.1.post2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-31 14:41:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ianhi",
"github_project": "napari-broadcastable-points#napari-broadcastable-points",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "napari-broadcastable-points"
}