How to select background color in subtractBackround() ??

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

How to select background color in subtractBackround() ??

Julin Maloof
Hello,

I would like to call subtractBackround in a plug-in that I am writing.  However, when I do so, subtractBackround() has the background color set to dark.  How can I change this from within my plugin?  I have tried Prefs.set("bs.background",true); with no success.

Thanks,

Julin

--
Julin Maloof
Assistant Professor
Section of Plant Biology
University of California, Davis
1 Shields Ave
Davis, CA, 95616
Reply | Threaded
Open this post in threaded view
|

Re: How to select background color in subtractBackround() ??

Michael Schmid
Hi Julin,

what about calling it this way:
   IJ.run("Subtract Background...", "rolling="+radius+" light");

It requires that you have not only an ImageProcessor but also
an ImagePlus and that it is the current foreground image.
Otherwise, you would have to invert the image before subtracting
the background.

BTW, subtractBackround() does not care about whether the
background is dark or bright, it assumes that the background is
low (in numbers; uncalibrated), irespective of whether the
image has an inverting LUT or not.

Michael
________________________________________________________________

On 21 Aug 2007, at 01:43, Julin Maloof wrote:

> Hello,
>
> I would like to call subtractBackround in a plug-in that I am  
> writing.  However, when I do so, subtractBackround() has the  
> background color set to dark.  How can I change this from within my  
> plugin?  I have tried Prefs.set("bs.background",true); with no  
> success.
>
> Thanks,
>
> Julin