Login  Register

Using macro to execute a button within a plugin?

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

Using macro to execute a button within a plugin?

pezferoz
1 post
This post was updated on Feb 28, 2013; 7:46pm.
Hey all, new to ImageJ and was trying to make a macro to run OrientationJ on images and save the distribution of fiber orientation.  I am able to save an image of the distribution but unable to get the macro to "click" a button within a pop up figure and then save that as a txt file.  Could anyone help me with what's missing in my macro?  Thanks so much!

Screenshots to better describe my problem:
Here OrientationJ takes the image (StretchingIntima-25strain...) and makes a nice distribution of the orientations of the fibers which pops up as the window titled "S-distribution-1"
[URL=http://imageshack.us/photo/my-images/812/orientationjproblem.png/][IMG]http://imageshack.us/a/img812/8728/orientationjproblem.png[/IMG][/URL]

From there I'd like the macro to use the "List" button on the bottom left of the S-distribution-1 window to create another pop up labeled "Plot Values"
[URL=http://imageshack.us/photo/my-images/12/orientationjproblem2.png/][IMG]http://imageshack.us/a/img12/8624/orientationjproblem2.png[/IMG][/URL]

From there I think I can get it to save the plot values as a txt file but getting the extra window to pop up has me puzzled...

current section of the macro that I have...
// Blue channel
// Save the blue channel
saveAs("Tif", dir2+"Blue"+list[i]);
//Run OrientationJ with settings
run("OrientationJ Distribution", "log=0.0 tensor=1.0 gradient=0 min-coherency=70.0 min-energy=2.0 harris-index=on s-distribution=on hue=Orientation sat=Coherency bri=Original-Image ");
//choose distribution window and save image
selectWindow("S-Distribution-1");
saveAs("Tif", dir2+"dist"+list[i]);

//something here to use List button and save that as txt

// Close the blue channel
close();
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: Using macro to execute a button within a plugin?

dscho
1631 posts
Hi,

On Thu, 28 Feb 2013, pezferoz wrote:

> Hey all, new to ImageJ and was trying to make a macro to run
> OrientationJ on images and save the distribution of fiber orientation.
> I am able to save an image of the distribution but unable to get the
> macro to "click" a button within a pop up figure and then save that as a
> txt file.  Could anyone help me with what's missing in my macro?  Thanks
> so much!

Unfortunately, OrientationJ does not use the standard ImageJ way to do
things, hence it is not recordable.

Even more unfortunate is the fact that it is closed source, so we cannot
fix it.

However, BIG came up with a partial solution (it is still not the standard
way, so it is still not recordable and reimplements quite a bit of the
macro handling of ImageJ): you can call it from a macro. See "Installation
for macro development" here:

        http://bigwww.epfl.ch/demo/orientation/#soft

Note that in contrast to their instructions, it is enough to install
OrientationJ.jar, no need to have ugly unpacked .class files in your
plugins/ folder.

Ciao,
Johannes

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