p = pixelBlocks["raster_pixels"]
if self.measure is None:
b = resize(p, shape, order=0, preserve_range=True)
else:
blockSizes = tuple(np.divide(p.shape, shape))
b = measure.block_reduce(p, blockSizes, self.measure)
After Change
def updatePixels(self, tlc, shape, props, **pixelBlocks):
if self.func is None:
b = resize(pixelBlocks["raster_pixels"], shape, order=0, preserve_range=True)
m = resize(pixelBlocks["raster_mask"], shape, order=0, preserve_range=True)
else:
p = pixelBlocks["raster_pixels"]