Skip to content
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 request: mask dilation or pixel based distance #756

Open
alex-s-gardner opened this issue Sep 20, 2024 · 5 comments
Open

Feature request: mask dilation or pixel based distance #756

alex-s-gardner opened this issue Sep 20, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@alex-s-gardner
Copy link
Contributor

alex-s-gardner commented Sep 20, 2024

The Images package has a really powerful pixel distance calculation (similar to bwdist in matlab: https://www.mathworks.com/help/images/ref/bwdist.html)... I use it all the time in my work and suspect other would appreciate it as well..

Right now I do this:

Images.distance_transform(feature_transform(BitMatrix)) 

which return the pixel distance matrix.

I'm wondering if we should just stick with this or if there is a good reason to provide better integration between Rasters and Images such that users could do things like:

raster_mask_dialated = Rasters.dialate(raster_mask, 2)
raster_distance_from_mask = Rasters.pixeldist(raster_mask)

Not sure what the philosophy here is.

@rafaqz
Copy link
Owner

rafaqz commented Sep 21, 2024

Why not add those functions to Images.jl for any array?

What's the advantage of Rasters defining them?

@alex-s-gardner
Copy link
Contributor Author

This functions (capabilities) are in Images and can be preformed on any array.

I guess I was simply thinking that helper functions within Rasters would improve user experience as it's a bit of a lift to learn a new package to do what I would consider a common operation of mask dilation. But I also understand that it might not makes sense, as it adds complexity to Rasters and another dependency.. maybe it also goes against the ethos of compostability.

@rafaqz
Copy link
Owner

rafaqz commented Sep 21, 2024

Yeah if it already works fine, it just needs documentation so people know they can do it. And maybe better syntax in Images.jl.

The case for adding it here is where it doesn't return a Raster, but should

@alex-s-gardner
Copy link
Contributor Author

Going to leave this open to motivate the generation of an example.. and maybe improved Images.jl syntax

@rafaqz
Copy link
Owner

rafaqz commented Sep 22, 2024

Yes maybe we can get a longer list of Images.jl things that should work here and put them in docs and testing, then push any syntax changes we want back to Images.jl

@rafaqz rafaqz added the enhancement New feature or request label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants