A multi-dimensional spatial image data structure for scientific Python.
Low maintenance activity. Last release 16 months ago. Weaker on commit activity and recent releases.
pip install spatial-imagespatial-image
A multi-dimensional spatial image data structure for scientific Python.
To facilitate:
- Multi-scale processing and analysis
- Registration
- Resampling
- Subregion parallel processing
- Coupling with meshes, point sets, and annotations
with scientific images, which are typically multi-dimensional with anisotropic sampling, this package provides a spatial-image data structure. In addition to an N-dimensional array of pixel values, spatial metadata defines the location of the pixel sampling grid in space time. We also label the array dimensions. This metadata is easily utilized and elegantly carried through image processing pipelines.
This package defines spatial image metadata, provides a function,
is_spatial_image, to verify the expected behavior of a spatial image
instance, and provides a reference function, to_spatial_image to convert an
array-like, e.g. a NumPy
ndarray
or a Dask array, to a spatial
image.
The spatial-image data structure is implemented with Xarray, a library for N-D labeled arrays and datasets in Python. The Xarray library is well-tested, relatively mature, and integrates well with scientific Python ecosystem tooling. The Xarray library leverages NumPy and pandas for labeled array indexing, integrates well with machine-learning libraries utilizing the scikit-learn interface, integrates with Dask for distributed computing, and zarr for serialization.
In essence, a spatial image is an
xarray.DataArray
with a defined set of labels, ,
constraints on the , to enforce uniform spacing in a given
direction, and defined set of additional metadata .