Sat 16 Apr 2016 02:07:16 PM UTC, comment #2:
> The script doesn't say what issues it is trying to avoid. Do you know what they are? I'd have thought that working with integers would be the way to go.
hg blame points to e8d953d03f6a . This precedes meaningful commit messages, but adds the following note on the ChangeLog file.
- plot/hist.m: Avoid saturation when the x values are in an inetger type.
There are no tests in hist for integer input so I will write them and see if this conversion to double is really necessary or if it can be avoided in some cases.
> Alternatively, do you need a histogram of your whole 4-D image, or is a histogram over one or two dimensions? A compromise may be to convert only one row/column/page/... at a time to double.
No, I want a single histogram for the whole image (this is to compute global threshold value). I have worked around it by using histc like so:
> However, I thought that "hist" was being phased out by Matlab in favour of "histogram". (I haven't checked the differences.) Perhaps we should just write an efficient implementation of that and leave hist.
Doesn't mean that the function hist will be removed. I think it's been around for far too long and widely used to just be dropped like that. If I can also make it better, good.
---
Another issue that I didn't mention at the start is that somewhere in the code, this actually crashed Octave. Sometimes it would error about not having enough memory (fair enough), but roughly half of the times the kernel would just kill the process due to out-of-memory.
|