def get_crop(bbox):
    """Get crop coordinates and side length given a bounding box.
    Force the crop to be square.

    Args:
        bbox: x1, y1, x2, y2; coordinates for bounding box.

    Returns:
        x1, y1, side_length:
    """
    # Get side length to keep square aspect ratio
    x1, y1, x2, y2 = bbox
    side_length = max(x2 - x1, y2 - y1) + 1

    # Center the skull in the cropped region
    x1 = max(0, x1 - (side_length - (x2 - x1 + 1)) // 2)
    y1 = max(0, y1 - (side_length - (y2 - y1 + 1)) // 2)

    return x1, y1, side_length