def _calc_box(ip_range, op_range):
    """Main function for calculating box regions of interest.
    Called by op_box_roi and ip_box_roi.

    Args:
         ip_range (tuple): in-plane (min, max).
        op_range (tuple): out-of-plane (min, max).

    Returns:
        qr, qz (tuple of ndarrays): arrays defining the region of interest.
    """
    qr = [ip_range[0], ip_range[0], ip_range[1], ip_range[1], ip_range[0]]
    qz = [op_range[0], op_range[1], op_range[1], op_range[0], op_range[0]]
    return qr, qz