-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature map / return_indices #47
Comments
Hi Kevin, I'll have to think about it. The existing algorithm doesn't propagate this information so some rethinking will be necessary. This is pretty similar to (maybe the same as) computing the voronoi diagram of a given object. Another github user requested this functionality a little while ago for doing fast morphological dilations. Very happy you're getting a lot of mileage out of this library, I've recommended cellpose a at least once. |
Hi William! Thanks for this. I just want to say that I also find the |
Off the top of my head, I can think of an okay, but not great, algorithm for computing them from the output of EDT that would be relatively easy to implement. Something less than quadratic at least. I'm pretty busy at the moment, so it might take a substantial amount of time before I get a crack at it. If you can submit a PR or a design, that might make things go faster. Thanks so much for using EDT and being interested in its development! |
So I serendipitously discovered that the feature transform is a separable part of scipy. I might be able to include it as an optional feature if you also have scipy installed. The implementation would look something like this:
|
Actually, even better you can calculate the feature transform in scipy without the distance transform.
|
I am curious if it would be possible to include the
return_indices
argument/ output of scipy.ndimage.distance_transform_edt, which returns a map of the closest object index for each pixel of the distance field. This is only relevant for the distance transform of the background, where it can be important to know which labelled object is closest.The text was updated successfully, but these errors were encountered: