A plugin to send and receive multi-dimensional image data for visualization in Napari over the network.
napari-stream lets you push images from any application, process, or codebase into a running napari instance—even from another machine. It can automatically pull array-like data (NumPy, PyTorch tensors, zarr arrays, etc.) from nested Python lists and dicts, so you can stream complex structures without manual extraction. You can keep things private (local IPC/loopback) or make the receiver reachable publicly over TCP. The receiver endpoint can also be set via the NAPARI_STREAM_ENDPOINT environment variable.
from napari_stream.sender import StreamSender, send
import numpy as np
# Option 1: explicit sender (recommended when reusing across many sends)
sender = StreamSender(endpoint="tcp://192.0.2.10:5556") # or leave None to use NAPARI_STREAM_ENDPOINT/default
sender.send(np.random.rand(256, 256), name="image")
# Option 2: convenience function; pass connection kwargs through
send(np.random.rand(64, 64), name="quick", endpoint="tcp://127.0.0.1:5556")On the receiving side, open the napari dock widget, choose your endpoint, and toggle public access if you want to accept connections from other machines.
You can install napari-stream via pip:
pip install napari-stream
If napari is not already installed, you can install napari-stream with napari and Qt via:
pip install "napari-stream[all]"
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the MIT license, "napari-stream" is free and open source software
If you encounter any problems, please [file an issue] along with a detailed description.
This repository is developed and maintained by the Applied Computer Vision Lab (ACVL) of Helmholtz Imaging and the Division of Medical Image Computing at DKFZ.
This repository was generated with copier using the napari-plugin-template.