Skip to content

mpinkert/pyimagej

 
 

Repository files navigation

PyImageJ: Python wrapper for ImageJ

Build Status

PyImageJ provides a set of wrapper functions for integration between ImageJ and Python. A major advantage of this approach is the ability to combine ImageJ with other tools available from the Python software ecosystem, including NumPy, SciPy, scikit-image, CellProfiler, OpenCV, ITK and more.

Installation

PyImageJ can be installed using conda. Here is how to create and activate a new conda environment holding PyImageJ

conda create -n pyimagej -c conda-forge pyimagej openjdk=8
conda activate pyimagej

For detailed installation instructions and requirements, see Install.md

Usage

The basic usage of PyImageJ is to start up an ImageJ gateway that translates between Python and ImageJ/Java structures. This gateway can point to any official release of ImageJ or to a local installation.

For instructions on how to start up the gateway for various settings see Initialization.md

Once you have your ImageJ gateway, you can start using it. Here is an example of opening an image using ImageJ and displaying it via a convenience function that calls matplotlib:

import imagej
ij = imagej.init()

url_colony = 'https://samples.fiji.sc/new-lenna.jpg' 

# Load the image
lenna = ij.io().open(url_colony)

# Send it to xarray.  Xarray is a package that adds labeled datasets to numpy (http://xarray.pydata.org/en/stable/)
xarray_lenna = ij.py.from_java(lenna)

# Display the image
ij.py.show(xarray_lenna, cmap='gray')

For instructions on how to do certain tasks, see USAGE.md

Getting Help

The Scientific Community Image Forum is the best place to get general help on usage of PyImageJ, ImageJ, 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 imagej gitter.

About

Python module for working with ImageJ

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 97.4%
  • Shell 2.6%