[MINC-users] mincstats histogram count limit?

Andrew Janke a.janke at gmail.com
Sat Nov 16 00:29:16 EST 2013


On 15 November 2013 20:17, Alex Zijdenbos <zijdenbos at gmail.com> wrote:
> $ mincstats -clobber -quiet -none -integer_histogram -hist_range 1 3
> -histogram hr_hist.txt hr.mnc
> 451431944
> $ cat hr_hist.txt
> # histogram for: hr.mnc
> #  mask file:    (null)
> #  domain:       0.5  3.5
> #  entropy:      1.32723
> # bin centres                 counts
>   1                      1.67322e+07
>   2                      1.67772e+07
>   3                      1.67772e+07
>
> However:
>
> $ mincstats -clobber -none -count -binvalue 1,2,3 hr.mnc
> Included Range:    0.5   1.5
> # voxels:          16732212
> Included Range:    1.5   2.5
> # voxels:          42817611
> Included Range:    2.5   3.5
> # voxels:          35033439
>
> The red and green results _should_ be the same; but in the histogram output
> the seem to be capped at 1.67772e+07, which is clearly wrong.
>
> Anybody able to figure this out?

Strange..

This looks to me more like a memory error in that only the first count
is printed, the histogram range calculation has always been a bit of
black magic that made sense at the time it was written! and then Peter
and Bert both had a go at adding things to it.

For some reason I also note that the histogram array is a float and
everything else is double. Is there a chance that this is a cast
problem that only shows up on 64 bit?  Can you change line 154:

   https://github.com/BIC-MNI/minc-tools/blob/master/progs/mincstats/mincstats.c#L154

To double and test?


a


More information about the MINC-users mailing list