Patch Set 7:
Hi Everyone,
Thanks for the efforts so far. Here's what I think is going on with the AutoMinimumMaximum settings.
When setting up a histogram it is necessary to specify a range of values that are going to be put into it so that the bins can be created. When the "auto" flag is off in the max and min settings appear to be derived from the max and min of the pixel type: ImageToHistogramFilter, lines 209 and 217. This makes sense if the image dynamic range is a substantial proportion of the pixel type.
If the pixel range is used (auto=off) for, say, unsigned short types, while the input dynamic range is actually unsigned char, then we end up with all the data in a tiny number of bins, not providing a useful approximation of the distribution, and probably leading to crazy threshold estimates (like all black).
I think that if the auto flag is off for larger pixel types we should have some way of explicitly setting the min/max used by the histogram generator, but it looks as though this is missing. It would be useful to be able to set the range explicitly if the data had some outliers and some robust estimation of range was necessary, or the range was already known and we want to optimize things by avoiding recalculation.
Thus, I think our problem here is that we don't have a way of setting the range when we turn auto calculation off. There is no reason to expect sensible results if the auto flag is off and no alternative estimate of range is provided.
The default is to have auto on for non char pixel types.