Posted by
Aryeh Weiss on
Feb 27, 2015; 11:35am
URL: http://imagej.273.s1.nabble.com/how-to-update-ImagePlus-in-Python-tp5011768p5011807.html
On 2/27/15 5:20 AM, Rasband, Wayne (NIH/NIMH) [E] wrote:
> On Feb 26, 2015, at 2:30 PM, Aryeh Weiss <
[hidden email]> wrote:
>> Wayne -- thank you for your explanation of the slice labels.
>>
>> I have a question about the Summary table generated by the analyzer.
>>
>> I would like to add a column to it, the way one might do with the results table.
> The summary tables created by the particle analyzer are results tables. Here is a JavaScript example that creates a Summary table and adds two columns to it:
>
> img = IJ.openImage("
http://imagej.nih.gov/ij/images/mri-stack.zip");
> title = img.getTitle();
> IJ.setAutoThreshold(img, "Huang dark");
> IJ.run(img, "Analyze Particles...", "size=1000 summarize stack");
> frame = WindowManager.getFrame("Summary of "+title);
> rt = frame.getTextPanel().getResultsTable();
> for (i=0; i<rt.size(); i++) {
> rt.setValue("Extra1", i, i*100);
> rt.setValue("Extra2", i, "Row "+(i+1));
> }
> rt.show("Summary of "+title);
>
> -wayne
>
Thank you -- this is just what I wanted..
However, in my my python script, the Summary window has the title
"Summary",, while in your js script
the Summary Window has the title "Summary of "+title.
Why is that?
One other question. Is there a way to find all of the classes in which a
given method is implemented. For example, Can I search the API to find
all of the classes for which getResultsTable() is implemented?
--aryeh
>> I came up with the following:
>> IJ.renameResults("Summary", "Results")
>>
>> rtSummary = ResultsTable.getResultsTable()
>>
>> rtSummary.setValue("Slice", rtSummary.getCounter()-2, channelLabels[channel-1]+"_bg")
>> rtSummary.setValue("WeightedMean", rtSummary.getCounter()-2, bgMeanWeighted)
>> rtSummary.setValue("Slice", rtSummary.getCounter()-1, channelLabels[channel-1]+"_cells")
>> rtSummary.setValue("StdDev", rtSummary.getCounter()-1, stdDev)
>> IJ.renameResults("Results", "Summary")
>>
>> So I rename the summary table, and then I use getResultsTable() to assign it to rtSummary.
>> This works -- each call to the analyzer adds to the Summary table, and then I add my items as above.
>>
>> It would be nice to be able to hand the Summary table to a results table constructor, like:
>> rtSummary = ResultsTable("Summary")
>>
>> Is there a better way to do this? (Or more correctly -- what is the best way to do this?)
>>
>> —aryeh
>
>
> --
> ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel
Ph: 972-3-5317638
FAX: 972-3-7384051
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html