Skip to main content

napari-broadcastable-points

License PyPI Python Version

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

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.

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()

example usage

Creating an empty layer

You can also create an empty layer - but be sure to specify ndim otherwise you may run into an error.

points = BroadcastablePoints(None, broadcast_dims = (2, 3), ndim=6)

Metadata

Release files for napari-broadcastable-points 0.5.1.post2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for napari-broadcastable-points 0.5.1.post2
File Size Uploaded
napari_broadcastable_points-0.5.1.post2.tar.gz 200.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for napari-broadcastable-points 0.5.1.post2
File Interpreter ABI Platform
napari_broadcastable_points-0.5.1.post2-py3-none-any.whl Python 3 none any Details

Total release size: 206.1 kB

Release files / napari_broadcastable_points-0.5.1.post2.tar.gz

Download URL napari_broadcastable_points-0.5.1.post2.tar.gz
Size 200.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b7560b95968856c939246380058a5aca354193ddc8b4ab3eb842e0182e484b14
BLAKE2b-256 checksum
How to use checksums
2df356fe7fee38ff2b193484afadc6af68f9b4c8367117d3a9a6601be3c3ee0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release files / napari_broadcastable_points-0.5.1.post2-py3-none-any.whl

Download URL napari_broadcastable_points-0.5.1.post2-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4eaa94c359dd3d7259fa573a2108c05ba411ac842dc9d67694e6ee18b9f45501
BLAKE2b-256 checksum
How to use checksums
1a6dec28185d4a44cf9621ac21d2f4d96c87e554255c6046c9c36e08c8015d10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.11

Release history Release notifications | RSS feed

This release

0.5.1.post2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.18

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page