I’ve started using scikit-image to perform segmentation and labeling of axons and synaptic puncta. I create labels for axons using edge-detection and watershed. I repeat this process for synaptic puncta with different parameters (i.e. lower_limit, min_size, etc.)
image = axons[0:200, 0:200] foreground, background = 1, 2 markers = np.zeros_like(image) markers[image < lower_limit] = background markers[image > upper_limit] = foreground ws = watershed(sobel(image), markers) seg = label(ws == foreground) objects = skimage.measure.regionprops(seg) #size filter filter = np.arange(np.max(seg) + 1) for object in objects: if not (min_size <= object.area <= max_size): filter[object.label] = 0 labels = filter[seg] #remove labels touching border labels = skimage.segmentation.clear_border(labels)
In the image below, I’ve overlaid the labeled puncta (green) on top of labeled axons (red):
I’m interested in performing analysis on puncta that are within axons. Puncta that overlap at least 50% with an axon would be classified as within that axon. Does scikit-image have any built-in function for a “filter” like this? Maybe a way to iterate through each puncta and check for this condition?
Any help or advice is greatly appreciated! Thank you!