Commands to execute when image loaded

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

Commands to execute when image loaded

Steve Kinder
I am using a plugin that loads images on a regular basis. I would like to apply standard ImageJ commands to those images as they are loaded e.g. a vertical flip and change the lookup table being used. Is this possible by a macro txt file or some other mechanism?

Thanks

Steve

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Commands to execute when image loaded

dscho
Hi Steve,

On Thu, 27 Sep 2012, Steve Kinder wrote:

> I am using a plugin that loads images on a regular basis. I would like
> to apply standard ImageJ commands to those images as they are loaded
> e.g. a vertical flip and change the lookup table being used. Is this
> possible by a macro txt file or some other mechanism?

The easiest way would be to record a macro including opening the image.
Then prefix that macro by something like:

        path = File.openDialog("The image");

and use that variable instead of the file path of the particular image you
opened when you recorded the macro, like so:

        open(path);

Now save that macro and use it to open files instead of File>Open. You
could even assign a shortcut, and do so in StartupMacros.ijm (see the
respective sections of the ImageJ User Manual for details).

Ciao,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html