Skip to content

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)
num_channels: int
voxel_type: numpy.dtype
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
class BaseArray(abc.ABC):

Helper class that provides a standard way to create an ABC using inheritance.

data_format = <DataFormat.WKW: 'wkw'>
@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.

@abstractmethod
def close(self) -> None:
@staticmethod
def get_class( data_format: webknossos.dataset.data_format.DataFormat) -> type[webknossos.dataset._array.BaseArray]:
class WKWArray(BaseArray):

Helper class that provides a standard way to create an ABC using inheritance.

WKWArray(path: pathlib.Path)
data_format = <DataFormat.WKW: 'wkw'>
@classmethod
def open(cls, path: pathlib.Path) -> webknossos.dataset._array.WKWArray:
@classmethod
def create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.WKWArray:
def read( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox) -> numpy.ndarray:
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:
def list_bounding_boxes(self) -> Iterator[webknossos.geometry.nd_bounding_box.NDBoundingBox]:

The bounding boxes are measured in voxels of the current mag.

def close(self) -> None:
Inherited Members
class ZarrArray(BaseArray):

Helper class that provides a standard way to create an ABC using inheritance.

ZarrArray(path: pathlib.Path)
data_format = <DataFormat.Zarr: 'zarr'>
@classmethod
def open(cls, path: pathlib.Path) -> webknossos.dataset._array.ZarrArray:
@classmethod
def create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.ZarrArray:
def read( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox) -> numpy.ndarray:
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.

def list_bounding_boxes(self) -> Iterator[webknossos.geometry.nd_bounding_box.NDBoundingBox]:

The bounding boxes are measured in voxels of the current mag.

def close(self) -> None:
Inherited Members
class ZarritaArray(BaseArray):

Helper class that provides a standard way to create an ABC using inheritance.

ZarritaArray(path: pathlib.Path)
data_format = <DataFormat.Zarr3: 'zarr3'>
@classmethod
def open(cls, path: pathlib.Path) -> webknossos.dataset._array.ZarritaArray:
@classmethod
def create( cls, path: pathlib.Path, array_info: webknossos.dataset._array.ArrayInfo) -> webknossos.dataset._array.ZarritaArray:
def read( self, bbox: webknossos.geometry.nd_bounding_box.NDBoundingBox) -> numpy.ndarray:
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:
def list_bounding_boxes(self) -> Iterator[webknossos.geometry.nd_bounding_box.NDBoundingBox]:

The bounding boxes are measured in voxels of the current mag.

def close(self) -> None:
Inherited Members