I have the following code, where I read images from directory and use ImageJ Auto Threshold plugin to segment my images.
dir = getDirectory("path");
list = getFileList(dir);
for (i=0; i<list.length; i++)
{
if (endsWith(list[i], ".tif"))
{
open(dir + list[i]);
run("8-bit");
run("Gaussian Blur...", "sigma=2");
setAutoThreshold("Otsu dark");
run("Convert to Mask");
saveAs("TIFF", dir+list[i]);
close();
}
}
I would like to get the threshold value using "Otsu dark" method, and modify that value (e.g. scale it by a factor) and apply it to my images for segmentation.