Skip to main content

PyImageJ: Python wrapper for ImageJ2

Image.sc Forum Build Status Read the Docs Binder

PyImageJ provides a set of wrapper functions for integration between ImageJ2 and Python. It also supports the original ImageJ API and data structures.

A major advantage of this approach is the ability to combine ImageJ and ImageJ2 with other tools available from the Python software ecosystem, including NumPy, SciPy, scikit-image, CellProfiler, OpenCV, ITK and many more.

Quick Start

Jump into the documentation and tutorials to get started!

System Requirements

Hardware Requirements

PyImageJ requires at minimum a standard computer with enough RAM and CPU performance to support the workflow operations defined by the user. While PyImageJ will run on a range of hardware, we recommend the following RAM and CPU specifications:

  • RAM: >= 2 GB (64 MB minimum)
  • CPU: >= 1 core

Notably, PyImageJ can be installed and used on server infrastructure for large scale image processing.

OS Requirements

PyImageJ has been tested on the following operating systems:

  • Linux (Ubuntu 20.04 LTS)
  • Windows
  • macOS

Software Requirements

PyImageJ requires the following packages:

PyImageJ will not function properly if dependency versions are too old.

Installation

On Mac and Linux, PyImageJ can be installed using Conda+Mamba. Here is how to create and activate a new conda environment with PyImageJ available:

conda install mamba -n base -c conda-forge
mamba create -n pyimagej -c conda-forge pyimagej
conda activate pyimagej

Alternately, you can pip install pyimagej.

Installation time takes approximately 20 seconds. Initializing PyImageJ takes an additional ~30 seconds to ~2-3 minutes (depending on bandwidth) while it downloads and caches the needed Java libraries.

For detailed installation instructions and requirements, see Installation.

Usage

The first step when using PyImageJ is to create an ImageJ2 gateway. This gateway can point to any official release of ImageJ2 or to a local installation. Using the gateway, you have full access to the ImageJ2 API, plus utility functions for translating between Python (NumPy, xarray, pandas, etc.) and Java (ImageJ2, ImgLib2, etc.) structures.

For instructions on how to start up the gateway for various settings, see How to initialize PyImageJ.

Here is an example of opening an image using ImageJ2 and displaying it:

# Create an ImageJ2 gateway with the newest available version of ImageJ2.
import imagej
ij = imagej.init()

# Load an image.
image_url = 'https://imagej.net/images/clown.jpg'
jimage = ij.io().open(image_url)

# Convert the image from ImageJ2 to xarray, a package that adds
# labeled datasets to numpy (http://xarray.pydata.org/en/stable/).
image = ij.py.from_java(jimage)

# Display the image (backed by matplotlib).
ij.py.show(image, cmap='gray')

For more, see the tutorial notebooks.

API Reference

For a complete reference of the PyImageJ API, please see the API Reference.

Getting Help

The Scientific Community Image Forum is the best place to get general help on usage of PyImageJ, ImageJ2, and any other image processing tasks. Bugs can be reported to the PyImageJ GitHub issue tracker.

Contributing

All contributions, reports, and ideas are welcome. Contribution is done via pull requests onto the pyimagej repository.

Most development discussion takes place on the pyimagej GitHub repository. You can also reach the developers at the Image.sc Zulip chat.

For details on how to develop the PyImageJ codebase, see Development.md.


Release files for pyimagej 1.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyimagej 1.8.0
File Size Uploaded
pyimagej-1.8.0.tar.gz 77.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyimagej 1.8.0
File Interpreter ABI Platform
pyimagej-1.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 117.3 kB

Release files / pyimagej-1.8.0.tar.gz

Download URL pyimagej-1.8.0.tar.gz
Size 77.1 kB
Tags Source
SHA-256 checksum
How to use checksums
177010bd708a0b20e4bc71847b161a131e514cd4de93d58e9881eb1e680b580d
BLAKE2b-256 checksum
How to use checksums
436ed1104e3bb9e5f6108ec1831f3b8857750b7037eff6daec450bc9726ffac6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / pyimagej-1.8.0-py3-none-any.whl

Download URL pyimagej-1.8.0-py3-none-any.whl
Size 40.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ca506d2f28f2e6b3acae39021084f68a5cc278460698636ca1b6adddc8fe48b
BLAKE2b-256 checksum
How to use checksums
49d3b4f41b30fc5a529011b8776e9d764f3c2001b249551b10ea4baa523cb64c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.8.0 This release

2 release files

1.7.0

2 release files

1.6.0

2 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page