dacapo.experiments.datasplits.datasets.arrays.zarr_array

Attributes

logger

Classes

ZarrArray

This is a zarr array.

Module Contents

dacapo.experiments.datasplits.datasets.arrays.zarr_array.logger
class dacapo.experiments.datasplits.datasets.arrays.zarr_array.ZarrArray(array_config)

This is a zarr array.

name

The name of the array.

Type:

str

file_name

The file name of the array.

Type:

Path

dataset

The dataset name.

Type:

str

_axes

The axes of the array.

Type:

Optional[List[str]]

snap_to_grid

The snap to grid.

Type:

Optional[Coordinate]

__init__(array_config)

Initializes the array type ‘raw’ and name for the DummyDataset instance.

__str__()

Returns the string representation of the ZarrArray.

__repr__()

Returns the string representation of the ZarrArray.

attrs()

Returns the attributes of the array.

axes()

Returns the axes of the array.

dims()

Returns the dimensions of the array.

_daisy_array()

Returns the daisy array.

voxel_size()

Returns the voxel size of the array.

roi()

Returns the region of interest of the array.

writable()

Returns the boolean value of the array.

dtype()

Returns the data type of the array.

num_channels()

Returns the number of channels of the array.

spatial_axes()

Returns the spatial axes of the array.

data()

Returns the data of the array.

__getitem__(roi)

Returns the data of the array for the given region of interest.

__setitem__(roi, value)

Sets the data of the array for the given region of interest.

create_from_array_identifier(array_identifier, axes, roi, num_channels, voxel_size, dtype, write_size=None, name=None, overwrite=False)

Creates a new ZarrArray given an array identifier.

open_from_array_identifier(array_identifier, name='')

Opens a new ZarrArray given an array identifier.

_can_neuroglance()

Returns the boolean value of the array.

_neuroglancer_source()

Returns the neuroglancer source of the array.

_neuroglancer_layer()

Returns the neuroglancer layer of the array.

_transform_matrix()

Returns the transform matrix of the array.

_output_dimensions()

Returns the output dimensions of the array.

_source_name()

Returns the source name of the array.

add_metadata(metadata)

Adds metadata to the array.

Notes

This class is used to create a zarr array.

name
file_name
dataset
snap_to_grid
property mode
property attrs
Returns the attributes of the array.
Parameters:

attrs (Any) – The attributes of the array.

Returns:

The attributes of the array.

Return type:

Any

Raises:

NotImplementedError

Examples

>>> attrs()

Notes

This method is used to return the attributes of the array.

property axes
Returns the axes of the array.
Parameters:

axes (List[str]) – The axes of the array.

Returns:

The axes of the array.

Return type:

List[str]

Raises:

NotImplementedError

Examples

>>> axes()

Notes

This method is used to return the axes of the array.

property dims: int

Returns the dimensions of the array.

Parameters:

dims (int) – The dimensions of the array.

Returns:

The dimensions of the array.

Return type:

int

Raises:

NotImplementedError

Examples

>>> dims()

Notes

This method is used to return the dimensions of the array.

voxel_size() funlib.geometry.Coordinate

Returns the voxel size of the array.

Parameters:

voxel_size (Coordinate) – The voxel size.

Returns:

The voxel size of the array.

Return type:

Coordinate

Raises:

NotImplementedError

Examples

>>> voxel_size()

Notes

This method is used to return the voxel size of the array.

roi() funlib.geometry.Roi

Returns the region of interest of the array.

Parameters:

roi (Roi) – The region of interest.

Returns:

The region of interest of the array.

Return type:

Roi

Raises:

NotImplementedError

Examples

>>> roi()

Notes

This method is used to return the region of interest of the array.

property writable: bool

Returns the boolean value of the array.

Parameters:

writable (bool) – The boolean value of the array.

Returns:

The boolean value of the array.

Return type:

bool

Raises:

NotImplementedError

Examples

>>> writable()

Notes

This method is used to return the boolean value of the array.

property dtype: Any

Returns the data type of the array.

Parameters:

dtype (Any) – The data type of the array.

Returns:

The data type of the array.

Return type:

Any

Raises:

NotImplementedError

Examples

>>> dtype()

Notes

This method is used to return the data type of the array.

property num_channels: int | None

Returns the number of channels of the array.

Parameters:

num_channels (Optional[int]) – The number of channels of the array.

Returns:

The number of channels of the array.

Return type:

Optional[int]

Raises:

NotImplementedError

Examples

>>> num_channels()

Notes

This method is used to return the number of channels of the array.

property spatial_axes: List[str]

Returns the spatial axes of the array.

Parameters:

spatial_axes (List[str]) – The spatial axes of the array.

Returns:

The spatial axes of the array.

Return type:

List[str]

Raises:

NotImplementedError

Examples

>>> spatial_axes()

Notes

This method is used to return the spatial axes of the array.

property data: Any

Returns the data of the array.

Parameters:

data (Any) – The data of the array.

Returns:

The data of the array.

Return type:

Any

Raises:

NotImplementedError

Examples

>>> data()

Notes

This method is used to return the data of the array.

classmethod create_from_array_identifier(array_identifier, axes, roi, num_channels, voxel_size, dtype, mode='a', write_size=None, name=None, overwrite=False)

Create a new ZarrArray given an array identifier. It is assumed that this array_identifier points to a dataset that does not yet exist.

Parameters:
  • array_identifier (ArrayIdentifier) – The array identifier.

  • axes (List[str]) – The axes of the array.

  • roi (Roi) – The region of interest.

  • num_channels (int) – The number of channels.

  • voxel_size (Coordinate) – The voxel size.

  • dtype (Any) – The data type.

  • write_size (Optional[Coordinate]) – The write size.

  • name (Optional[str]) – The name of the array.

  • overwrite (bool) – The boolean value to overwrite the array.

Returns:

The ZarrArray.

Return type:

ZarrArray

Raises:

NotImplementedError

Examples

>>> create_from_array_identifier(array_identifier, axes, roi, num_channels, voxel_size, dtype, write_size=None, name=None, overwrite=False)

Notes

This method is used to create a new ZarrArray given an array identifier.

classmethod open_from_array_identifier(array_identifier, name='')

Opens a new ZarrArray given an array identifier.

Parameters:
  • array_identifier (ArrayIdentifier) – The array identifier.

  • name (str) – The name of the array.

Returns:

The ZarrArray.

Return type:

ZarrArray

Raises:

NotImplementedError

Examples

>>> open_from_array_identifier(array_identifier, name="")

Notes

This method is used to open a new ZarrArray given an array identifier.

add_metadata(metadata: Dict[str, Any]) None

Adds metadata to the array.

Parameters:

metadata (Dict[str, Any]) – The metadata to add to the array.

Raises:

NotImplementedError

Examples

>>> add_metadata(metadata)

Notes

This method is used to add metadata to the array.