I’m trying a macro to do batch process for particles analysis in Fiji, but got stuck at the redirect step. I got an error saying that the redirect image is not the same size as the current image. I’m quite new to ImageJ macro, so I hope someone can help me out. Thanks a lot. Code is below:

this part of Analyze Particles seems to come up every now and so often when using it in macros…
You need to have a dynamic redirect and string interpolation (like in bash, python etc.) does not really work in ImageJ macro language, so you need to concatenate it instead:

@Tran_Minh_Tuan: Is your input image by chance a stack? If so, run("Duplicate...", "title=&duplicated_file_name"); will only duplicate the currently active slice and not the complete stack. That would somehow explain that their dimensions differ.