So I want to measure the max pixel and average of pixels in each label(in multiple array) using scipy. for example
(img , other is a numpy array of an opened tif)
import numpy as np
import scipy.ndimage as ndi
a = img > 200
labels,nb = ndi.labels(a)
merge = np.zeros(img.shape)
merge = other * a
So for each label I want to find the min value of the pixel, the max value of the pixel and the average of the intensities(the area of each label I can count) for img and merge. And I want to be able to make an histogram with these counts per label(connected area in img). (I know how to make the histograms once I have the np array or list)
I was thinking in making a loop for each label and then make a binary structure only with that label and measure the values. Is there any fast scipy/numpy method to do it without going through a loop?
Thanks!