batch mode error

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

batch mode error

Oliver Bannach-2
Hi folks,

for intensity quantification from multiple images I wrote a macro that
worked fine so far. To prevent images popping up, I recently tried the
setBatchMode(true); command. However this seems to interfere with the
getHistogram call. This is the error message:

"16 or 32-bit image required to set histMin and histMax in line XXXX
getHistogram(values, counts, nBins, hMin, hMax <)>;"

And these are the relevant lines from the macro:

....

setBatchMode(true);

....

// Bild/Kanal oeffnen
open("bild.tif");

....

// Histogram erstellen
setKeyDown("alt+shift");
run("Histogram", "x_min="+hMin+" x_max="+hMax+" y_max=Auto");
run("Close");

// Histogram auswerten
getHistogram(values, counts, nBins, hMin, hMax);
this_histo = 0;
for (k=0; k<nBins; k++) {
        this_histo += values[k]*counts[k];
}

....

Any help is appreciated. Many thanks.

Cheers
Oliver