dacapo.experiments.datasplits.datasets.arrays.binarize_array

Module Contents

Classes

BinarizeArray

This is wrapper around a ZarrArray containing uint annotations.

class dacapo.experiments.datasplits.datasets.arrays.binarize_array.BinarizeArray(array_config)

This is wrapper around a ZarrArray containing uint annotations. Because we often want to predict classes that are a combination of a set of labels we wrap a ZarrArray with the BinarizeArray and provide something like groupings=[(“mito”, [3,4,5])] where 4 corresponds to mito_membrane, 5 is mito_ribos, and 3 is everything else that is part of a mitochondria. The BinarizeArray will simply combine labels 3,4,5 into a single binary channel for th class of “mito”. We use a single channel per class because some classes may overlap. For example if you had groupings=[(“mito”, [3,4,5]), (“membrane”, [4, 8, 1])] where 4 is mito_membrane, 8 is er_membrane, and 1 is plasma_membrane. Now you can have a binary classification for membrane or not which in some cases overlaps with the channel for mitochondria which includes the mito membrane.

property attrs

Return a dictionary of metadata attributes stored on this array.

property axes

Returns the axes of this dataset as a string of charactes, as they are indexed. Permitted characters are:

  • zyx for spatial dimensions

  • c for channels

  • s for samples

property dims: int

Returns the number of spatial dimensions.

property voxel_size: funlib.geometry.Coordinate

The size of a voxel in physical units.

property roi: funlib.geometry.Roi

The total ROI of this array, in world units.

property writable: bool

Can we write to this Array?

property dtype

The dtype of this array, in numpy dtypes

property num_channels: int

The number of channels provided by this dataset. Should return None if the channel dimension doesn’t exist.

property data

Get a numpy like readable and writable view into this array.

property channels