:mod:`neuron_morphology.snap_polygons.bounding_box` =================================================== .. py:module:: neuron_morphology.snap_polygons.bounding_box .. autoapi-nested-parse:: Contains a simple utility for representing a "growable" 2D rectangle .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: neuron_morphology.snap_polygons.bounding_box.BoundingBox .. py:class:: BoundingBox(horigin: float, vorigin: float, hextent: float, vextent: float) Represents the bounds of a set of 2D objects :Parameters: **vorigin, horigin** : the near corner of the box .. **vextent, hextent** : the far corner of the box .. .. !! processed by numpydoc !! .. attribute:: __slots__ :annotation: = ['vorigin', 'horigin', 'vextent', 'hextent'] .. attribute:: width :annotation: :float Horizontal side length of the box. .. !! processed by numpydoc !! .. attribute:: height :annotation: :float Vertical side length of the box. .. !! processed by numpydoc !! .. attribute:: aspect_ratio :annotation: :float Width / height ratio of the box. .. !! processed by numpydoc !! .. attribute:: origin Coordinates of the box's origin. .. !! processed by numpydoc !! .. attribute:: extent Coordinates of the box's extent (opposite corner from the origin). .. !! processed by numpydoc !! .. attribute:: coordinates Origin and extent coordinates. .. !! processed by numpydoc !! .. method:: __repr__(self) Return repr(self). .. !! processed by numpydoc !! .. method:: update(self, horigin: float, vorigin: float, hextent: float, vextent: float) 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. .. !! processed by numpydoc !! .. method:: transform(self, transform: TransformType, inplace: bool = False) 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) .. .. !! processed by numpydoc !! .. method:: copy(self) Duplicates this bounding box :Returns: A copy of this object. .. .. !! processed by numpydoc !! .. method:: round(self, inplace: bool = False, origin_via: Callable[[float], float] = np.around, extent_via: Callable[[float], float] = np.around) 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. .. .. !! processed by numpydoc !!