dacapo.experiments.datasplits.datasets.arrays.missing_annotations_mask

Classes

MissingAnnotationsMask

This is wrapper around a ZarrArray containing uint annotations.

Module Contents

class dacapo.experiments.datasplits.datasets.arrays.missing_annotations_mask.MissingAnnotationsMask(array_config)

This is wrapper around a ZarrArray containing uint annotations. Complementary to the BinarizeArray class where we convert labels into individual channels for training, we may find crops where a specific label is present, but not annotated. In that case you might want to avoid training specific channels for specific training volumes. See package fibsem_tools for appropriate metadata format for indicating presence of labels in your ground truth. “https://github.com/janelia-cosem/fibsem-tools

array_config

A BinarizeArrayConfig object

__getitem__(roi

Roi) -> np.ndarray: Returns a binary mask of the annotations that are present but not annotated.

Note

This class is not meant to be used directly. It is used by the BinarizeArray class to mask out annotations that are present but not annotated.

name
property axes
Returns the axes of the source array
Returns:

Axes of the source array

Return type:

list

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.axes
['x', 'y', 'z']

Notes

This is a helper function for the BinarizeArray class

property dims: int

Returns the number of dimensions of the source array

Returns:

Number of dimensions of the source array

Return type:

int

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.dims
3

Notes

This is a helper function for the BinarizeArray class

property voxel_size: funlib.geometry.Coordinate

Returns the voxel size of the source array

Returns:

Voxel size of the source array

Return type:

Coordinate

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.voxel_size
Coordinate(x=4, y=4, z=40)

Notes

This is a helper function for the BinarizeArray class

property roi: funlib.geometry.Roi

Returns the region of interest of the source array

Returns:

Region of interest of the source array

Return type:

Roi

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.roi
Roi(offset=(0, 0, 0), shape=(100, 100, 100))

Notes

This is a helper function for the BinarizeArray class

property writable: bool

Returns whether the source array is writable

Returns:

Whether the source array is writable

Return type:

bool

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.writable
False

Notes

This is a helper function for the BinarizeArray class

property dtype
Returns the data type of the source array
Returns:

Data type of the source array

Return type:

np.dtype

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.dtype
np.uint8

Notes

This is a helper function for the BinarizeArray class

property num_channels: int

Returns the number of channels

Returns:

Number of channels

Return type:

int

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.num_channels
2

Notes

This is a helper function for the BinarizeArray class

property data
Returns the data of the source array
Returns:

Data of the source array

Return type:

np.ndarray

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.data
np.ndarray(...)

Notes

This is a helper function for the BinarizeArray class

property attrs
Returns the attributes of the source array
Returns:

Attributes of the source array

Return type:

dict

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.attrs
{'name': 'source_array', 'resolution': [4, 4, 40]}

Notes

This is a helper function for the BinarizeArray class

property channels
Returns the names of the channels
Returns:

Names of the channels

Return type:

Generator[str]

Raises:

ValueError – If the source array does not have a name

Examples

>>> source_array = ZarrArray(ZarrArrayConfig(...))
>>> source_array.channels
Generator['channel1', 'channel2', ...]

Notes

This is a helper function for the BinarizeArray class