Skip to content

Implement median filter for float types - #1422

Closed
spark1729 wants to merge 3 commits into
scikit-image:masterfrom
spark1729:issue1419
Closed

spark1729 wants to merge 3 commits into
scikit-image:masterfrom
spark1729:issue1419

Conversation

@spark1729

Copy link
Copy Markdown

Median filter was only available for integer-type images, as raised in Issue #1419. Impemented a new funtions median_float which internally uses nd_image.filters._rank_filter.

Comment thread skimage/filters/rank/generic.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove unnecessary blank lines,

Comment thread skimage/filters/rank/generic.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spark1729
These fancy quotes seem to be causing a problem

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't median detect the dtype and respond by calling the correct underlying implementation?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can but the parameters are different. The idea that emmanuelle shared was to give the output of ndimage.median_filter for float images.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's true that it would be nice to have only one function exposed to the other. Even if the API of the ndimage is different, can you adapt parameters passed to the scikit-image API to determine the corresponding parameters for ndimage, and then test for the dtype of the image within the exposed median function?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spark1729 ndimage.median_filter has a different API, but you can still use the footprint and origin arguments to adapt the arguments passed to skimage's function median.

Do you think you will have the time to modify your PR so that only one function median is exposed, inside which the dtype of the image is tested and a different function is called for uint8 (the existing code) and float types?

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) to 92.71% when pulling 1812a2f on spark1729:issue1419 into e91dcba on scikit-image:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.0%) to 92.71% when pulling 41e8702 on spark1729:issue1419 into e91dcba on scikit-image:master.

@dshean

dshean commented Jul 17, 2015

Copy link
Copy Markdown

I just upgraded to 0.11.3 and I'm kind of surprised by the changes in the median filter functionality. I used the older skimage.filter.median_filter rather than the scipy.ndimage.filters.median_filter because I preferred the way it handled missing values. Scipy propagates data gaps, while the old skimage median filter would "fill" small gaps. It looks like the old skimage median_filter functionality is no longer available?

It seems that requiring the user to scale their input float array to [-1,1] will be cumbersome. Hopefully this will happen behind the scenes in future releases.

@JDWarner

Copy link
Copy Markdown
Contributor

@dshean, would you mind raising that in a separate Issue? I don't want your concerns getting drowned out here in a discussion of new median filter functionality for float types.

@dshean

dshean commented Jul 17, 2015

Copy link
Copy Markdown

#1616
Thanks.

@soupault soupault added the ⏩ type: Enhancement Improve existing features label Feb 6, 2016
@soupault soupault changed the title ENH: Implement median filter for float types Implement median filter for float types Oct 25, 2016
@ahundt

ahundt commented Dec 30, 2017

Copy link
Copy Markdown

Is there any chance this floating point median filter can be updated/brought in?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants