Python wrapper for ImageJ
Project description
Python wrapper for ImageJ
imagej.py provides a set of
wrapper functions for integration between ImageJ and Python.
It also provides a high-level entry point imagej.IJ for invoking
ImageJ Server APIs;
see "ImageJ Server" below for details.
Requirements
default:
- imglyb
Install imglyb using conda install -c hanslovsky imglyb.
Further information regarding imglyb can be found in the imglyb GitHub repository.
Usage
In this example, replace /Applications/Fiji.app with the location of your Fiji installation.
# Spin up ImageJ.
import imagej
ij = imagej.init('/Applications/Fiji.app')
# Import an image with scikit-image.
import skimage
from skimage import io
# NB: Blood vessel image from: https://www.fi.edu/heart/blood-vessels
img = io.imread('https://www.fi.edu/sites/fi.live.franklinds.webair.com/files/styles/featured_large/public/General_EduRes_Heart_BloodVessels_0.jpg')
import numpy as np
img = np.mean(img, axis=2)
# Invoke ImageJ's Frangi vesselness op.
vessels = np.zeros(img.shape, dtype=img.dtype)
import imglyb
ij.op().filter().frangiVesselness(imglyb.to_imglib(vessels), imglyb.to_imglib(img), [1, 1], 20)
See also test/test_imagej.py for other examples of usage.
ImageJ Server
Requirements
imagej_server:
- requests
- Pillow
Use pip install -r server_requirements.txt to install requirements for server.
Pillow is required for the imagej.server module's IJ.show() function.
In addition, display or xv needs to exist in your system to view the image.
Usage
There is a short usage example here.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imagej-0.3.0.tar.gz.
File metadata
- Download URL: imagej-0.3.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab3435fe7f5775e15f46e309359d175ed28eef044e8daa84dbde6b7af1b0f304
|
|
| MD5 |
94a4782a11155e2e2ea285ad97119b93
|
|
| BLAKE2b-256 |
adcf5ce45beb9ae77bcfdffd53cb29879031a6f41b790c9d3614d1110563a78a
|
File details
Details for the file imagej-0.3.0-py3-none-any.whl.
File metadata
- Download URL: imagej-0.3.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/36.5.0.post20170921 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/3.6.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e6b2f6d39adb1a5e5cfb1dab1378cb5695b4237e0fe2bfa23317632b7f5b0a
|
|
| MD5 |
c2d5f1fb5b4fef925600754f3646f837
|
|
| BLAKE2b-256 |
0e502c386e2d2cd616f30b3a962e96e621c569c7b723ba970b5b316578d1ccea
|