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

Ndimage measurements median #9

Closed
wants to merge 2 commits into from

Conversation

thouis
Copy link
Contributor

@thouis thouis commented Mar 27, 2011

This branch adds per-object median calculation to scipy.ndimage.measurements, implemented by adding to the algorithms already present in _select().

@rgommers
Copy link
Member

Looks fine to me. The one thing that's a little odd to me is that a list is returned instead of an array, but that choice was already made before.

@rgommers
Copy link
Member

Committed in SHA: 341791e . Thanks!

About median_positions(), that sounds not super useful to me. It may also not be well-defined, because the median can be the average of two values in the array.

@rgommers rgommers closed this Mar 27, 2011
@thouis
Copy link
Contributor Author

thouis commented Mar 28, 2011

Thanks.

There was a bit of discussion about the list vs. array a while ago:
http://mail.scipy.org/pipermail/scipy-dev/2009-April/011817.html
But it got sidretracked into a general rewrite of measurements.py in python.

Part of that discussion was a goal of rewriting the whole thing in Cython (with the python as a step toward that). I just learned about the bottleneck project (http://berkeleyanalytics.com/bottleneck/), which might be an easier path to a faster implementation (via an optional prerequisite, though I don't know how scipy feels about such things in general).

@rgommers
Copy link
Member

With prerequisite I guess you mean an optional import to replace scipy functions with faster ones? Sounds fine to me, but I'm not sure that it's much easier than just replacing it directly in scipy. It's also stretching the stated goals of Bottleneck quite a bit (it was meant to focus on NaN-related functions in numpy), so that will need some discussion with its authors.

Important thing is that someone is willing to work on it though, not much has happened since 2009 as far as I can tell.....

List vs array is not hugely important to be as I'm only an occasional ndimage user, it just looked odd to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants