Change in B&C min/max?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Change in B&C min/max?

Andy Puckett
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
-------------------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: Change in B&C min/max?

Andy Puckett
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
> -------------------------------------------------------------
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Change in B&C min/max?

Wayne Rasband
In reply to this post by Andy Puckett
> 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.

This bug is fixed in the v1.42h daily build.

-wayne