setThreshold Macro command for fluorescent microscopy

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

setThreshold Macro command for fluorescent microscopy

Morange
This post was updated on .
Hello,

I am trying to reduce the threshold of multiple microscope images by using the following script:

run("Invert");
run("8-bit");
setThreshold(0, 162, "black & white");
run("Measure");

however, the function only converts the images to black and white and have not adjusted the threshold. How can I change the code to set my desired threshold?

Edit: another problem that I had was some of the images were inverted again additional to the first "Invert" after the setThreshold has been called.
Reply | Threaded
Open this post in threaded view
|

Re: setThreshold Macro command for fluorescent microscopy

Gabriel Landini
On Friday 06 May 2016 11:10:16 you wrote:

> Hello,
>
> I am trying to reduce the threshold of multiple microscope images by using
> the following script:
>
> run("Invert");
> run("8-bit");
> setThreshold(0, 162, "black & white");
> run("Measure");
>
> however, the function only converts the images to black and white and have
> not adjusted the threshold. How can I change the code to set my desired
> threshold?


You are specifying to show as B&W (the image is not converted to B&W, only
shown in that LUT.
Try this instead:
setThreshold(0, 162, "Red");

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: setThreshold Macro command for fluorescent microscopy

Morange
Hello Gabriel,

Thank you for your reply. I tried your suggestion in the macro and this time, the image is only inverted and converted to 8-bit before it was measured, it appears that setThreshold was not called

run("Invert");
run("8-bit");
setThreshold(0, 162, "Red")
run("Measure");