def get_offset_array_start_and_end(array_length, array_offset, arry_2_lngth=None):
    """ Usage:  array_start, array_end = get_offset_array_start_and_end(array_length, array_offset, arry_2_lngth)
                single axis boundry in context of offset

    Args:
        array_length:   image dimension         (positive integer)
        array_offset:   registration offset     (signed integer)
        arry_2_lngth:   length of the second array (positive integer)

    Returns:            (positive integers)
        array_start:    first index in image diminsion
        array_end:      last index + 1 in image diminsion
    """
    array_start = max(0, array_offset)
    if arry_2_lngth is None:
        array_end = min(array_length, array_length + array_offset)
    else:
        array_end = min(array_length, arry_2_lngth + array_start)

    return array_start, array_end