Skip to content

webknossos.cli._utils

Utilities to work with the CLI of webknossos.

class VoxelSizeTuple(builtins.tuple):

VoxelSizeTuple(x, y, z)

VoxelSizeTuple(x, y, z)

Create new instance of VoxelSizeTuple(x, y, z)

x

Alias for field number 0

y

Alias for field number 1

z

Alias for field number 2

Inherited Members
builtins.tuple
index
count
class Vec2Int(builtins.tuple):

Vec2Int(x, y)

Vec2Int(x, y)

Create new instance of Vec2Int(x, y)

x

Alias for field number 0

y

Alias for field number 1

Inherited Members
builtins.tuple
index
count
class DistributionStrategy(builtins.str, enum.Enum):

Enum of available distribution strategies.

TODO

SLURM = <DistributionStrategy.SLURM: 'slurm'>
KUBERNETES = <DistributionStrategy.KUBERNETES: 'kubernetes'>
MULTIPROCESSING = <DistributionStrategy.MULTIPROCESSING: 'multiprocessing'>
DEBUG_SEQUENTIAL = <DistributionStrategy.DEBUG_SEQUENTIAL: 'debug_sequential'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class LayerCategory(builtins.str, enum.Enum):

Enum of available layer categories.

TODO

COLOR = <LayerCategory.COLOR: 'color'>
SEGMENTATION = <LayerCategory.SEGMENTATION: 'segmentation'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class SamplingMode(builtins.str, enum.Enum):

Enum of available sampling modes.

ANISOTROPIC = <SamplingMode.ANISOTROPIC: 'anisotropic'>
ISOTROPIC = <SamplingMode.ISOTROPIC: 'isotropic'>
CONSTANT_Z = <SamplingMode.CONSTANT_Z: 'constant_z'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
class Order(builtins.str, enum.Enum):

Enum of available orders.

C = <Order.C: 'C'>
F = <Order.F: 'F'>
Inherited Members
enum.Enum
name
value
builtins.str
encode
replace
split
rsplit
join
capitalize
casefold
title
center
count
expandtabs
find
partition
index
ljust
lower
lstrip
rfind
rindex
rjust
rstrip
rpartition
splitlines
strip
swapcase
translate
upper
startswith
endswith
isascii
islower
isupper
istitle
isspace
isdecimal
isdigit
isnumeric
isalpha
isalnum
isidentifier
isprintable
zfill
format
format_map
maketrans
def parse_mag(mag_str: str) -> webknossos.geometry.mag.Mag:

Parses str input to Mag

def parse_voxel_size(voxel_size_str: str) -> Tuple[float, float, float]:

Parses str input to tuple of three floats.

def parse_vec3int( vec3int_like: Union[str, webknossos.geometry.vec3_int.Vec3Int]) -> webknossos.geometry.vec3_int.Vec3Int:

Parses str input to tuple of three integers.

def parse_vec2int(vec2int_str: str) -> webknossos.cli._utils.Vec2Int:

Parses str input to tuple of two integers.

def parse_bbox(bbox_str: str) -> webknossos.geometry.bounding_box.BoundingBox:

Parses str input to BoundingBox.

def parse_path(value: str) -> upath.core.UPath:

Parses a string value to a UPath.

def pad_or_crop_to_size_and_topleft( cube_data: numpy.ndarray, target_size: numpy.ndarray, target_topleft: numpy.ndarray) -> numpy.ndarray:

Given an numpy array and a target_size/target_topleft, the array will be padded so that it is within the bounding box described by topleft and size. If the input data is too large, the data will be cropped (evenly from opposite sides with the assumption that the most important data is in the center).