Running macros
So, now we have recorded every step needed for the analysis and stored in it a text file. What if we want to run it again? This is done by navigating to the Plugins | Macros | Run... menu option. A file chooser dialog will pop up and we will have to select the file that contains the commands we want to execute. With the tuberculosis image open, choose that menu option, and then the text file we just saved. All the commands will be run one by one and we will end up with exactly the same result as before. Try running the macro for the tuberculosis_full.tif
measurements and see if you get the same result we got at the end of the previous chapter. In our tests, it takes about two seconds to compute all the calculations! Now you can compare that to the manual way and grasp the power of ImageJ for image processing.
It is also possible to run a macro while we are writing it. This is normally done during the coding process, so we can be sure that it does what it is supposed to do before...