Metadata-Version: 2.4
Name: napari-stream
Version: 0.1.2
Summary: A plugin to send and receive multi-dimensional image data for visualization in Napari over the network.
Author: Karol Gotkowski
Author-email: karol.gotkowski@dkfz.de
License: 
        The MIT License (MIT)
        
        Copyright (c) 2025 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in
        all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
        THE SOFTWARE.
        
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Framework :: napari
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: pyzmq
Requires-Dist: medvol
Provides-Extra: all
Requires-Dist: napari[all]; extra == "all"
Provides-Extra: test
Requires-Dist: qtpy; extra == "test"
Dynamic: license-file

<p align="center">
  <img src="napari_stream.png" alt="Alt text" width="1000">
</p>

______________________________________________________________________

[![License MIT](https://img.shields.io/pypi/l/napari-stream.svg?color=green)](https://github.com/Karol-G/napari-stream/raw/main/LICENSE)
[![PyPI](https://img.shields.io/pypi/v/napari-stream.svg?color=green)](https://pypi.org/project/napari-stream)
[![Python Version](https://img.shields.io/pypi/pyversions/napari-stream.svg?color=green)](https://python.org)
[![codecov](https://codecov.io/gh/Karol-G/napari-stream/branch/main/graph/badge.svg)](https://codecov.io/gh/Karol-G/napari-stream)
[![napari hub](https://img.shields.io/endpoint?url=https://api.napari-hub.org/shields/napari-stream)](https://napari-hub.org/plugins/napari-stream)
[![npe2](https://img.shields.io/badge/plugin-npe2-blue?link=https://napari.org/stable/plugins/index.html)](https://napari.org/stable/plugins/index.html)
[![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-inverted-border-purple.json)](https://github.com/copier-org/copier)

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.

## Quick usage

```python
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.


## Installation

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]"
```


## Contributing

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.

## License

Distributed under the terms of the [MIT] license,
"napari-stream" is free and open source software

## Issues

If you encounter any problems, please [file an issue] along with a detailed description.

[napari]: https://github.com/napari/napari
[copier]: https://copier.readthedocs.io/en/stable/
[@napari]: https://github.com/napari
[MIT]: http://opensource.org/licenses/MIT
[BSD-3]: http://opensource.org/licenses/BSD-3-Clause
[GNU GPL v3.0]: http://www.gnu.org/licenses/gpl-3.0.txt
[GNU LGPL v3.0]: http://www.gnu.org/licenses/lgpl-3.0.txt
[Apache Software License 2.0]: http://www.apache.org/licenses/LICENSE-2.0
[Mozilla Public License 2.0]: https://www.mozilla.org/media/MPL/2.0/index.txt
[napari-plugin-template]: https://github.com/napari/napari-plugin-template

[napari]: https://github.com/napari/napari
[tox]: https://tox.readthedocs.io/en/latest/
[pip]: https://pypi.org/project/pip/
[PyPI]: https://pypi.org/

# Acknowledgments

<p align="left">
  <img src="https://github.com/MIC-DKFZ/vidata/raw/main/imgs/Logos/HI_Logo.png" width="150"> &nbsp;&nbsp;&nbsp;&nbsp;
  <img src="https://github.com/MIC-DKFZ/vidata/raw/main/imgs/Logos/DKFZ_Logo.png" width="500">
</p>

This repository is developed and maintained by the Applied Computer Vision Lab (ACVL)
of [Helmholtz Imaging](https://www.helmholtz-imaging.de/) and the
[Division of Medical Image Computing](https://www.dkfz.de/en/medical-image-computing) at DKFZ.

This repository was generated with [copier] using the [napari-plugin-template].

[copier]: https://copier.readthedocs.io/en/stable/
[napari-plugin-template]: https://github.com/napari/napari-plugin-template
