Okay, if I'm following this correctly, the macro essentially duplicates
each image, converts the duplicate to 32-bit, and then runs a histogram
of the 32-bit image. Since 32-bit histograms do properly let you set
the min and max, this works, albeit VERY slowly for large stacks. :-)
If converting to 32-bit is the way to go, then that's what I'll do. It
looks like the auto-ranging for 16-bit-image histograms is hard-coded
deep within ShortStatistics, and not amenable to outside modification.
Maybe later I'll see if there's a way to fix this without rewriting
ShortStatistics. (Is there a reason that non-float images ignore
ImageProcessor.histogramMin and histogramMax, or did it just grow that
way?)
Thanks, Wayne!
On Aug 4, 2005, at 10:49 AM, Wayne Rasband wrote:
>> I'm trying to set up a macro that allows a user to compare
>> histograms for the same ROI in multiple (16-bit signed or
>> unsigned) stacks. It's easy enough to use ROI manager to
>> stamp the same ROI onto multiple stacks, but I can't find a
>> way to normalize the resulting histograms to the same scale.
>>
>> I'd like to just set the min and max for the histogram
>> (say, 0 to 32767), and use that same range repeatably.
>
> The CustomHistogram macro at
>
>
http://rsb.info.nih.gov/ij/macros/CustomHistogram.txt>
> does this.
>
> -wayne
>
--
-jeffB (Jeff Brandenburg, Duke Center for In-Vivo Microscopy)