dacapo.experiments.datasplits.datasets.arrays.dvid_array

Attributes

fetch_info

logger

Classes

DVIDArray

This is a DVID array. It is a wrapper around a DVID array that provides

Module Contents

dacapo.experiments.datasplits.datasets.arrays.dvid_array.fetch_info
dacapo.experiments.datasplits.datasets.arrays.dvid_array.logger
class dacapo.experiments.datasplits.datasets.arrays.dvid_array.DVIDArray(array_config)

This is a DVID array. It is a wrapper around a DVID array that provides the necessary methods to interact with the array. It is used to fetch data from a DVID server. The source is a tuple of three strings: the server, the UUID, and the data name.

DVID: data management system for terabyte-sized 3D images

name

The name of the array

Type:

str

source

The source of the array

Type:

tuple[str, str, str]

__getitem__()

Returns the data from the array for a given region of interest

Notes

The source is a tuple of three strings: the server, the UUID, and the data name.

name: str
source: tuple[str, str, str]
attrs()

Returns the attributes of the DVID array

Returns:

The attributes of the DVID array

Return type:

dict

Raises:

ValueError – If the attributes is not a dictionary

Examples

>>> dvid_array.attrs
{'Extended': {'VoxelSize': (1.0, 1.0, 1.0), 'Values': [{'DataType': 'uint64'}]}, 'Extents': {'MinPoint': (0, 0, 0), 'MaxPoint': (100, 100, 100)}}

Notes

The attributes are the same as the source array

property axes
Returns the axes of the DVID array
Returns:

The axes of the DVID array

Return type:

str

Raises:

ValueError – If the axes is not a string

Examples

>>> dvid_array.axes
'zyx'

Notes

The axes are the same as the source array

property dims: int

Returns the dimensions of the DVID array

Returns:

The dimensions of the DVID array

Return type:

int

Raises:

ValueError – If the dimensions is not an integer

Examples

>>> dvid_array.dims
3

Notes

The dimensions are the same as the source array

voxel_size() funlib.geometry.Coordinate

Returns the voxel size of the DVID array

Returns:

The voxel size of the DVID array

Return type:

Coordinate

Raises:

ValueError – If the voxel size is not a Coordinate object

Examples

>>> dvid_array.voxel_size
Coordinate(x=1.0, y=1.0, z=1.0)

Notes

The voxel size is the same as the source array

roi() funlib.geometry.Roi

Returns the region of interest of the DVID array

Returns:

The region of interest of the DVID array

Return type:

Roi

Raises:

ValueError – If the region of interest is not a Roi object

Examples

>>> dvid_array.roi
Roi(...)

Notes

The region of interest is the same as the source array

property writable: bool

Returns whether the DVID array is writable

Returns:

Whether the DVID array is writable

Return type:

bool

Raises:

ValueError – If the writable is not a boolean

Examples

>>> dvid_array.writable
False

Notes

The writable is the same as the source array

property dtype: Any

Returns the data type of the DVID array

Returns:

The data type of the DVID array

Return type:

type

Raises:

ValueError – If the data type is not a type

Examples

>>> dvid_array.dtype
numpy.uint64

Notes

The data type is the same as the source array

property num_channels: int | None

Returns the number of channels of the DVID array

Returns:

The number of channels of the DVID array

Return type:

int

Raises:

ValueError – If the number of channels is not an integer

Examples

>>> dvid_array.num_channels
1

Notes

The number of channels is the same as the source array

property spatial_axes: List[str]

Returns the spatial axes of the DVID array

Returns:

The spatial axes of the DVID array

Return type:

List[str]

Raises:

ValueError – If the spatial axes is not a list

Examples

>>> dvid_array.spatial_axes
['z', 'y', 'x']

Notes

The spatial axes are the same as the source array

property data: Any
Abstractmethod:

Returns the number of channels of the DVID array

Returns:

The number of channels of the DVID array

Return type:

int

Raises:

ValueError – If the number of channels is not an integer

Examples

>>> dvid_array.num_channels
1

Notes

The number of channels is the same as the source array

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

Adds metadata to the DVID array

Parameters:

metadata (dict) – The metadata to add to the DVID array

Returns:

None

Raises:

ValueError – If the metadata is not a dictionary

Examples

>>> dvid_array.add_metadata({'description': 'This is a DVID array'})

Notes

The metadata is added to the source array