All Projects → hanjinliu → impy

hanjinliu / impy

Licence: BSD-3-Clause license
Speed up coding/extending image analysis in Python.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to impy

image space
Interactive Image similarity and Visual Search and Retrieval application
Stars: ✭ 91 (+333.33%)
Mutual labels:  image-analysis
QuadTreeAndroid
Library that helps to implement the QuadTree in android, by using splitting images
Stars: ✭ 30 (+42.86%)
Mutual labels:  image-analysis
cellpose-napari
napari plugin for cellpose (see www.cellpose.org) - an anatomical segmentation tool
Stars: ✭ 30 (+42.86%)
Mutual labels:  napari
computer-vision-notebooks
👁️ An authorial set of fundamental Python recipes on Computer Vision and Digital Image Processing.
Stars: ✭ 89 (+323.81%)
Mutual labels:  image-analysis
miplib
A Python software library with a variety of functions for (optical) microscopy image restoration, reconstruction and analysis.
Stars: ✭ 54 (+157.14%)
Mutual labels:  image-analysis
fastimage
Find the type or size of an image
Stars: ✭ 31 (+47.62%)
Mutual labels:  image-analysis
F9-Corner-Detection-Library
A faster re-implementation of the FAST-9 algorithm (C++, with C bindings available)
Stars: ✭ 14 (-33.33%)
Mutual labels:  image-analysis
GARI
GARI (Genetic Algorithm for Reproducing Images) reproduces a single image using Genetic Algorithm (GA) by evolving pixel values.
Stars: ✭ 41 (+95.24%)
Mutual labels:  image-analysis
ggimg
ggimg: Graphics Layers for Plotting Image Data with ggplot2
Stars: ✭ 51 (+142.86%)
Mutual labels:  image-analysis
fpzip
Cython bindings for fpzip, a floating point image compression algorithm.
Stars: ✭ 24 (+14.29%)
Mutual labels:  image-analysis
Slicer-DeepInfer
3D Slicer Module for connecting to model repository and use models for image analysis.
Stars: ✭ 23 (+9.52%)
Mutual labels:  image-analysis
SyConn
Toolkit for the generation and analysis of volume eletron microscopy based synaptic connectomes of brain tissue.
Stars: ✭ 31 (+47.62%)
Mutual labels:  image-analysis
Texturize
A unified framework for example-based texture synthesis, developed alongside my master's thesis.
Stars: ✭ 15 (-28.57%)
Mutual labels:  image-analysis
MorphoLibJ
Collection of mathematical morphology methods and plugins for ImageJ
Stars: ✭ 84 (+300%)
Mutual labels:  image-analysis
squidpy
Spatial Single Cell Analysis in Python
Stars: ✭ 235 (+1019.05%)
Mutual labels:  image-analysis
Quantitative-Big-Imaging-2018
(Latest semester at https://github.com/kmader/Quantitative-Big-Imaging-2019) The material for the Quantitative Big Imaging course at ETHZ for the Spring Semester 2018
Stars: ✭ 50 (+138.1%)
Mutual labels:  image-analysis
Python Computer Vision from Scratch
This repository explores the variety of techniques commonly used to analyze and interpret images. It also describes challenging real-world applications where vision is being successfully used, both for specialized applications such as medical imaging, and for fun, consumer-level tasks such as image editing and stitching, which students can apply…
Stars: ✭ 219 (+942.86%)
Mutual labels:  image-analysis
goexif2
MAINTAINER WANTED -- Decode embedded EXIF meta data from image files written in Pure Golang
Stars: ✭ 35 (+66.67%)
Mutual labels:  image-analysis
awesome-cytodata
A curated list of awesome cytodata resources
Stars: ✭ 40 (+90.48%)
Mutual labels:  image-analysis
OMETIFF.jl
I/O operations for OME-TIFF files in Julia
Stars: ✭ 18 (-14.29%)
Mutual labels:  image-analysis

Downloads PyPI version

A numpy extension for efficient and powerful image analysis workflow

impy is an all-in-one image analysis library, equipped with parallel processing, GPU support, GUI based tools and so on.

The core array, ImgArray, is a subclass of numpy.ndarray, tagged with information such as

  • image axes
  • scale of each axis
  • directory of the original image
  • and other image metadata

Documentation

Documentation is available here.

Installation

  • use pip
pip install impy-array
  • from source
git clone https://github.com/hanjinliu/impy

Code as fast as you speak

Almost all the functions, such as filtering, deconvolution, labeling, single molecule detection, and even those pure numpy functions, are aware of image metadata. They "know" which dimension corresponds to "z" axis, which axes they should iterate along or where to save the image. As a result, your code will be very concise:

import impy as ip
import numpy as np

img = ip.imread("path/to/image")       # Read images with metadata.
img["z=3;t=0"].imshow()                # Plot image slice at z=3 and t=0.
img_fil = img.gaussian_filter(sigma=2) # Paralell batch denoising. No more for loop!
img_prj = np.max(img_fil, axis="z")    # Z-projection (numpy is aware of image axes!).
img_prj.imsave(f"Max-{img.name}")      # Save in the same place. Don't spend time on searching for the directory!

Supported file formats

impy automatically chooses proper reader/writer according to the extension.

  • Tiff file (".tif", ".tiff")
  • MRC file (".mrc", ".rec", ".st", ".map", ".map.gz")
  • Zarr file (".zarr")
  • Other image file (".png", ".jpg")

Switch between CPU and GPU

impy can internally switches the functions between numpy and cupy. You can use GPU for calculation very easily.

img.gaussian_filter()  # <- CPU
with ip.use("cupy"):
    img.gaussian_filter()  # <- GPU
ip.Const["RESOURCE"] = "cupy"  # <- globally use GPU

Seamless interface between napari

napari is an interactive viewer for multi-dimensional images. impy has a simple and efficient interface with it, via the object ip.gui. Since ImgArray is tagged with image metadata, you don't have to care about axes or scales. Just run

ip.gui.add(img)

Extend your function for batch processing

Already have a function for numpy and scipy? Decorate it with @ip.bind

@ip.bind
def imfilter(img, param=None):
    # Your function here.
    # Do something on a 2D or 3D image and return image, scalar or labels
    return out

and it's ready for batch processing!

img.imfilter(param=1.0)

Commaind line usage

impy also supports command line based image analysis. All method of ImgArray is available from commad line, such as

impy path/to/image.tif ./output.tif --method gaussian_filter --sigma 2.0

which is equivalent to

import impy as ip
img = ip.imread("path/to/image.tif")
out = img.gaussian_filter(sigma=2.0)
out.imsave("./output.tif")

For more complex procedure, it is possible to send image directly to IPython

impy path/to/image.tif -i
thr = img.gaussian_filter().threshold()

or to napari

impy path/to/image.tif -n
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].