Hi John,
I have been trying
> to think of a way to create a macro or a plug-in that would run in a
> loop until stopped and that the loop would poll a specified directory
> for the presence of an image and if found execute a macro and then
> delete the image and wait for the next one.
>
If you are using Java7, you can use the WatchService to be notified of
changes on the file system, such as a particular directory. For an example,
see:
http://thecodersbreakfast.net/index.php?post/2011/05/18/Filesystem-notifications-with-Java-7If you are using Java6 or earlier you can write a polling loop that does a
File.listFiles() or File.exists() or some such, to check repeatedly every
few seconds.
As for doing this in ImageJ, I do not know of any such existing plugins,
but you should be able to write a plugin that uses the above technique.
You'll have to decide whether to spawn a background thread, or loop in the
foreground (i.e., have the plugin keep running for some specified amount of
time, or until it detects that your external process is complete).
HTH,
Curtis
On Tue, Apr 3, 2012 at 3:30 PM, John Minter <
[hidden email]> wrote:
> I am trying to follow and characterize a process which can output
> image files at selected stages during the process. I have been trying
> to think of a way to create a macro or a plug-in that would run in a
> loop until stopped and that the loop would poll a specified directory
> for the presence of an image and if found execute a macro and then
> delete the image and wait for the next one. My independent process
> control software (Python) would be able to react to these results,
> make changes and send new images to be analyzed. I have been able to
> find some nice examples to detect user events in ImageJ, but nothing
> quite like this. I would appreciate pointers to a "how to." My Google
> search hasn't panned out thus far and I am stumped.... I'm sure
> someone must have done this before... I must be missing something...
>
> Best regards,
> John
>