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

Histogram RealBinMapper - bin centers inconsistent with given min / max values #25

Open
bogovicj opened this issue May 26, 2016 · 1 comment

Comments

@bogovicj
Copy link
Contributor

Bin centers computed by net.imglib2.algorithm.stats.RealBinMapper are not consistent with the input minBin and maxBin values and not what I'd expect.

invMap's behavior is also not what I'd expect:

  • Put 4 bins between the interval [0.0 1.0]
    • Expect bin "boundaries" at 1/4, 2/4, 3/4 and therefore:
    • Expect bin centers at 1/8, 3/8, 5/8, 7/8
    • Observe: centers are not what was expected, some are out-of-bounds

Pseudocode:

mapper = RealBinMapper( 0.0, 1.0, 4 )  

println( mapper.invMap( 0 ))
println( mapper.invMap( 1 ))
println( mapper.invMap( 2 ))
println( mapper.invMap( 3 ))

outputs

0.0
0.5
1.0
1.5

net.imglib2.histogram.Real1dBinMapper however seems to work as expected.
https://github.com/imglib/imglib2/tree/master/src/main/java/net/imglib2/histogram

Perhaps we should deprecate net.imglib2.algorithm.stats in favor of net.imglib2.histogram (?)
which so far seems to have the behavior I expect.

@ctrueden
Copy link
Member

ctrueden commented Jun 5, 2016

👍 on my side. The net.imglib2.histogram stuff is certainly what ImageJ Ops and ImageJ Common is using.

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

2 participants