The batch mode

One common operation you will probably need to do at some point is to apply a macro to a large number of images. You have an option of using the setBatchMode(arg) function and code the logic for opening and closing each file. However, there is a simpler way of accomplishing this, which is just navigating to the Process | Batch | Macro... menu option. When you run it you will get a dialog similar to the following one:

The batch mode

This dialog will allow you to apply a macro to all the images contained inside a given folder (Input...) and will store the result into another one (Output...) with the image format selected in the Output Format option. If you leave the output folder field empty, nothing will be saved (you may want to do this if your macro consists of a list of measurements and does not involve any image modification). You can write your macro code in the textbox or in an open (Open...) one that you have coded previously. The Test button runs the macro on the first image of the input directory and shows the result on the screen.

Imagine a possible application: we want to measure the number of tuberculosis bacilli in a folder containing 300 images. Now we have a very fast way of doing that precisely.

Tip

You don't need to do any opening or closing of an image within your macro code while using this batch mode. Just consider that the image has been opened and selected for you when the macro starts. You only need to implement the necessary image processing tasks.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset