Need help with batch calculate

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

Need help with batch calculate

John Kim-2
Hi everyone,

I'm converting the now famous Batch_Converter.java into my own specialized
batch particle counter, and am having trouble with subtracting one image
from another. I have:

// This will be subtracted from each image.
ImagePlus baseImage = new Opener().openImage(dir1, baseFileName);

// Iterate through thousands of files
for (int i=0; i<fileList.length; i++) {
    ImagePlus targetImage = new Opener().openImage(dir1, fileList[i]);
    imageCalculator.calculate("Subtract create", targetImage, baseImage);
}

Two questions:
1) How do I obtain an instance of the ImageCalculator?
2) How do I obtain the difference image? Method calculate() returns null. I
need a reference to the difference image to do further processing on it.

I saw in the list archives that there's a way to invoke the ImageCalculator
plugin through IJ.run() but I'm not sure how to make it work in batch mode.

Thanks....

John Kim
Field Station Programs, San Diego State University