Hi, I’m pretty new to ImageJ and I’m having some trouble with batch processing using the image calculator. I have a set of images that I want to subtract the background from. Both the original images and the binary versions of those images have the same name and are .tif files, but they are saved in separate folders. I’ve used the recorder to try to piece together a macro, but I haven’t been able to make them work. I have found a few different threads that discuss a similar topic, but since I’m very unfamiliar with creating macros, I’m having trouble tweaking them based on what my files are named, etc.
This is what I have so far (adapted from something I saw on Reddit), but I’m fairly certain there are a number of errors because of the changes that I made:
dir1 = “C:\/Users/kate/Desktop/ImageJTest/\”;
dir2 = “C:\/Users/kate/Desktop/ImageJTestBinary/\”;
dir3 = “C:\OutputFiles\”;
list = getFileList(dir1);
file1name = “x.tif”;
file2name = “x.tif”;
open(dir1 + file1name);
open(dir2 + file2name);
imageCalculator(“Subtract create”, file1name, file2name);
Thank you in advance for any help!