Login  Register

Macro to save plot profile data as text

Posted by arobisson on May 07, 2017; 2:30am
URL: http://imagej.273.s1.nabble.com/Macro-to-save-plot-profile-data-as-text-tp5018665.html

Hello,

 

I am new to macro.. and cannot get this to work. I am trying to save my plot profile automatically in a txt or csv file. The macro below gives me a log window but not a txt file. Ultimately, I will need to plot and save this on each image from an image sequence…

 

Your input is welcome, Agathe

 

xcenter=1658;

ycenter=306;

makeLine(xcenter,ycenter+1100, xcenter, ycenter+1900);

run("Plot Profile");

Plot.getValues(x, y);

  for (i=0; i<x.length; i++)

     print(x[i], y[i]);

path = getDirectory("home")+"profile.csv";

saveAs("Results", path);