1- # 🐍 Python Array API
1+ # 🐍 Python Interface
22
3- NGFF-Zarr supports conversion of any NumPy array-like object that follows the
4- [ Python Array API Standard] ( https://data-apis.org/array-api/latest/ ) into
5- OME-Zarr. This includes such objects an NumPy ` ndarray ` 's, Dask Arrays, PyTorch
6- Tensors, CuPy arrays, Zarr array, etc.
3+ NGFF-Zarr is a Python library that provides a simple, natural interface for
4+ working with OME-Zarr data structures, creating chunked, multiscale OME-Zarr
5+ image pyramids, and reading and writing OME-Zarr multiscale image files.
6+
7+ NGFF-Zarr's interface, which reflects the OME-Zarr data model, is built on
8+ Python's built-in [ dataclasses] and [ Dask arrays] . It is designed to be simple,
9+ flexible, and easy to use.
710
811## Array to NGFF Image
912
10- Convert the array to an ` NgffImage ` , which is a standard
11- [ Python dataclass] ( https://docs.python.org/3/library/dataclasses.html ) that
12- represents an OME-Zarr image for a single scale.
13+ NGFF-Zarr supports conversion of any NumPy array-like object that follows the
14+ [ Python Array API Standard] into the OME-Zarr data model. This includes such
15+ objects an NumPy ` ndarray ` 's, Dask Arrays, PyTorch Tensors, CuPy arrays, Zarr
16+ array, etc.
17+
18+ Convert the array to an [ ` NgffImage ` ] , which is a standard Python [ dataclass]
19+ that represents an OME-Zarr image for a single scale.
1320
1421When creating the image from the array, you can specify
1522
1623- names of the ` dims ` from ` {‘t’, ‘z’, ‘y’, ‘x’, ‘c’} `
1724- the ` scale ` , the pixel spacing for the spatial dims
1825- the ` translation ` , the origin or offset of the center of the first pixel
1926- a ` name ` for the image
20- - and ` axes_units ` with
21- [ UDUNITS-2 identifiers] ( https://ngff.openmicroscopy.org/latest/#axes-md )
27+ - and ` axes_units ` with [ UDUNITS-2 identifiers]
2228
2329``` python
2430>> > # Load an image as a NumPy array
@@ -28,7 +34,7 @@ When creating the image from the array, you can specify
2834< class ' numpy.ndarray' >
2935```
3036
31- Specify optional additional metadata with ` to_ngff_zarr ` .
37+ Specify optional additional metadata with [ ` to_ngff_image ` ] .
3238
3339``` python
3440>> > import ngff_zarr as nz
@@ -50,16 +56,16 @@ chunksize=(256, 256), chunktype=numpy.ndarray>,
5056)
5157```
5258
53- The image data is nested in a lazy ` dask.array ` and chucked.
59+ The image data is nested in a lazy ` dask.Array ` and chucked.
5460
5561If ` dims ` , ` scale ` , or ` translation ` are not specified, NumPy-compatible
5662defaults are used.
5763
58- ## Generate multiscales
64+ ## Generate Multiscales
5965
6066OME-Zarr represents images in a chunked, multiscale data structure. Use
61- ` to_multiscales ` to build a task graph that will produce a chunked, multiscale
62- image pyramid. ` to_multiscales ` has optional ` scale_factors ` and ` chunks `
67+ [ ` to_multiscales ` ] to build a task graph that will produce a chunked, multiscale
68+ image pyramid. [ ` to_multiscales ` ] has optional ` scale_factors ` and ` chunks `
6369parameters. An [ antialiasing method] ( ./methods.md ) can also be prescribed.
6470
6571``` python
@@ -152,7 +158,7 @@ scale according the OME-Zarr data model. Note that the correct `scale` and
152158
153159## Write to Zarr
154160
155- To write the multiscales to Zarr, use ` to_ngff_zarr ` .
161+ To write the multiscales to Zarr, use [ ` to_ngff_zarr ` ] .
156162
157163``` python
158164nz.to_ngff_zarr(' cthead1.ome.zarr' , multiscales)
@@ -165,3 +171,13 @@ Any other
165171also be used.
166172
167173The multiscales will be computed and written out-of-core, limiting memory usage.
174+
175+ [ dataclass ] : https://docs.python.org/3/library/dataclasses.html
176+ [ dataclasses ] : https://docs.python.org/3/library/dataclasses.html
177+ [ Dask arrays ] : https://docs.dask.org/en/stable/array.html
178+ [ Python Array API Standard ] : https://data-apis.org/array-api/latest/
179+ [ UDUNITS-2 identifiers ] : https://ngff.openmicroscopy.org/latest/#axes-md
180+ [ `NgffImage` ] : ../apidocs/ngff_zarr/ngff_zarr.ngff_image.html
181+ [ `to_ngff_zarr` ] : ../apidocs/ngff_zarr/ngff_zarr.to_ngff_zarr.html
182+ [ `to_ngff_image` ] : ../apidocs/ngff_zarr/ngff_zarr.to_ngff_image.html
183+ [ `to_multiscales` ] : ../apidocs/ngff_zarr/ngff_zarr.to_multiscales.html
0 commit comments