webknossos.cli._utils
Utilities to work with the CLI of webknossos.
class
VoxelSizeTuple(builtins.tuple):
VoxelSizeTuple(x, y, z)
Inherited Members
- builtins.tuple
- index
- count
class
Vec2Int(builtins.tuple):
Vec2Int(x, y)
Inherited Members
- builtins.tuple
- index
- count
class
DistributionStrategy(builtins.str, enum.Enum):
Enum of available distribution strategies.
TODO
- As soon as supported by typer this enum should be replaced with typing.Literal in type hint. https://github.com/tiangolo/typer/pull/669
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
- As soon as supported by typer this enum should be replaced with typing.Literal in type hint. https://github.com/tiangolo/typer/pull/669
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
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.
Parses str input to tuple of two integers.
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).