dacapo.experiments.datasplits.datasets.arrays.resampled_array

Classes

ResampledArray

This is a zarr array that is a resampled version of another array.

Module Contents

class dacapo.experiments.datasplits.datasets.arrays.resampled_array.ResampledArray(array_config)

This is a zarr array that is a resampled version of another array.

Resampling is done by rescaling the source array with the given upsample and downsample factors. The voxel size of the resampled array is the voxel size of the source array divided by the downsample factor and multiplied by the upsample factor.

name

str The name of the array

source_array

Array The source array

upsample

Coordinate The upsample factor for each dimension

downsample

Coordinate The downsample factor for each dimension

interp_order

int The order of the interpolation used for resampling

attrs()

Dict Returns the attributes of the source array

axes()

str Returns the axes of the source array

dims()

int Returns the number of dimensions of the source array

voxel_size()

Coordinate Returns the voxel size of the resampled array

roi()

Roi Returns the region of interest of the resampled array

writable()

bool Returns whether the resampled array is writable

dtype()

np.dtype Returns the data type of the resampled array

num_channels()

int Returns the number of channels of the resampled array

data()

np.ndarray Returns the data of the resampled array

scale()

Tuple[float] Returns the scale of the resampled array

__getitem__(roi

Roi) -> np.ndarray Returns the data of the resampled array within the given region of interest

_can_neuroglance() bool

Returns whether the source array can be visualized with neuroglance

_neuroglancer_layer() Dict

Returns the neuroglancer layer of the source array

_neuroglancer_source() Dict

Returns the neuroglancer source of the source array

_source_name() str

Returns the name of the source array

Note

This class is a subclass of Array.

name
upsample
downsample
interp_order
property attrs
Returns the attributes of the source array.
Returns:

The attributes of the source array

Return type:

Dict

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.attrs

Note

This method returns the attributes of the source array.

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

The axes of the source array

Return type:

str

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.axes

Note

This method returns the axes of the source array.

property dims: int

Returns the number of dimensions of the source array.

Returns:

The number of dimensions of the source array

Return type:

int

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.dims

Note

This method returns the number of dimensions of the source array.

property voxel_size: funlib.geometry.Coordinate

Returns the voxel size of the resampled array.

Returns:

The voxel size of the resampled array

Return type:

Coordinate

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.voxel_size

Note

This method returns the voxel size of the resampled array.

property roi: funlib.geometry.Roi

Returns the region of interest of the resampled array.

Returns:

The region of interest of the resampled array

Return type:

Roi

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.roi

Note

This method returns the region of interest of the resampled array.

property writable: bool

Returns whether the resampled array is writable.

Returns:

True if the resampled array is writable, False otherwise

Return type:

bool

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.writable

Note

This method returns whether the resampled array is writable.

property dtype
Returns the data type of the resampled array.
Returns:

The data type of the resampled array

Return type:

np.dtype

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.dtype

Note

This method returns the data type of the resampled array.

property num_channels: int

Returns the number of channels of the resampled array.

Returns:

The number of channels of the resampled array

Return type:

int

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.num_channels

Note

This method returns the number of channels of the resampled array.

property data
Returns the data of the resampled array.
Returns:

The data of the resampled array

Return type:

np.ndarray

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.data

Note

This method returns the data of the resampled array.

property scale
Returns the scale of the resampled array.
Returns:

The scale of the resampled array

Return type:

Tuple[float]

Raises:

ValueError – If the resampled array is not writable

Examples

>>> resampled_array.scale

Note

This method returns the scale of the resampled array.