fissa.datahandler_framebyframe module

FISSA functions to handle image and roi objects and return the right format.

If a custom version of this file is used (which can be defined at the declaration of the core FISSA Experiment class), it should have the same functions as here, with the same inputs and outputs.

Authors:
fissa.datahandler_framebyframe.extracttraces(data, masks)[source]

Get the traces for each mask in masks from data.

Parameters:
  • data (PIL.Image) – An open PIL.Image handle to a multi-frame TIFF image.
  • masks (list of array_like) – List of binary arrays.
Returns:

Trace for each mask. Shaped (len(masks), n_frames).

Return type:

numpy.ndarray

fissa.datahandler_framebyframe.getmean(data)[source]

Determine the mean image across all frames.

Parameters:data (PIL.Image) – An open PIL.Image handle to a multi-frame TIFF image.
Returns:y-by-x array for the mean values.
Return type:numpy.ndarray
fissa.datahandler_framebyframe.image2array(image)[source]

Open a given image file as a PIL.Image instance.

Parameters:image (str or file) – A filename (string) of a TIFF image file, a pathlib.Path object, or a file object.
Returns:Handle from which frames can be loaded.
Return type:PIL.Image
fissa.datahandler_framebyframe.rois2masks(rois, data)[source]

Take the object ‘rois’ and returns it as a list of binary masks.

Parameters:
  • rois (str or list of array_like) – Either a string with imagej roi zip location, list of arrays encoding polygons, or list of binary arrays representing masks
  • data (PIL.Image) – An open PIL.Image handle to a multi-frame TIFF image.
Returns:

List of binary arrays (i.e. masks).

Return type:

list