slice-wise contrast setting

Posted by Tony Shepherd on
URL: http://imagej.273.s1.nabble.com/slice-wise-contrast-setting-tp3682765.html

Dear all,

I create an ImageStack in a plugin, fill it with pixel values, give it to an ImagePlus and display.
By looping through the stack slices I can 'get', 'find' and 'set' the minimum and maximum pixel value associated with that slice and there is also a method to 'resetMinAndMax()' that I believe is used when transforming pixel values to display values.

Is it possible to set a different display contrast for each slice in a stack separately? This information should be retained when scrolling through the slices. For example,

* slice 1 has values in the range 0.0 to 100.0, so the look-up table should make 0 display as 'blackest' and 100.0 display as 'whitest'.

* slice 2 has values in the range -25.0 to 10.5, so the look-up table should make -25.0 display as 'blackest' and 10.5 display as 'whitest'.

* After using 'display()' to put this ImagePlus on screen, I don't want to keep going to 'image --> adjust --> brightness/contrast --> auto' every time I change the slice being displayed.

Thanks

Tony