I have a large image, which after marking has about 500 functions. I know how to get them in slices using find_object, but I want to color them so that I can see the result. Any quick suggestion for this?
You can use matplotlib as follows:
import scipy from scipy import ndimage import matplotlib.pyplot as plt im = scipy.misc.imread('all_blobs.png',flatten=1) im, number_of_objects = ndimage.label(im) blobs = ndimage.find_objects(im) plt.imsave('blobs.png', im) for i,j in enumerate(blobs): plt.imsave('blob'+str(i)+'.png',im[j])
source image:
tagged image:
slices containing drops: