Re: Batch processing images with custom threshold values

Posted by ademcan on
URL: http://imagej.273.s1.nabble.com/Batch-processing-images-with-custom-threshold-values-tp3698896p3698905.html

Wayne,

Thanks a lot for your prompt response and the excellent macro. It
works perfect. I appreciate your help.

Adem

On 7/4/07, Rasband Wayne <[hidden email]> wrote:

> Here is a macro that runs the particle analyzer on all the images in
> a folder using custom threshold values and saves the results as a
> text file. It requires ImageJ 1.38o or later. The particle analyzer
> in earlier versions created a "Summary" window for each image.
>
>      requires("1.38o");
>      dir = getDirectory("Choose a Directory ");
>      list = getFileList(dir);
>      setBatchMode(true);
>      for (i=0; i<list.length; i++) {
>          showProgress(i, list.length);
>          open(dir+list[i]);
>          getStatistics(area, mean, min, max, std);
>          threshold = mean + 2.5*std;
>          setThreshold(threshold, 255);
>          run("Analyze Particles...", "size=10-1000 summarize");
>          close;
>      }
>      selectWindow("Summary");
>      saveAs("Text", getDirectory("home")+"Summary.txt");
>
> -wayne
>