Scripting ImageJ

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Scripting ImageJ

asfarley
Hi everybody; I'm scripting some tasks which require VirtualDub and ImageJ (this is why my first choice is not to use the built-in ImageJ macro language). The problem I have been encountering is: when I open/process/save files in ImageJ, I have no way of telling when the operation is complete. What I've been doing is checking if windows are open (indicating that the "file open" operation is complete) or reading the size of a file (to check if it's finished saving), etc. However, these aren't very "robust" methods. Does ImageJ provide any way of checking if a process has completed? For example, is there a way to read the status of the progress bar? Thanks,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: Scripting ImageJ

ctrueden
Hi Alex,

If you have your own macro or plugin, can't you just invoke your own status
update method in between processing steps?

-Curtis

On Wed, Oct 29, 2008 at 3:29 PM, asfarley <[hidden email]> wrote:

> Hi everybody; I'm scripting some tasks which require VirtualDub and ImageJ
> (this is why my first choice is not to use the built-in ImageJ macro
> language). The problem I have been encountering is: when I
> open/process/save
> files in ImageJ, I have no way of telling when the operation is complete.
> What I've been doing is checking if windows are open (indicating that the
> "file open" operation is complete) or reading the size of a file (to check
> if it's finished saving), etc. However, these aren't very "robust" methods.
> Does ImageJ provide any way of checking if a process has completed? For
> example, is there a way to read the status of the progress bar? Thanks,
> Alex
> --
> View this message in context:
> http://n2.nabble.com/Scripting-ImageJ-tp1395229p1395229.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Scripting ImageJ

asfarley
I guess I'm saying I need some hints on how to write a status update method. I'm using AutoIT to script the process. Do you know of any simple variables/values that indicate when processing is completed?

Right now my code reads visible text, looking for "seconds" which is displayed in this context once processing is completed:

AVI... 5000 frames, 12 seconds. 417 frames/second.

However, this doesn't seem reliable; the script still hangs occasionally.
Reply | Threaded
Open this post in threaded view
|

Re: Scripting ImageJ

ctrueden
Hi Alex,

Well, I suppose AutoIT is one way to do it. You could write an ImageJ macro
or plugin that performs the operations you want, and does something obvious
that AutoIT can see in between steps. For example, you could set the ImageJ
status message with IJ.setStatus(), or even pop up a window with a
particular title. I'm not sure what sort of state you can poll with AutoIT,
so I'm not sure what else to suggest, really. Since you can write your own
plugin, you can have it do anything that Java is capable of, really --
writing to a file, sending network messages over a socket... whatever works
for your use case. Your problem isn't really ImageJ specific at that point.

-Curtis

On Wed, Oct 29, 2008 at 4:24 PM, asfarley <[hidden email]> wrote:

> I guess I'm saying I need some hints on how to write a status update
> method.
> I'm using AutoIT to script the process. Do you know of any simple
> variables/values that indicate when processing is completed?
>
> Right now my code reads visible text, looking for "seconds" which is
> displayed in this context once processing is completed:
>
> AVI... 5000 frames, 12 seconds. 417 frames/second.
>
> However, this doesn't seem reliable; the script still hangs occasionally.
> --
> View this message in context:
> http://n2.nabble.com/Scripting-ImageJ-tp1395229p1395448.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>