Skip to content

InsightSoftwareConsortium/ITKIOOMEZarrNGFF

Repository files navigation

ITKIOOMEZarrNGFF

Build Status

PyPI Version

License

Overview

This is an ITK external module for IO of images stored in Zarr-backed OME-NGFF file format.

Installation

The itk-ioomezarrngff Python package is available on the Python Package Index.

> python -m pip install itk-ioomezarrngff

Example Usage

C++

Usage from C++ should not require any special action. In special situations, you might need to invoke:

itk::OMEZarrNGFFImageIOFactory::RegisterOneFactory();

Python

In Python, we need to explicitly specify the IO, otherwise DICOM IO will be invoked because it is the built-in default for directories. Example:

import sys
import itk
imageio = itk.OMEZarrNGFFImageIO.New()
image = itk.imread(sys.argv[1], imageio=imageio)
itk.imwrite(image, sys.argv[2], imageio=imageio, compression=False)

Build Instructions

ITKIOOMEZarrNGFF is an ITK C++ external module. It may be built with CMake and build tools such as Ninja, gcc, or MSVC.

In the future ITKIOOMEZarrNGFF may be made available as an ITK remote module for direct inclusion in the ITK build process.

Prerequisites

Building

ITKIOOMEZarrNGFF uses CMake for its build process.

# Create the build directory
> mkdir path/to/ITKIOOMEZarrNGFF-build
> cd path/to/ITKIOOMEZarrNGFF-build

# Configure the project
path/to/ITKIOOMEZarrNGFF-build > cmake -DITK_DIR:PATH="path/to/ITK-build" "path/to/ITKIOOMEZarrNGFF"

# Build the project
path/to/ITKIOOMEZarrNGFF-build > cmake --build . --config "Release"

Testing

ITKIOOMEZarrNGFF tests may be run with CTest:

path/to/ITKIOOMEZarrNGFF-build > ctest -C "Release"

Wrapping

See the ITK Software Guide for information on wrapping ITK external modules for Python.

Additional Notes

ITKIOOMEZarrNGFF depends on a fork of Google's Tensorstore library for Zarr interoperation. The InsightSoftwareConsortium/Tensorstore fork implements additional zip support, both for filesystem and in memory zip reading and writing.


Acknowledgements

ITKIOOMEZarrNGFF was developed in part with support from: