Login  Register

question - analyze line graph macro

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

question - analyze line graph macro

David Judd-2
1 post
Hi,

I'm trying to create a macro that will call Analyze Line Graph.  This works
fine up to a point, but I can't figure out how to save the results.
Specifically, run("Analyze Line Graph"); works fine, bringing up a window
with three buttons - List, Save, and Copy.  However, there doesn't seem to
be a macro command that will allow me to press any of those buttons, or by
any other method access the text data I've just taken from the image.

Anybody have a fix?

Thanks!

-David
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: question - analyze line graph macro

Wayne Rasband
1011 posts
Here is a macro that runs Analyze>Tools>Analyze Line Graph and saves  
the results in the users home directory. The trick that makes it work  
is enabling the "Auto-close" and "List Values" options in the  
Edit>Options>Profile Plot Options.

   run("Profile Plot Options...",
     "width=450 height=200 auto-close list interpolate draw");
   run("Analyze Line Graph");
   selectWindow("Plot Values");
   values = getInfo();
   run("Close");
   f = File.open(getDirectory("home")+"results.txt");
   print(f, values);

-wayne


On May 25, 2007, at 3:07 PM, David Judd wrote:

> Hi,
>
> I'm trying to create a macro that will call Analyze Line Graph.  
> This works
> fine up to a point, but I can't figure out how to save the results.
> Specifically, run("Analyze Line Graph"); works fine, bringing up a  
> window
> with three buttons - List, Save, and Copy.  However, there doesn't  
> seem to
> be a macro command that will allow me to press any of those  
> buttons, or by
> any other method access the text data I've just taken from the image.
>
> Anybody have a fix?
>
> Thanks!
>
> -David
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

Re: question - analyze line graph macro

NabbleRay
1 post
Wayne Rasband wrote
On May 25, 2007, at 3:07 PM, David Judd wrote:

> Hi,
>
> I'm trying to create a macro that will call Analyze Line Graph.  
> This works
> fine up to a point, but I can't figure out how to save the results.
> Specifically, run("Analyze Line Graph"); works fine, bringing up a  
> window
> with three buttons - List, Save, and Copy.  However, there doesn't  
> seem to
> be a macro command that will allow me to press any of those  
> buttons, or by
> any other method access the text data I've just taken from the image.
>
> Anybody have a fix?
>
> Thanks!
>
> -David

Here is a macro that runs Analyze>Tools>Analyze Line Graph and saves  
the results in the users home directory. The trick that makes it work  
is enabling the "Auto-close" and "List Values" options in the  
Edit>Options>Profile Plot Options.

   run("Profile Plot Options...",
     "width=450 height=200 auto-close list interpolate draw");
   run("Analyze Line Graph");
   selectWindow("Plot Values");
   values = getInfo();
   run("Close");
   f = File.open(getDirectory("home")+"results.txt");
   print(f, values);

-wayne
Sorry to dredge up such an old post, but I just had to deal with this problem myself and this solution came up on a Google search. I think there is a more direct solution, and I feel like it might benefit future Googlers:

run("Analyze Line Graph");
Plot.getValues(x,y);

This sticks the x and y values into the variables x and y... you can then do with them what you will.