Types

Starfish uses a series of constants and container types to enable type checking, and provides a set of useful hints about how to interact with starfish objects.

Coordinates

Coordinates holds constants that store with the physical coordinates of a field of view. They define a field of view’s relative location to some global scale parameter, and identify how to stitch or combine multiple fields of view.

class starfish.core.types.Coordinates(value)[source]

An enumeration.

X = 'xc'
Y = 'yc'
Z = 'zc'

Physical Coordinates

class starfish.core.types.PhysicalCoordinateTypes(value)[source]

These are more accurately the xarray coordinates for the physical coordinates of a tile.

X_MAX = 'xmax'
X_MIN = 'xmin'
Y_MAX = 'ymax'
Y_MIN = 'ymin'
Z_MAX = 'zmax'
Z_MIN = 'zmin'

Axes

Axes holds constants that represent indexers into the dimensions of the ImageStack 5-d image tensor. They are re-used by objects that inherit subsets of these Axes, such as:

  1. IntensityTable, which stores spot coordinates and pixel traces across rounds and channels

  2. Codebook, which stores expected image intensities across imaging rounds and channels

class starfish.core.types.Axes(value)[source]

An enumeration.

CH = 'c'
ROUND = 'r'
X = 'x'
Y = 'y'
ZPLANE = 'z'

Features

Features holds constants that represent characteristics of detected image features (most often spots, but sometimes also individual pixels).

class starfish.core.types.Features[source]

contains constants relating to the codebook and feature (spot/pixel) representations of the image data

AREA = 'area'
AXIS = 'features'
CELLS = 'cells'
CELL_ID = 'cell_id'
CODEWORD = 'codeword'
CODE_VALUE = 'v'
DISTANCE = 'distance'
GENES = 'genes'
INTENSITY = 'intensity'
PASSES_THRESHOLDS = 'passes_thresholds'
SPOT_ID = 'spot_id'
SPOT_RADIUS = 'radius'
TARGET = 'target'

SpotAttributes

SpotAttributes defines the minimum amount of information required by starfish to describe a spot. It also contains methods to save these attributes to files that can be used to visualize detected spots.

class starfish.core.types.SpotAttributes(spot_attributes)[source]

Methods

empty([extra_fields])

return an empty SpotAttributes object

save_geojson(output_file_name)

Save to geojson for web visualization

combine

classmethod empty(extra_fields=())[source]

return an empty SpotAttributes object

Return type

SpotAttributes

save_geojson(output_file_name)[source]

Save to geojson for web visualization

Parameters
output_file_namestr

name of output json file

Return type

None

Levels

class starfish.types.Levels(value)[source]

Controls the way that data are scaled to retain skimage dtype requirements that float data fall in [0, 1]. In all modes, data below 0 are set to 0.

CLIP = 'clip'

Data above 1 are set to 1.

SCALE_BY_CHUNK = 'scale_by_chunk'

Rescale the intensity of an image chunk by the peak intensity. Note that if the peak intensity of an image chunk is not saturated, this behaves differently than Clip.SCALE_BY_CHUNK.

SCALE_BY_IMAGE = 'scale_by_image'

Rescale the intensity of the entire image by the peak intensity. Note that if the peak intensity of the entire image is not saturated, this behaves differently than Clip.SCALE_BY_IMAGE.

SCALE_SATURATED_BY_CHUNK = 'scale_saturated_by_chunk'

If the peak intensity of an image chunk is saturated (i.e., > 1), rescale the intensity of the chunk by the peak intensity. If peak intensity of an image chunk is not saturated (i.e., <= 1), do not rescale. This is functionally equivalent to Clip.SCALE_BY_CHUNK.

SCALE_SATURATED_BY_IMAGE = 'scale_saturated_by_image'

If peak intensity of the entire image is saturated (i.e., > 1), rescale the intensity of the entire image by the peak intensity. If peak intensity of the entire image is not saturated (i.e., <= 1), do not rescale. This is functionally equivalent to Clip.SCALE_BY_IMAGE.