neuron_morphology.snap_polygons.bounding_box module

class neuron_morphology.snap_polygons.bounding_box.BoundingBox(horigin: float, vorigin: float, hextent: float, vextent: float)[source]

Bases: object

Attributes:
aspect_ratio
coordinates
extent
height
hextent
horigin
origin
vextent
vorigin
width

Methods

copy(self) Duplicates this bounding box
round(self, inplace, origin_via, …) Round the coordinates of this box
transform(self, transform, float], …) Apply a transform to this box
update(self, horigin, vorigin, hextent, vextent) Potentially enlarges this box.
aspect_ratio
coordinates
copy(self) → 'BoundingBox'[source]

Duplicates this bounding box

Returns:
A copy of this object.
extent
height
hextent
horigin
origin
round(self, inplace: bool = False, origin_via: Callable[[float], float] = <function around at 0x7feccce26ee0>, extent_via: Callable[[float], float] = <function around at 0x7feccce26ee0>)[source]

Round the coordinates of this box

Parameters:
inplace : If True, round the coordinates of this object
origin_via : method to use when rounding the origin
extent_via : method to use when rounding the extent
Returns:
The rounded box (potentially self.
transform(self, transform: Callable[[float, float], Tuple[float, float]], inplace: bool = False) → 'BoundingBox'[source]

Apply a transform to this box

Parameters:
transform : A callable which maps (vertical, horizontal) coordinates to

new (vertical, horizontal) coordinates.

inplace : if True, apply the transform to this object
Returns:
The transformed box (potentially self)
update(self, horigin: float, vorigin: float, hextent: float, vextent: float)[source]

Potentially enlarges this box.

Parameters:
As to the constructor of BoundingBox. The new shape of this box is the

smallest box enclosing both this and the inputs.

vextent
vorigin
width