zetta_utils.geometry
¶
autoclass:: zetta_utils.geometry.bbox.BBox3D
- zetta_utils.geometry.bbox.BBox3D.from_slices(slices, resolution=(1, 1, 1), unit='nm')¶
Create a
BBox3D
from slices at the given resolution.
- zetta_utils.geometry.bbox.BBox3D.from_coords(start_coord, end_coord, resolution=(1, 1, 1), unit='nm')¶
Create a
BBox3D
from start and end coordinates at the given resolution.
- zetta_utils.geometry.bbox.BBox3D.get_slice(self, dim, resolution, allow_slice_rounding=False, round_to_int=True)¶
Represent the bounding box as a slice along the given dimension.
- Parameters
dim (
int
) – Dimension along which the slice will be taken.resolution (
Union
[int
,float
,Sequence
[float
]]) – Resolution at which the slice will be taken.allow_slice_rounding (
bool
) – Whether to allow representing bounding box with non-integer slice start/end at the given resolution.round_to_int (
bool
) – Whether the slices should be returned as an int or whether they should be returned as raw. If set toFalse
, takes precedence overallow_slice_rounding
.
- Return type
- Returns
Slice representing the bounding box.
- zetta_utils.geometry.bbox.BBox3D.to_slices(self, resolution, allow_slice_rounding=False, round_to_int=True)¶
Represent the bounding box as a tuple of slices.
- Parameters
resolution (
Sequence
[float
]) – Resolution at which the slices will be taken.allow_slice_rounding (
bool
) – Whether to allow representing bounding box with non-integer slice start/end at the given resolution.round_to_int (
bool
) – Whether the slices should be returned as an int or whether they should be returned as raw. If set toFalse
, takes precedence overallow_slice_rounding
.
- Return type
- Returns
Slices representing the bounding box.
- zetta_utils.geometry.bbox.BBox3D.padded(self, pad, resolution)¶
Create a padded (i.e. expanded) version of this bounding box.
- zetta_utils.geometry.bbox.BBox3D.translated(self, offset, resolution)¶
Create a translated version of this bounding box.
- class zetta_utils.geometry.BBoxStrider¶