This release is a pre-release and may not be stable for production use.
nifti-zarr-py: Implementation of the NIfTI-Zarr specification in Python
Installation
pip install nifti-zarr
Python API
Convert a nifti file to a nifti-zarr storage.
from niizarr import nii2zarr
nii2zarr("path/to/nifti.nii.gz", "s3://path/to/bucket")
Convert a nifti-zarr storage to a nifti file.
The pyramid level can be selected with level=L, where 0 is the base/finest level.
from niizarr import zarr2nii
zarr2nii("s3://path/to/bucket", "path/to/nifti.nii.gz", level=0)
Load a nifti-zarr into a nibabel.Nifti1Image object.
from niizarr import zarr2nii
nivol = zarr2nii("s3://path/to/bucket", level=0)
Command Line Interface
NIfTI to NIfTI-Zarr
usage: nii2zarr [-h]
[--chunk CHUNK]
[--unchunk-channels]
[--unchunk-time]
[--shard SHARD]
[--unshard-channels]
[--unshard-time]
[--levels LEVELS]
[--method {gaussian,laplacian}]
[--fill FILL]
[--compressor {blosc,zlib}]
[--label]
[--no-label]
[--no-time]
[--no-pyramid-axis {x,y,z}]
[--ome-version {auto,0.5,0.6}]
[--validate]
input [output]
Convert nifti to nifti-zarr.
positional arguments:
input Input nifti file.
output Output zarr directory.
When not specified, write to input directory.
optional arguments:
-h, --help Show this help message and exit.
--chunk CHUNK Spatial chunk size.
--unchunk-channels Save all chanels in a single chunk.
Unchunk if you want to display all channels
as a single RGB layer in neuroglancer.
Chunked by default, unless datatype is RGB.
--unchunk-time Save all timepoints in a single chunk.
Unchunk if you want to display all timepoints
as a single RGB layer in neuroglancer.
Chunked by default.
--shard SHARD Spatial shard size.
--unshard-channels Save all channels in a single shard.
--unshard-time Save all timepoints in a single shard.
--levels LEVELS Number of levels in the pyramid.
If -1 (default), use as many levels as possible.
--method {gaussian,laplacian} Pyramid method.
--fill FILL Missing value.
--compressor {blosc,zlib} Compressor.
--label Segmentation volume.
--no-label Not a segmentation volume.
--no-time No time dimension.
--no-pyramid-axis {x,y,z} Thick slice axis that should not be downsampled.
--ome-version {auto,0.5,0.6} OME-Zarr specification version.
Default "auto" (currently "0.6"). Writing 0.5
will be deprecated in a future release.
--validate Validate the Zarr with the `ome-zarr-models` package.
Output is always Zarr v3. With OME-Zarr 0.6, the NIfTI qform/sform spaces
are also described as the coordinate systems nifti:qform / nifti:sform,
each with an affine transform from the intrinsic (scaled voxel) system.
NIfTI-Zarr to NIfTI
usage: zarr2nii [-h] [--level LEVEL] input [output]
Convert nifti-zarr to nifti. Reads Zarr v2 and v3, and OME-Zarr 0.4-0.6.
positional arguments:
input Input zarr directory
output Output nifti file.
When not provided, write to the same directory as input
optional arguments:
-h, --help Show this help message and exit.
--level LEVEL Pyramid level to extract (default: 0 = finest).
Citation
If your project utilizes the nifti-zarr-py package, please cite the following DOI:
Metadata
Release files for nifti-zarr 1.0.0rc9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nifti_zarr-1.0.0rc9.tar.gz | 27.0 kB | With provenance | Details for nifti_zarr-1.0.0rc9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nifti_zarr-1.0.0rc9-py3-none-any.whl | Python 3 | none | any | Details for nifti_zarr-1.0.0rc9-py3-none-any.whl |
Total release size: 51.8 kB
Release files / nifti_zarr-1.0.0rc9.tar.gz
| Download URL | nifti_zarr-1.0.0rc9.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfbae1fcbf6753b93f4289911722be1ed8114491371d55cb4b6f0ade53f57a0c
|
|
BLAKE2b-256 checksum How to use checksums |
3e1266d56ac04a2f603b6aa829280122d4af0df5d02646012948c0d4d975b497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logRelease files / nifti_zarr-1.0.0rc9-py3-none-any.whl
| Download URL | nifti_zarr-1.0.0rc9-py3-none-any.whl |
|---|---|
| Size | 24.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e59691653fa4110abdea289655fa92ef15d8a4729da0c989bb127b156dd5c377
|
|
BLAKE2b-256 checksum How to use checksums |
78d754e19eaa9579f5e3248568ae8d705eb0c5f7a36822ce8c5f5665407523f0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logSecurity for nifti-zarr 1.0.0rc9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for nifti_zarr-1.0.0rc9.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 15, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.