Radial profile through marco

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

Radial profile through marco

Gregory Book
Hi All,
I'm trying to automate analysis of images using the radial profile plugin. I'm able to create a macro which opens a file, creates the radial profile plot, and saves the plot as an image. However, I can't seem to find a way to save the plot values as a text file. There are the "List" "Save..." and "Copy..." buttons on the plot window, but I can't seem to get those to work through a macro.
 
Any ideas how to automate this?
 
Thanks,
Greg
Reply | Threaded
Open this post in threaded view
|

Re: Radial profile through marco

Michael Schmid
Hi Greg,

you can use the Plot.getValues(x, y) macro command with the Radial  
Profile plugin.

Michael
________________________________________________________________

On 29 Jul 2011, at 16:38, Gregory Book wrote:

> Hi All,
> I'm trying to automate analysis of images using the radial profile  
> plugin. I'm able to create a macro which opens a file, creates the  
> radial profile plot, and saves the plot as an image. However, I  
> can't seem to find a way to save the plot values as a text file.  
> There are the "List" "Save..." and "Copy..." buttons on the plot  
> window, but I can't seem to get those to work through a macro.
>
> Any ideas how to automate this?
>
> Thanks,
> Greg
Reply | Threaded
Open this post in threaded view
|

Re: Radial profile through marco

Gregory Book
Thanks. What would the syntax look like for that macro?
 
Currently I have this:
 
open("file.png");
run("Select All");
run("Radial Profile", "x=128 y=128 radius=128");
selectWindow("Radial Profile Plot");
saveAs("PNG", "profileplot.png");
run("Quit");
 
How would I use the Plot.getValues?
-Greg
 


>>> Michael Schmid <[hidden email]> 7/29/2011 11:11 AM >>>
Hi Greg,

you can use the Plot.getValues(x, y) macro command with the Radial  
Profile plugin.

Michael
________________________________________________________________

On 29 Jul 2011, at 16:38, Gregory Book wrote:

> Hi All,
> I'm trying to automate analysis of images using the radial profile  
> plugin. I'm able to create a macro which opens a file, creates the  
> radial profile plot, and saves the plot as an image. However, I  
> can't seem to find a way to save the plot values as a text file.  
> There are the "List" "Save..." and "Copy..." buttons on the plot  
> window, but I can't seem to get those to work through a macro.
>
> Any ideas how to automate this?
>
> Thanks,
> Greg
Reply | Threaded
Open this post in threaded view
|

Re: Radial profile through marco

Gregory Book
That got the values out, thanks! I'm running this through the -batch mode through cron (the DISPLAY is set to a vnc window), and it prints the values to the command line output. How would I save the values to a file?
 
I now have this for a macro:
 
open("file.png");
run("Select All");
run("Radial Profile", "x=128 y=128 radius=128");
selectWindow("Radial Profile Plot");
saveAs("PNG", "profileplot.png");
Plot.getValues(x,y);
for (i=0;i<x.length;i++)
  print(x[i],y[i]);
saveAs("Text","plot.txt");
run("Text...", "save=plot.txt");
run("Quit");
But, it gives an error:
This command requires a TextWindow, such as the "Log" window, or an Editor window. Use File>Save>Text Image to save an image as text.
 
 
 
 

>>> "Rasband, Wayne (NIH/NIMH) [E]" <[hidden email]> 7/29/2011 5:47 PM >>>

On Jul 29, 2011, at 11:44 AM, Gregory Book wrote:

> Thanks. What would the syntax look like for that macro?
>
> Currently I have this:
>
> open("file.png");
> run("Select All");
> run("Radial Profile", "x=128 y=128 radius=128");
> selectWindow("Radial Profile Plot");
> saveAs("PNG", "profileplot.png");
> run("Quit");
>
> How would I use the Plot.getValues?

Greg,

There is an example macro at

   http://imagej.nih.gov/ij/macros/examples/PlotGetValuesDemo.txt

-wayne



>>>> Michael Schmid <[hidden email]> 7/29/2011 11:11 AM >>>
> Hi Greg,
>
> you can use the Plot.getValues(x, y) macro command with the Radial  
> Profile plugin.
>
> Michael
> ________________________________________________________________
>
> On 29 Jul 2011, at 16:38, Gregory Book wrote:
>
>> Hi All,
>> I'm trying to automate analysis of images using the radial profile  
>> plugin. I'm able to create a macro which opens a file, creates the  
>> radial profile plot, and saves the plot as an image. However, I  
>> can't seem to find a way to save the plot values as a text file.  
>> There are the "List" "Save..." and "Copy..." buttons on the plot  
>> window, but I can't seem to get those to work through a macro.
>>
>> Any ideas how to automate this?
>>
>> Thanks,
>> Greg