Posted by
Straub, Volko A. (Dr.) on
URL: http://imagej.273.s1.nabble.com/Macro-to-save-plot-profile-data-as-text-tp5018666p5018667.html
Dear Agathe,
The problem is that your focus is not on the log window when you try to
save its content. Also, I don't think the 'Results' option will work
with the log window. Change
saveAs("Results", path);
to
selectWindow("Log");
saveAs("Text", path);
A quick websearch shows some similar questions (e.g.
http://stackoverflow.com/questions/29879988/solvedimagej-macro-how-to-save-plot-profile-data-in-a-text-file)
that use a results window rather than the log window to list the plot
values. Hope this helps, Volko
On 07/05/2017 03:36, arobisson wrote:
> 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);
>
>
>
>
> --
> View this message in context:
http://imagej.1557.x6.nabble.com/Macro-to-save-plot-profile-data-as-text-tp5018666.html> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html>
> ---
> This email has been checked for viruses by AVG.
>
http://www.avg.com>
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html