All Projects → AllenCellModeling → Aicsimageio

AllenCellModeling / Aicsimageio

Licence: bsd-3-clause
Delayed Parallel Image Reading for Microscopy Images in Python

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Aicsimageio

Edge
Extreme-scale Discontinuous Galerkin Environment (EDGE)
Stars: ✭ 18 (-73.53%)
Mutual labels:  scientific-computing
Itkexamples
Cookbook examples for the Insight Toolkit documented with Sphinx
Stars: ✭ 38 (-44.12%)
Mutual labels:  scientific-computing
Coretran
An easy to follow library to make Fortran easier in general with wrapped interfaces, sorting routines, kD-Trees, and other algorithms to handle scientific data and concepts. The library contains core fortran routines and object-oriented classes.
Stars: ✭ 59 (-13.24%)
Mutual labels:  scientific-computing
Owl
Owl - OCaml Scientific and Engineering Computing @ http://ocaml.xyz
Stars: ✭ 919 (+1251.47%)
Mutual labels:  scientific-computing
Nasoq
NASOQ:Numerically Accurate Sparsity Oriented QP Solver
Stars: ✭ 30 (-55.88%)
Mutual labels:  scientific-computing
Tiledb
The Universal Storage Engine
Stars: ✭ 1,072 (+1476.47%)
Mutual labels:  scientific-computing
Linfa
A Rust machine learning framework.
Stars: ✭ 812 (+1094.12%)
Mutual labels:  scientific-computing
Spirit
Atomistic Spin Simulation Framework
Stars: ✭ 67 (-1.47%)
Mutual labels:  scientific-computing
Pytim
a python package for the interfacial analysis of molecular simulations
Stars: ✭ 38 (-44.12%)
Mutual labels:  scientific-computing
Scipy
SciPy library main repository
Stars: ✭ 8,942 (+13050%)
Mutual labels:  scientific-computing
Core
The core source repository for the Cherab project.
Stars: ✭ 26 (-61.76%)
Mutual labels:  scientific-computing
Eliot
Eliot: the logging system that tells you *why* it happened
Stars: ✭ 874 (+1185.29%)
Mutual labels:  scientific-computing
Julia.jl
Curated decibans of Julia programming language.
Stars: ✭ 1,083 (+1492.65%)
Mutual labels:  scientific-computing
Mathext
mathext implements basic elementary functions not included in the Go standard library [DEPRECATED]
Stars: ✭ 18 (-73.53%)
Mutual labels:  scientific-computing
Pycuda
CUDA integration for Python, plus shiny features
Stars: ✭ 1,112 (+1535.29%)
Mutual labels:  scientific-computing
Ocaml Odepack
Binding to the ODEPACK FORTRAN library
Stars: ✭ 6 (-91.18%)
Mutual labels:  scientific-computing
Nutils
The nutils project
Stars: ✭ 40 (-41.18%)
Mutual labels:  scientific-computing
P4pdes
C and Python examples from my book on using PETSc to solve PDEs
Stars: ✭ 67 (-1.47%)
Mutual labels:  scientific-computing
Pism
repository for the Parallel Ice Sheet Model (PISM)
Stars: ✭ 61 (-10.29%)
Mutual labels:  scientific-computing
Pwrake
Parallel Workflow extension for Rake, runs on multicores, clusters, clouds.
Stars: ✭ 57 (-16.18%)
Mutual labels:  scientific-computing

AICSImageIO

Build Status Documentation Code Coverage

Delayed Parallel Image Reading for Microscopy Images in Python


Features

  • Supports reading metadata and imaging data for:
    • CZI
    • OME-TIFF
    • TIFF
    • LIF
    • Any additional format supported by imageio
  • Supports writing metadata and imaging data for:
    • OME-TIFF

Installation

Stable Release: pip install aicsimageio
Development Head: pip install git+https://github.com/AllenCellModeling/aicsimageio.git

Documentation

For full package documentation please visit allencellmodeling.github.io/aicsimageio.

Quick Start

Full Image Reading

from aicsimageio import AICSImage, imread

# Get an AICSImage object
img = AICSImage("my_file.tiff")
img.data  # returns 6D STCZYX numpy array
img.dims  # returns string "STCZYX"
img.shape  # returns tuple of dimension sizes in STCZYX order
img.get_image_data("CZYX", S=0, T=0)  # returns 4D CZYX numpy array

# Get 6D STCZYX numpy array
data = imread("my_file.tiff")

Delayed Image Reading

from aicsimageio import AICSImage, imread_dask

# Get an AICSImage object
img = AICSImage("my_file.tiff")
img.dask_data  # returns 6D STCZYX dask array
img.dims  # returns string "STCZYX"
img.shape  # returns tuple of dimension sizes in STCZYX order
img.size("STC")  # returns tuple of dimensions sizes for just STC
img.get_image_dask_data("CZYX", S=0, T=0)  # returns 4D CZYX dask array

# Read specified portion of dask array
lazy_s0t0 = img.get_image_dask_data("CZYX", S=0, T=0)  # returns 4D CZYX dask array
s0t0 = lazy_s0t0.compute()  # returns 4D CZYX numpy array

# Or use normal numpy array slicing
lazy_data = imread_dask("my_file.tiff")
lazy_s0t0 = lazy_data[0, 0, :]
s0t0 = lazy_s0t0.compute()

Quick Start Notes

In short, if the word "dask" appears in the function or property name, the function utilizes delayed reading. If not, the requested image will be loaded immediately and the internal implementation may result in loading the entire image even if only a small chunk was requested. Currently, AICSImage.data and AICSImage.get_image_data load and cache the entire image in memory before performing their operation. AICSImage.dask_data and AICSImage.get_image_dask_data do not load any image data until the user calls compute on the dask.Array object and only the requested chunk will be loaded into memory instead of the entire image.

Metadata Reading

from aicsimageio import AICSImage

# Get an AICSImage object
img = AICSImage("my_file.tiff")
img.metadata  # returns the metadata object for this image type
img.get_channel_names()  # returns a list of string channel names found in the metadata

Performance Considerations

  • If your image fits in memory: use AICSImage.data, AICSImage.get_image_data, or Reader equivalents.
  • If your image is too large to fit in memory: use AICSImage.dask_data, AICSImage.get_image_dask_data, or Reader equivalents.

Napari Interactive Viewer

napari is a fast, interactive, multi-dimensional image viewer for python and it is pretty useful for imaging data that this package tends to interact with.

We have also released napari-aicsimageio, a plugin that allows use of all the functionality described in this library, but in the napari default viewer itself.

Notes

  • Image data and dask_data are always returned as six dimensional in dimension order STCZYX or Scene, Time, Channel, Z, Y, and X.
  • Each file format may use a different metadata parser it is dependent on the reader's implementation.
  • The AICSImage object will only pull the Scene, Time, Channel, Z, Y, X dimensions from the reader. If your file has dimensions outside of those, use the base reader classes CziReader, OmeTiffReader, TiffReader, or DefaultReader.
  • We make some choices for the user based off the image data during img.view_napari. If you don't want this behavior, simply pass the img.dask_data into napari.view_image instead.

Development

See CONTRIBUTING.md for information related to developing the code.

Free software: BSD-3-Clause

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].