import math


def get_extent_at_res(base_extent, res, iso=False):
    """Returns extent at a given resolution of precomptued volume
    res=0 is base resolution
    """

    if iso:
        factor = (2, 2, 2)
    else:
        factor = (2, 2, 1)

    return [math.ceil(e / f ** res) for e, f in zip(base_extent, factor)]