Skip to main content

Python wrapper for ImageJ

Project description

PyImageJ: Python wrapper for ImageJ2

Image.sc Forum Build Status codecov

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 Python >= 3.6 and the following packages:

Please see setup.cfg or environment.yml for the minimum version requirements of each package. PyImageJ will not function properly if dependency versions are too old.

In addition, PyImageJ requires OpenJDK and Maven to be installed.

Installation

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 openjdk=8
conda activate pyimagej

Alternately, you can install PyImageJ with pip, but in this case you will need to install OpenJDK and Maven manually.

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 Install.md.

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 Initialization.md.

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 documentation and tutorials.

API Reference

For a complete reference of the PyImageJ API please see the PyImageJ Read the Docs site.

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 pyimagej gitter.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyimagej-1.2.0.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

pyimagej-1.2.0-py3-none-any.whl (29.6 kB view details)

Uploaded Python 3

File details

Details for the file pyimagej-1.2.0.tar.gz.

File metadata

  • Download URL: pyimagej-1.2.0.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for pyimagej-1.2.0.tar.gz
Algorithm Hash digest
SHA256 9ebfd855eedaa9268ce902b53040f134c306836eb52d9ad3b7bea53ca3c25698
MD5 1dccc6ac06183aec0bf9fffa9902b7cf
BLAKE2b-256 2a761e227de234f5877f6ae9828adf4461ae025c40d47cd594741ce997a39ff8

See more details on using hashes here.

File details

Details for the file pyimagej-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyimagej-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 29.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/0.0.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for pyimagej-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 304ebfcdfb2009749d5855b0e80dfdb86c7e763a4a73937e008cd9fc46679fd0
MD5 b97011480c86f4743f98604629daec35
BLAKE2b-256 bf0bc47e607ef0ba36898380aaee4973e7a1b6c9efd884eb968886d8538f6772

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page