Login  Register

Re: Retaining fixed histogram range while in Live mode?

Posted by Rasband, Wayne (NIH/NIMH) [E] on Aug 24, 2012; 10:58pm
URL: http://imagej.273.s1.nabble.com/Retaining-fixed-histogram-range-while-in-Live-mode-tp4999812p4999843.html

On Aug 20, 2012, at 1:06 PM, Bill Christens-Barry wrote:

> I'd like to maintain a fixed histogram range (0-4095) while in "live" mode, e.g. as I move through slices of a stack. I've found the macro Wayne gave previously to be very helpful for static histograms, but in live mode ImageJ adapts this range each time the histogram changes.
>
> Can anyone recommend a means for keeping the range constant while in live mode? Right now, I rerun Wayne's macro each time the histogram is changed. This has the drawback that each time the rewritten histogram is created, it jumps to the front and is centered on the display; it then needs to be moved to where it should be on the screen. This is a little distracting to the user. Unsurprisingly, using setBatchMode() to suppress display of the histogram until after it's been moved doesn't work.

You can fix the histogram range to 0-4095 by upgrading to the ImageJ 1.47c daily build and setting "16-bit range:" in the Edit>Options>Appearance dialog box to "12-bit (0-4095)".

-wayne


>>> Dear imageJ experts,
>>>
>>> I'd like to compare histograms from lots of images. By default, the
>>> X-axis of the histogram ranges from the minimal up to the maximal
>>> intensity recorded from each image, e.g. image1 9-250, image2
>>> 200-7500. So it's quite difficult to visually compare two histograms.
>>> Can I manually set the limits to the min (0) and max (7500) for all
>>> images?. Any help is appreciated, thank you!
>>
>> Hold the alt key down when running the Histogram command and you will
>> get a dialog box that allows you to specify the x-axis range. Or
>> install this macro, which generates a 0-7500 histogram when you press
>> 'h'.
>>
>>  macro "Histogram (0-7500) [h]" {
>>     setKeyDown("alt");
>>     run("Histogram", "bins=256 x_min=0 x_max=7500 y_max=Auto");
>>  }
>>
>> Add this macro to ImageJ/macros/StartupMacros.txt to have it
>> automatically installed when ImageJ starts.
>>
>> -wayne
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html