Skip to content

minor_axis_len

Compute the minor axis length of a geometry.

Note

The minor axis is the (x,y) endpoints of the longest line that can be drawn through the object whilst remaining perpendicular with the major-axis. Minor axis length is the pixel distance between the minor-axis endpoints - Wirth

Parameters:

Name Type Description Default
geom Basegeometry

Input shapely geometry object.

required

Returns:

Name Type Description
float float

The length of the minor axis.

Source code in src/histolytics/spatial_geom/morphometrics.py
def minor_axis_len(geom: BaseGeometry) -> float:
    """Compute the minor axis length of a geometry.

    Note:
        The minor axis is the (x,y) endpoints of the longest line that
        can be drawn through the object whilst remaining perpendicular
        with the major-axis. Minor axis length is the pixel distance
        between the minor-axis endpoints
        - [Wirth](http://www.cyto.purdue.edu/cdroms/micro2/content/education/wirth10.pdf)

    Parameters:
        geom (Basegeometry):
            Input shapely geometry object.

    Returns:
        float:
            The length of the minor axis.
    """
    return axis_len(geom, "minor")