imagej/pyimagej
Use ImageJ from Python
What it solves
ImageJ and ImageJ2 are powerful Java-based tools for scientific image processing, but they are not directly usable from Python. PyImageJ removes that barrier by providing wrapper functions that let Python developers call into ImageJ2 (and the original ImageJ API) while keeping their data in familiar Python structures. It also allows combining ImageJ with other Python libraries like NumPy, SciPy, scikit-image, OpenCV, and ITK, so users are not forced to choose between ecosystems.
How it works
PyImageJ creates an ImageJ2 gateway — a connection to a specific ImageJ2 release or a local installation. Once the gateway is up, you can use its methods to open images and then convert them to Python-friendly formats (like xarray) with a simple from_java call. The wrapper handles translation between Java data structures and Python data structures, and optionally uses matplotlib for displaying images. Initialization downloads and caches needed Java libraries on first use (about 30 seconds to 2-3 minutes).
Who it's for
This is for Python users who need to run ImageJ or ImageJ2 workflows — for example, researchers in biology, microscopy, or other imaging fields who want to process images with Python tools but also leverage ImageJ's extensive plugin ecosystem. It also suits system administrators who want to run image processing on servers, since it works on Linux, Windows, and macOS.
Highlights
- Full access to the ImageJ2 API plus the original ImageJ API from Python
- Converts between Python structures (NumPy, xarray, pandas) and Java structures (ImageJ2, ImgLib2)
- Works with any official ImageJ2 release or a local installation
- Can be installed via conda/mamba or pip, with a quick setup (~20 seconds install)
- Includes a convenient
showfunction backed by matplotlib for quick display
Related
- Project
- Project
- Project
- Project