dacapo.experiments.datasplits.datasets.arrays.sum_array

Classes

SumArray

This class provides a sum array. This array is a virtual array that is created by summing

Module Contents

class dacapo.experiments.datasplits.datasets.arrays.sum_array.SumArray(array_config)

This class provides a sum array. This array is a virtual array that is created by summing multiple source arrays. The source arrays must have the same shape and ROI.

name

str The name of the array.

_source_arrays

List[Array] The source arrays to sum.

_source_array

Array The first source array.

__getitem__(roi

Roi) -> np.ndarray Get the data for the given region of interest.

_can_neuroglance() bool

Check if neuroglance can be used.

_neuroglancer_source() Dict

Return the source for neuroglance.

_neuroglancer_layer() Tuple[neuroglancer.SegmentationLayer, Dict]

Return the neuroglancer layer.

_source_name() str

Return the source name.

Note

This class is a subclass of Array.

name
property axes
The axes of the array.
Returns:

The axes of the array.

Return type:

List[str]

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.axes
['x', 'y', 'z']

Note

This class is a subclass of Array.

property dims: int

The number of dimensions of the array.

Returns:

The number of dimensions of the array.

Return type:

int

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.dims
3

Note

This class is a subclass of Array.

property voxel_size: funlib.geometry.Coordinate

The size of each voxel in each dimension.

Returns:

The size of each voxel in each dimension.

Return type:

Coordinate

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.voxel_size
Coordinate([1, 1, 1])

Note

This class is a subclass of Array.

property roi: funlib.geometry.Roi

The region of interest of the array.

Parameters:

roi – Roi The region of interest.

Returns:

The region of interest.

Return type:

Roi

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.roi
Roi(Coordinate([0, 0, 0]), Coordinate([100, 100, 100]))

Note

This class is a subclass of Array.

property writable: bool

Check if the array is writable.

Parameters:

writable – bool Check if the array is writable.

Returns:

True if the array is writable, otherwise False.

Return type:

bool

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.writable
False

Note

This class is a subclass of Array.

property dtype
The data type of the array.
Parameters:

dtype – np.uint8 The data type of the array.

Returns:

The data type of the array.

Return type:

np.uint8

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.dtype
np.uint8

Note

This class is a subclass of Array.

property num_channels
The number of channels in the array.
Parameters:

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

Returns:

The number of channels in the array.

Return type:

Optional[int]

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.num_channels
None

Note

This class is a subclass of Array.

property data
Get the data of the array.
Parameters:

data – np.ndarray The data of the array.

Returns:

The data of the array.

Return type:

np.ndarray

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.data
np.array([[[0, 0], [0, 0]], [[0, 0], [0, 0]]])

Note

This class is a subclass of Array.

property attrs
Return the attributes of the array.
Parameters:

attrs – Dict The attributes of the array.

Returns:

The attributes of the array.

Return type:

Dict

Raises:

ValueError – Cannot get a writable view of this array because it is a virtual array created by modifying another array on demand.

Examples

>>> sum_array.attrs
{}

Note

This class is a subclass of Array.