Skip to content

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

@bogovicj

Description

@bogovicj

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions