Skip to content

webknossos.geometry.vec3_int

#   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.

#   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)
#  
@staticmethod
def from_xyz(x: int, y: int, z: int) -> webknossos.geometry.vec3_int.Vec3Int:

Use Vec3Int.from_xyz for fast construction.

#  
@staticmethod
def from_vec3_float( vec: Tuple[float, float, float] ) -> webknossos.geometry.vec3_int.Vec3Int:
#  
@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:
#   x: int
#   y: int
#   z: int
#   def with_x(self, new_x: int) -> webknossos.geometry.vec3_int.Vec3Int:
#   def with_y(self, new_y: int) -> webknossos.geometry.vec3_int.Vec3Int:
#   def with_z(self, new_z: int) -> webknossos.geometry.vec3_int.Vec3Int:
#   def to_np(self) -> numpy.ndarray:
#   def to_list(self) -> List[int]:
#   def to_tuple(self) -> Tuple[int, int, int]:
#   def contains(self, needle: int) -> bool:
#   def is_positive(self, strictly_positive: bool = False) -> bool:
#   def is_uniform(self) -> bool:
#   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:
#   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:
#   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:
#   def prod(self) -> int:
#   def add_or_none( self, other: Union[webknossos.geometry.vec3_int.Vec3Int, NoneType] ) -> Union[webknossos.geometry.vec3_int.Vec3Int, NoneType]:
#  
@classmethod
def zeros(cls) -> webknossos.geometry.vec3_int.Vec3Int:
#  
@classmethod
def ones(cls) -> webknossos.geometry.vec3_int.Vec3Int:
#  
@classmethod
def full(cls, an_int: int) -> webknossos.geometry.vec3_int.Vec3Int:
Inherited Members
builtins.tuple
index
count
Back to top