Hello.
I'm new to ImageJ and am trying to write a macro that will count particles in a ROI. The specific problem I can't figure out is how to extract information from a results table and record to a separate table, so that as the macro runs on multiple files in a directory, the desired output is recorded in a table against the name of the file. What I need for each file is for the count column of the summary table to be written into a a table against the file name, and for this result for all files to be written to the same table. I'm not familiar with the syntax for getting data from a table, so i'd be grateful if someone could point me on the right track. Thanks Alex |
Dear Alex,
If I understand you well you want a results table for each image containing also the summary Probably the easiest solution is to use run("Summarize"); after you have created the results table. Best wishes Kees Dr Ir K.R. Straatman Senior Experimental Officer Advanced Imaging Facility Centre for Core Biotechnology Services University of Leicester http://www2.le.ac.uk/colleges/medbiopsych/facilities-and-services/cbs/lite/aif -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of atjlee Sent: 18 April 2016 14:34 To: [hidden email] Subject: Recording results parameters from looped macros Hello. I'm new to ImageJ and am trying to write a macro that will count particles in a ROI. The specific problem I can't figure out is how to extract information from a results table and record to a separate table, so that as the macro runs on multiple files in a directory, the desired output is recorded in a table against the name of the file. What I need for each file is for the count column of the summary table to be written into a a table against the file name, and for this result for all files to be written to the same table. I'm not familiar with the syntax for getting data from a table, so i'd be grateful if someone could point me on the right track. Thanks Alex -- View this message in context: http://imagej.1557.x6.nabble.com/Recording-results-parameters-from-looped-macros-tp5016163.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
In reply to this post by atjlee
Hi Alex,
Have a look at the getResult("Column", row) macro command (http://rsb.info.nih.gov/ij/developer/macro/functions.html#G), which enables you to extract values from the results table. You can then create a new table/text window and write the information that you extracted from the results table to that new table using the two argument version of the print command (print(arg1, arg2) where arg1 is the name of the table and arg2 contains the information that you want to add to that table). There is a nice demo macro on the ImageJ website that illustrates how to use this: http://rsb.info.nih.gov/ij/macros/TableTricks.txt Hope this helps, Volko -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of atjlee Sent: 18 April 2016 14:34 To: [hidden email] Subject: Recording results parameters from looped macros Hello. I'm new to ImageJ and am trying to write a macro that will count particles in a ROI. The specific problem I can't figure out is how to extract information from a results table and record to a separate table, so that as the macro runs on multiple files in a directory, the desired output is recorded in a table against the name of the file. What I need for each file is for the count column of the summary table to be written into a a table against the file name, and for this result for all files to be written to the same table. I'm not familiar with the syntax for getting data from a table, so i'd be grateful if someone could point me on the right track. Thanks Alex -- View this message in context: http://imagej.1557.x6.nabble.com/Recording-results-parameters-from-looped-macros-tp5016163.html Sent from the ImageJ mailing list archive at Nabble.com. -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |