How to automate image particle analysis by creating a macro in ImageJ

UPDATE: This blog post was updated on the 29th June 2019 to fix syntax errors in the code that would prevent batch mode operating and cause the for loop to fail to execute. It also fixes a logic error that would save the results in a different location and prevent …