Macro for subtracting values

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

Macro for subtracting values

Yasushi Sato
Dear ImageJ experts,

I would like to use a macro for subtracting background of light microscope
color image for measuring the gray value of interested area.

run("8-bit");
run("Invert");
run("Histogram");

Then I hope to subtract "mode" of histogram from the image.
Alternatively, I hope to subtract the minimum gray value in the peaks in
histogram from the image.

However I am a beginner of ImageJ macro.

Could anyone show me the example of the two macros?

Sincerely yours,

Yasushi Sato
Reply | Threaded
Open this post in threaded view
|

Re: Macro for subtracting values

Gabriel Landini
On Wednesday 29 October 2008 12:55:13 Yasushi Sato wrote:

> Dear ImageJ experts,
>
> I would like to use a macro for subtracting background of light microscope
> color image for measuring the gray value of interested area.
>
> run("8-bit");
> run("Invert");
> run("Histogram");
>
> Then I hope to subtract "mode" of histogram from the image.
> Alternatively, I hope to subtract the minimum gray value in the peaks in
> histogram from the image.
>
> However I am a beginner of ImageJ macro.
>
> Could anyone show me the example of the two macros?

There are several ways of subtracting background:
Have a look here:

http://imagejdocu.tudor.lu/doku.php?id=howto:working:how_to_correct_background_illumination_in_brightfield_microscopy

G.
Reply | Threaded
Open this post in threaded view
|

Re: Macro for subtracting values

Yasushi Sato
Hello, Gabriel
Thank you very much for introducing the methods for subtracting the  
background of light microscope. I will study the methods.

Still, I would like to know the macro how to subtract "mode" of  
histogram from the image.
Could you show me the example of the macro?

Sincerely

Yasushi Sato

On 2008.10.29, at 10:26  PM, Gabriel Landini wrote:

> On Wednesday 29 October 2008 12:55:13 Yasushi Sato wrote:
>> Dear ImageJ experts,
>>
>> I would like to use a macro for subtracting background of light  
>> microscope
>> color image for measuring the gray value of interested area.
>>
>> run("8-bit");
>> run("Invert");
>> run("Histogram");
>>
>> Then I hope to subtract "mode" of histogram from the image.
>> Alternatively, I hope to subtract the minimum gray value in the peaks  
>> in
>> histogram from the image.
>>
>> However I am a beginner of ImageJ macro.
>>
>> Could anyone show me the example of the two macros?
>
> There are several ways of subtracting background:
> Have a look here:
>
> http://imagejdocu.tudor.lu/ 
> doku.php?id=howto:working:how_to_correct_background_illumination_in_bri
> ghtfield_microscopy
>
> G.
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro for subtracting values

Gabriel Landini
On Thursday 30 October 2008 03:00:02 Yasushi Sato wrote:
> Hello, Gabriel
> Thank you very much for introducing the methods for subtracting the
> background of light microscope. I will study the methods.
>
> Still, I would like to know the macro how to subtract "mode" of
> histogram from the image.
> Could you show me the example of the macro?

Find the mode via the histogram :
getHistogram(values, counts, nBins[, histMin, histMax])

and use the Math Subtract function to subtract that value.

But I doubt that it will do what you want, no microscope I know of produces
flat bright fields, so you just get an offset greyscale image.
And what do you do when you have multimodal histograms?
Regards

G.