webknossos.dataset._array
class
ArrayException(builtins.Exception):
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
- args
class
ArrayInfo:
ArrayInfo( data_format: webknossos.dataset.data_format.DataFormat, num_channels: int, voxel_type: numpy.dtype, chunk_shape: webknossos.geometry.vec3_int.Vec3Int, chunks_per_shard: webknossos.geometry.vec3_int.Vec3Int, shape: webknossos.geometry.vec_int.VecInt = VecInt(1,1,1,1), dimension_names: Tuple[str, ...] = ('c', 'x', 'y', 'z'), axis_order: webknossos.geometry.vec_int.VecInt = VecInt(3,2,1,0), compression_mode: bool = False)
data_format: webknossos.dataset.data_format.DataFormat
chunk_shape: webknossos.geometry.vec3_int.Vec3Int
chunks_per_shard: webknossos.geometry.vec3_int.Vec3Int
shard_size: webknossos.geometry.vec3_int.Vec3Int
shard_shape: webknossos.geometry.vec3_int.Vec3Int
class
BaseArray(abc.ABC):
Helper class that provides a standard way to create an ABC using inheritance.
@classmethod
@abstractmethod
def
open(_cls, path: pathlib.Path) -> webknossos.dataset._array.BaseArray:
@classmethod
@abstractmethod
def
create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.BaseArray:
@abstractmethod
def
read( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox) -> numpy.ndarray:
@abstractmethod
def
write( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, data: numpy.ndarray) -> None:
@abstractmethod
def
ensure_size( self, new_bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, align_with_shards: bool = True, warn: bool = False) -> None:
@abstractmethod
def
list_bounding_boxes(self) -> Iterator[webknossos.geometry.nd_bounding_box.NDBoundingBox]:
The bounding boxes are measured in voxels of the current mag.
@staticmethod
def
get_class( data_format: webknossos.dataset.data_format.DataFormat) -> type[webknossos.dataset._array.BaseArray]:
Helper class that provides a standard way to create an ABC using inheritance.
@classmethod
def
create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.WKWArray:
def
write( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, data: numpy.ndarray) -> None:
def
ensure_size( self, new_bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, align_with_shards: bool = True, warn: bool = False) -> None:
Helper class that provides a standard way to create an ABC using inheritance.
@classmethod
def
create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.ZarrArray:
def
ensure_size( self, new_bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, align_with_shards: bool = True, warn: bool = False) -> None:
def
write( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, data: numpy.ndarray) -> None:
Writes a ZarrArray. If offset and bbox are given, the bbox is preferred to enable writing of n-dimensional data.
Helper class that provides a standard way to create an ABC using inheritance.
@classmethod
def
create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.ZarritaArray:
def
ensure_size( self, new_bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, align_with_shards: bool = True, warn: bool = False) -> None:
def
write( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox, data: numpy.ndarray) -> None: