Copy log content to clipboard



Hi there,

I would like to copy the contents of the log window to the clipboard so then I can paste them somewhere else.

Before Herbie kills me, I have been looking at the ImageJ-macro functions and the only one doing something like I want was
but I have no idea how to put the contents of the log window into a string.

Those contents are several rows from the results taking into the log window through:

for (i=0;i<nResults();i++){
d2s(getResult(“Area” ,i),0);

Thanks a lot for your help



Good day,

actually I’ve never killed somebody yet …

Here is a demo macro that does what you’ve described:

print("Here is just some text \non two lines for demonstration.")
theText = getInfo("log");

I simply did a search on
for “log”.




I am afraid that “yet” is close to be invalid if I keep asking fool questions like that…

Thanks indeed again and sorry very much (again!!!). I did try but, thick as I might be, couldn´t find what you just found in two sec… I will try harder next time before asking.



Hi i am hoping to copy the summary value of 3 from this table and put it into the log table, would know how to do this. I have previously tried this but it does not seem to work.

print("Unoccupied AChR Area: " + getResult("Area"));
unoccupiedAchrArea = getResult("Area");



i have been advised this is relevant but i do not understand it


The following ImageJ-macro works for me:

print("Unoccupied AChR Area: " + getResult("Total Area"));

You have to accept that
getResult("Column Name")
only works for tables named “Results”.



Saving Results from "Plot Values" into Arrays in ImageJ Macro

Hello All,

I am trying to develop a code to calculate Mean Linear Intercept of a lung tissue section by just taking into account the alveolar walls (thin black) and NOT the bronchiolar regions (thick black).

l = getWidth();
h = getHeight()/6;
run("Plot Profile");
run("Find Peaks", "min._peak_amplitude=254.99 min._peak_distance=0 min._value=[] max._value=[]");

So I have this square wave plot which I have generated from a binary image (first image). From this I use the BAR toolbar -> Data Analysis -> Find Peaks. That returns me the same square plot with the minimum and maximums labeled along with a table called “Plot Values” (following two images).

The BAR installation instructions can be found at:

My only question right now is How do I save the values in Columns X1 and X2 in arrays called “X1” and “X2” using an ImageJ macro? Because I need this data to perform lots of different data analysis, And I have 100s of lines and images to work with so I want to automate this process so that I do not need to keep manually copying pasting data from the data table into an excel file. If anyone is able to help me how to get these values stored in arrays, I am good from there. Because then I can just directly do all my analysis in ImageJ macro and print only the final results my prof needs to an excel file, making the process efficient and simple and clean.

Dr. Glünder keeps misunderstanding what I am trying to do and misinterprets my posts and then backs out without trying to figure out what the problem I am having is. If anyone else is able to understand what I seek, please do help. Again I am only looking to get two columns of data which have variable row lengths each time.

I have tried printing the “nResults” in hopes I can use that but all it returns for a table having 6 columns, with the first pair of columns having 2080 rows, and the last two pairs of columns having 15 and 16 rows, respectively… nResults just returns 64 . What does this “64” mean?

P.S: I have tried this link already:
It works only for two columns of data, but does not work for anything more than that.
For those of you who see this post, PLEASE run the code on the binary image I have pasted above to understand what I am talking about.


PS PS Why is this post flagged?