webknossos.geometry.vec3_int
¶
Vec3Int
¶
Bases: VecInt
add_or_none
¶
add_or_none(other: Optional[VecInt]) -> _T | None
Adds two VecInts or returns None if the other is None.
Parameters:
-
other
(VecInt | None
) –The other vector to add.
Returns:
-
_T | None
–VecInt | None: The sum of the two vectors or None if the other is None.
ceildiv
¶
ceildiv(other: Union[int, VecIntLike]) -> _T
Returns a new VecInt with the ceil division of each element by the other.
from_xyz
staticmethod
¶
from_xyz(x: int, y: int, z: int) -> Vec3Int
Use Vec3Int.from_xyz for fast construction.
is_positive
¶
is_positive(strictly_positive: bool = False) -> bool
Checks if all elements in the vector are positive.
Parameters:
-
strictly_positive
(bool
, default:False
) –If True, checks if all elements are strictly positive.
Returns:
-
bool
(bool
) –True if all elements are positive, False otherwise.
moveaxis
¶
moveaxis(source: int | list[int], target: int | list[int]) -> _T
Allows to move one element at index source
to another index target
. Similar to
np.moveaxis, this is not a swap operation but instead it moves the specified
source so that the other elements move when necessary.
Parameters:
-
source
(int | list[int]
) –The index of the element to move.
-
target
(int | list[int]
) –The index where the element should be moved to.
Returns:
-
VecInt
(_T
) –A new vector with the moved element.
pairmax
¶
pairmax(other: Union[int, VecIntLike]) -> _T
Returns a new VecInt with the maximum of each pair of elements from the two vectors.
pairmin
¶
pairmin(other: Union[int, VecIntLike]) -> _T
Returns a new VecInt with the minimum of each pair of elements from the two vectors.
with_replaced
¶
with_replaced(index: int, new_element: int) -> _T
Returns a new ND Vector with a replaced element at a given index.
- Get Help
- Community Forums
- Email Support