def __mode2offset(voxel_size, mode='c'):
    """Modes
        'c': center
        'b': boundary

    """
    if mode == 'c':
        return voxel_size / 2
    elif mode == 'b':
        return 0
    else:
        raise NotImplementedError(f"Unknown offset mode{mode}")