Posted by
Andy Puckett on
Jan 24, 2009; 12:36am
URL: http://imagej.273.s1.nabble.com/Change-in-B-C-min-max-tp3693958p3693960.html
I don't know what caused the problem, but I found a solution. I
replaced
IJ.setMinAndMax((int)Math.round(setMin), (int)Math.round(setMax));
with
imgPlus.setDisplayRange((int)Math.round(setMin),
(int)Math.round(setMax));
where imgPlus was an instance of ImagePlus.
Thanks anyway,
Andy
-------------------------------------------------------------
Dr. Andy Puckett
[hidden email]
Postdoctoral Fellow 907-786-1838
University of Alaska Anchorage SCI 221
-------------------------------------------------------------
On Jan 23, 2009, at 3:08 PM, Andy Puckett wrote:
> Hi all,
>
> Until recently, my plugin was able to change the contrast of an
> image by doing
> IJ.setMinAndMax((int)Math.round(setMin), (int)Math.round(setMax));
> where setMin and setMax were variables defined by looking at the
> histogram of each slice. It stepped through the slices of my
> hyperstack and set the contrast individually.
>
> This no longer works. I recently upgraded to 1.42g, and now it
> manages to change the B&C temporarily for each slice, but then
> reverts to the pixel min/max values. I don't know exactly what
> version I was running before, but I know that my code works for
> 1.41o. (I can't figure out how to download the earlier builds of
> 1.42a-f, either.)
>
> Does anyone know what might have happened to break my code? (It's a
> mess of code... too much to post here.)
>
> Thanks,
> Andy
>
> -------------------------------------------------------------
> Dr. Andy Puckett
[hidden email]
> Postdoctoral Fellow 907-786-1838
> University of Alaska Anchorage SCI 221
> -------------------------------------------------------------
>
>