jicbioimage.core.image

Module for managing and accessing images.

class jicbioimage.core.image.History(creation=None)[source]

Class for storing the provenance of an image.

class Event(function, args, kwargs)[source]

An event in the history of an image.

History.add_event(function, args, kwargs)[source]

Return event added to the history.

class jicbioimage.core.image.Image(shape, dtype=<type 'numpy.uint8'>, buffer=None, offset=0, strides=None, order=None, name=None, log_in_history=True)[source]

Image class.

classmethod from_file(fpath, name=None, log_in_history=True)[source]

Return jicbioimage.core.image.Image instance from a file.

Parameters:
  • fpath – path to the image file
  • name – name of the image
  • log_in_history – whether or not to log the creation event in the image’s history
Returns:

jicbioimage.core.image.Image

class jicbioimage.core.image.Image3D(shape, dtype=<type 'numpy.uint8'>, buffer=None, offset=0, strides=None, order=None, name=None, log_in_history=True)[source]

Image3D class; in other words a 3D stack.

classmethod from_directory(directory)[source]

Return jicbioimage.core.image.Image3D from directory.

Parameters:directory – name of input directory
Returns:jicbioimage.core.image.Image3D
to_directory(directory)[source]

Write slices from 3D image to directory.

write(name)[source]

Write slices from 3D image to disk.

Parameters:name – name of output directory
class jicbioimage.core.image.ImageCollection(fpath=None)[source]

Class for storing related images.

image(index=0)[source]

Return image as a jicbioimage.core.image.Image.

Parameters:index – list index
Returns:jicbioimage.core.image.Image
parse_manifest(fpath)[source]

Parse manifest file to build up the collection of images.

Parameters:fpath – path to the manifest file
Raises:RuntimeError
proxy_image(index=0)[source]

Return a jicbioimage.core.image.ProxyImage instance.

Parameters:index – list index
Returns:jicbioimage.core.image.ProxyImage
class jicbioimage.core.image.MicroscopyCollection(fpath=None)[source]

Collection of jicbioimage.core.image.MicroscopyImage instances.

channels(s=0)[source]

Return list of channels in the collection.

Parameters:s – series
Returns:list of channel identifiers
image(s=0, c=0, z=0, t=0)[source]

Return image as a jicbioimage.core.image.Image.

Parameters:
  • s – series
  • c – channel
  • z – zslice
  • t – timepoint
Returns:

jicbioimage.core.image.Image

proxy_image(s=0, c=0, z=0, t=0)[source]

Return a jicbioimage.core.image.MicroscopyImage instance.

Parameters:
  • s – series
  • c – channel
  • z – zslice
  • t – timepoint
Returns:

jicbioimage.core.image.MicroscopyImage

series

Return list of series in the collection.

timepoints(s=0)[source]

Return list of time points in the collection.

Parameters:s – series
Returns:list of time point identifiers
zslices(s=0)[source]

Return list of z-slices in the collection.

Parameters:s – series
Returns:list of zslice identifiers
zstack(s=0, c=0, t=0)[source]

Return zstack as a jicbioimage.core.image.Image3D.

Parameters:
  • s – series
  • c – channel
  • t – timepoint
Returns:

zstack as a jicbioimage.core.image.Image3D

zstack_array(s=0, c=0, t=0)[source]

Return zstack as a numpy.ndarray.

Parameters:
  • s – series
  • c – channel
  • t – timepoint
Returns:

zstack as a numpy.ndarray

zstack_proxy_iterator(s=0, c=0, t=0)[source]

Return zstack jicbioimage.core.image.ProxyImage iterator.

Parameters:
  • s – series
  • c – channel
  • t – timepoint
Returns:

zstack as a jicbioimage.core.image.ProxyImage iterator

class jicbioimage.core.image.MicroscopyImage(fpath, metadata={})[source]

Lightweight image class with microscopy meta data.

in_zstack(s, c, t)[source]

Return True if I am in the zstack.

Parameters:
  • s – series
  • c – channel
  • t – timepoint
Returns:

bool

is_me(s, c, z, t)[source]

Return True if arguments match my meta data.

Parameters:
  • s – series
  • c – channel
  • z – zslice
  • t – timepoint
Returns:

bool

class jicbioimage.core.image.ProxyImage(fpath, metadata={})[source]

Lightweight image class.

image

Underlying jicbioimage.core.image.Image instance.