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-tp3698896.html

Dear List members,

I am working on a project which requires cell counts from thousands of
images. Obviously, batch processing is the right way to work on these
images. I am not a programmer but still managed to reverse engineer some
batch processing macros originally written for other functions for myself.
But still there are problems that I need your expertise to solve.

These are 8-bit images of immunoreactive neurons to be counted. I can't use
the built-in autothresholding or entropy methods. Instead for each image a
different threshold value is calculated according to the following formula:
mean gray values+(2.5xSTD). I can calculate these values en masse with batch
statistics macro. But after that, I have to do actual cell counting one by
one, entering the appropriate threshold value for each image, a process
which is, needlessly to say, unproductive.

The ideal macro will batch process the following steps:

-Open each image from a folder
-Calculate the threshold value for that image, according to a user defined
algorithm (e.g. mean gray values+(2.5xSTD))
-Calculate number and total area of cells according to user defined
parameters (e.g. min-max pixel size) using the threshold value from the
previous step
-Export these cell number and area values with the file name of the image
into an Excel sheet (or a text file)

So far I could not write such a macro. Thank you in advance for your help.


Adem Can
The University of Texas at Austin, Department of Psychology