I was trying to program a macro for some simple image arithmetics, but unfortunately I have no clue, how to extend it for application on several images.
The case is the following:
I have all images in one folder somewhere on my computer. I want the macro to open the first one (image) and to apply the minimum filter with a radius of 1 (image_1). Afterwards, the minimum image should be multiplied with the original image (image_2). The resulting image should be substracted from the original image (image_3). This image should then be saved into a new folder.
After this, the second image should be opend and the procedure starts again.
I tried using the macro recorder, which gave me the following text:
open("C:\\2_000.jpg"); run("Minimum...", "radius=1"); open("C:\\2_000.jpg"); imageCalculator("Multiply create", "2_000-1.jpg","2_000.jpg"); selectWindow("Result of 2_000-1.jpg"); imageCalculator("Subtract create", "2_000-1.jpg","Result of 2_000-1.jpg"); selectWindow("Result of 2_000-1.jpg");
This can be applied for the stated image “2_000.jpg”. How can I automate the macro in a way stated above?
I tried to build this routine in KNIME, but somehow the results for “image_3” (as named above) differ significantly, which is why KNIME won’t work (at least so far) not for this case…
It would be great, if someone could help