Automatic launch of ImageJ when image is copied to the working library


I was wondering if it is possible to launch the ImageJ automatically when some images copied to the working library of the ImageJ. Lets be more specific. I would like to pre-process the images with my own software and use the analysis of a ImageJ plugin and get the results. It is clear the any macro can be run automatically, but I also would like to start the ImageJ when my software finished to work and saved the preprocessed images in a given directory.


Do pre-process (own app)
Launch ImageJ
Do analysis

Thank you in advance for your help!

Welcome to the forum, @Krbandee!

This is certainly possible, but you’ll need a tool from your operating system to watch your target folder, as ImageJ cannot do this before it was started, i.e. when it’s not running.

Depending on your OS, you might find this question on (for Windows), or the Automator or Applescript (on Mac OSX) helpful.

On the other hand you can keep ImageJ running and write a little script (in any of the supported languages) to watch the folder and react on file changes.

Thank you a lot! Appriciate your answer! Best regards

If you go this route, you might find Java’s Watch Service API useful for this purpose.

1 Like