Field of View

class starfish.core.experiment.experiment.FieldOfView(name, image_tilesets)[source]

This encapsulates a field of view. It contains the primary image and auxiliary images that are associated with the field of view.

All images can be accessed using get_image() with the name of the image type and any which rounds/chs/zplanes you want to include (if none are provided all are included) If the resulting tileset has unaligned tiles (their x/y coordinates do not all match) we return a list on ImageStacks where each stack represents an aligned group of tiles. The primary image is accessed using the name PRIMARY_IMAGES.

Notes

Field of views obtain their primary image from a TileSet. They can obtain their auxiliary image dictionary from a dictionary of auxiliary image to TileSet.

The decoding of TileSet to ImageStack does not happen until the image is accessed. ImageStacks can only be initialized with aligned tilesets, so if there are multiple you may need to iterate through the groups using get_images() and process each one individually.

Be prepared to handle errors when images are accessed.

Access a FieldOfView through Experiment. fov().

Attributes
namestr

The name of the FOV.

image_typesSet[str]

A set of all the image types.

Methods

get_image(item[, aligned_group, rounds, …])

Load into memory the first Imagestack representation of an aligned image group.

get_images(item[, rounds, chs, zplanes, x, y])

Load into memory the an iterator of aligned Imagestacks for the given tileset and selected axes.

get_image(item, aligned_group=<object object>, rounds=None, chs=None, zplanes=None, x=None, y=None)[source]

Load into memory the first Imagestack representation of an aligned image group. If crop parameters provided, first crop the TileSet.

Parameters
item: str

The name of the tileset ex. ‘primary’ or ‘nuclei’

roundsOptional[Collection[int]]

The rounds in the original dataset to load into the ImageStack. If this is not set, then all rounds are loaded into the ImageStack.

chsOptional[Collection[int]]

The channels in the original dataset to load into the ImageStack. If this is not set, then all channels are loaded into the ImageStack.

zplanesOptional[Collection[int]]

The z-layers in the original dataset to load into the ImageStack. If this is not set, then all z-layers are loaded into the ImageStack.

xOptional[Union[int, slice]]

The x-range in the x-y tile that is loaded into the ImageStack. If this is not set, then the entire x-y tile is loaded into the ImageStack.

yOptional[Union[int, slice]]

The y-range in the x-y tile that is loaded into the ImageStack. If this is not set, then the entire x-y tile is loaded into the ImageStack.

Returns
ImageStack

The instantiated image stack

Return type

ImageStack

get_images(item, rounds=None, chs=None, zplanes=None, x=None, y=None)[source]

Load into memory the an iterator of aligned Imagestacks for the given tileset and selected axes.

Parameters
item: str

The name of the tileset ex. ‘primary’ or ‘nuclei’

roundsOptional[Collection[int]]

The rounds in the original dataset to load into the ImageStack/s. If this is not set, then all rounds are loaded into the ImageStack.

chsOptional[Collection[int]]

The channels in the original dataset to load into the ImageStac/s. If this is not set, then all channels are loaded into the ImageStack.

zplanesOptional[Collection[int]]

The z-layers in the original dataset to load into the ImageStack/s. If this is not set, then all z-layers are loaded into the ImageStack.

xOptional[Union[int, slice]]

The x-range in the x-y tile that is loaded into the ImageStack/s. If this is not set, then the entire x-y tile is loaded into the ImageStack.

yOptional[Union[int, slice]]

The y-range in the x-y tile that is loaded into the ImageStack/s. If this is not set, then the entire x-y tile is loaded into the ImageStack.

Returns
AlignedImageStackIterator

The instantiated ImageStack or list of Imagestacks if the parameters given include multiple aligned groups.

Return type

Iterator[ImageStack]