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"]
After Change
m = pixelBlocks["raster_mask"]
if self.func is None:
b = resize(p, shape, order=0, preserve_range=True)
else:
blockSizes = tuple(np.divide(p.shape, shape))
b = np.ma.masked_array(view_as_blocks(p, blockSizes),