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

Add stats.mode op to compute modal value #622

Open
imagejan opened this issue Apr 14, 2020 · 0 comments
Open

Add stats.mode op to compute modal value #622

imagejan opened this issue Apr 14, 2020 · 0 comments

Comments

@imagejan
Copy link
Member

To my knowledge, there's currently no op available to compute modal values.

The ImageJ 1.x implementation is e.g. here in ShortProcessor

As a workaround, the mode can be computed as in this gist:

import net.imglib2.algorithm.stats.Max

histogram = ops.run("histogram", input)
cursor = Max.findMax(histogram)
value = input.firstElement().copy()
histogram.getCenterValue(cursor.getLongPosition(0), value)

See also these two forum topics.

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

No branches or pull requests

1 participant