Skip to content

webknossos.geometry.vec3_int

# &nbsp class Vec3Int(builtins.tuple):

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

# &nbsp Vec3Int( vec: Union[int, Union[webknossos.geometry.vec3_int.Vec3Int, Tuple[int, int, int], numpy.ndarray, Iterable[int]]], y: Union[int, NoneType] = None, z: Union[int, NoneType] = None )

Class to represent a 3D vector. Inherits from tuple and provides useful methods and operations on top.

A small usage example:

from webknossos import Vec3Int

vector_1 = Vec3Int(1, 2, 3)
vector_2 = Vec3Int.full(1)
assert vector_2.x == vector_2.y == vector_2.y

assert vector_1 + vector_2 == (2, 3, 4)
# &nbsp
@staticmethod
def from_xyz(x: int, y: int, z: int) -> webknossos.geometry.vec3_int.Vec3Int:

Use Vec3Int.from_xyz for fast construction.

# &nbsp
@staticmethod
def from_vec3_float( vec: Tuple[float, float, float] ) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp
@staticmethod
def from_vec_or_int( vec_or_int: Union[Union[webknossos.geometry.vec3_int.Vec3Int, Tuple[int, int, int], numpy.ndarray, Iterable[int]], int] ) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp x: int
# &nbsp y: int
# &nbsp z: int
# &nbsp def with_x(self, new_x: int) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def with_y(self, new_y: int) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def with_z(self, new_z: int) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def to_np(self) -> numpy.ndarray:
# &nbsp def to_list(self) -> List[int]:
# &nbsp def to_tuple(self) -> Tuple[int, int, int]:
# &nbsp def contains(self, needle: int) -> bool:
# &nbsp def is_positive(self, strictly_positive: bool = False) -> bool:
# &nbsp def is_uniform(self) -> bool:
# &nbsp def ceildiv( self, other: Union[int, Union[webknossos.geometry.vec3_int.Vec3Int, Tuple[int, int, int], numpy.ndarray, Iterable[int]]] ) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def pairmax( self, other: Union[int, Union[webknossos.geometry.vec3_int.Vec3Int, Tuple[int, int, int], numpy.ndarray, Iterable[int]]] ) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def pairmin( self, other: Union[int, Union[webknossos.geometry.vec3_int.Vec3Int, Tuple[int, int, int], numpy.ndarray, Iterable[int]]] ) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp def prod(self) -> int:
# &nbsp def add_or_none( self, other: Union[webknossos.geometry.vec3_int.Vec3Int, NoneType] ) -> Union[webknossos.geometry.vec3_int.Vec3Int, NoneType]:
# &nbsp
@classmethod
def zeros(cls) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp
@classmethod
def ones(cls) -> webknossos.geometry.vec3_int.Vec3Int:
# &nbsp
@classmethod
def full(cls, an_int: int) -> webknossos.geometry.vec3_int.Vec3Int:
Inherited Members
builtins.tuple
index
count