Skip to main content

simple nd image viewer

Project description

ndv

License PyPI Python Version CI codecov

Simple, fast-loading, asynchronous, n-dimensional array viewer for Qt, with minimal dependencies.

import ndv

data = ndv.data.cells3d()
# or ndv.data.nd_sine_wave()
# or *any* arraylike object (see support below)

ndv.imshow(data)

Montage

As an alternative to ndv.imshow(), you can instantiate the ndv.NDViewer (QWidget subclass) directly

from qtpy.QtWidgets import QApplication
from ndv import NDViewer

app = QApplication([])
viewer = NDViewer(data)
viewer.show()
app.exec()

ndv.NDViewer

  • supports arbitrary number of dimensions, with 2D/3D view canvas, and sliders for all non-visible dims
  • sliders support integer as well as slice (range)-based slicing
  • colormaps provided by cmap
  • supports vispy and pygfx backends
  • supports any numpy-like duck arrays, including (but not limited to):
    • numpy.ndarray
    • cupy.ndarray
    • dask.array.Array
    • jax.Array
    • pyopencl.array.Array
    • sparse.COO
    • tensorstore.TensorStore (supports named dimensions)
    • torch.Tensor (supports named dimensions)
    • xarray.DataArray (supports named dimensions)
    • zarr (supports named dimensions)
  • You can add support for your own storage class by subclassing ndv.DataWrapper and implementing a couple methods. (This doesn't require modifying ndv, but contributions of new wrappers are welcome!)

See examples for each of these array types in examples

Installation

The only required dependencies are numpy and superqt[cmap,iconify]. You will also need a Qt backend (PyQt or PySide) and one of either vispy or pygfx:

pip install ndv[pyqt,vispy]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndv-0.0.2.tar.gz (29.9 kB view hashes)

Uploaded Source

Built Distribution

ndv-0.0.2-py3-none-any.whl (30.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page