def rasterFromDataset(dataset):
    """
	Reads all raster bands from a dataset and returns them as a NumPy ndarray of shape (h,w[,c])
	"""
    raster = dataset.ReadAsArray()
    if len(raster.shape) > 2:
        raster = raster.transpose((1, 2, 0))
    return raster
