def rescale(volume, min, max):
    """Rescale the values of a volume between min and max."""
    
    factor = float(max - min) / float(volume.max() - volume.min())
    return ((volume - volume.min()) * factor) + min