macro to divide two summary results

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

macro to divide two summary results

dieter moehring
Hi,

I am looking for a macro that makes a calculation between two summaries.
I have allready created a macro that gives me two windows named, lets say "summary of A" and "summary of B".
"summary of A" is the summary of results from sample A.
"summary of B" is the summary of results from sample B.
Each summary window gives me Threshold, Count, Total Area, Average Size and Area Fraction.
What I need is a macro for the following calculation:
Total Area of sample B x 100 / Total Area of sample A
The calculated value should be shown in a new window, that is named, for example "Result of Bx100/A"

I hope my description is good enough and someone is able to help,

Thanks in advance,
Dieter
Reply | Threaded
Open this post in threaded view
|

Re: macro to divide two summary results

Josh Doe-2
What are you using for these windows? ResultsTable? Text window? Why
not just combine summary A and B in the same table, adding an
additional column for the Bx100/A?
-Josh D

On 1/25/07, dieter moehring <[hidden email]> wrote:

> Hi,
>
> I am looking for a macro that makes a calculation between two summaries.
> I have allready created a macro that gives me two windows named, lets say
> "summary of A" and "summary of B".
> "summary of A" is the summary of results from sample A.
> "summary of B" is the summary of results from sample B.
> Each summary window gives me Threshold, Count, Total Area, Average Size and
> Area Fraction.
> What I need is a macro for the following calculation:
> Total Area of sample B x 100 / Total Area of sample A
> The calculated value should be shown in a new window, that is named, for
> example "Result of Bx100/A"
>
> I hope my description is good enough and someone is able to help,
>
> Thanks in advance,
> Dieter
> --
> View this message in context: http://www.nabble.com/macro-to-divide-two-summary-results-tf3107422.html#a8616617
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: macro to divide two summary results

dieter moehring
Hi Josh,

I am using "Analyze particles" to get a ResultsTable and a SummaryTable.
My Macro is closing the ResultsTable, only SummaryTable remains.
As I have two different pictures that are calculated, I finally receive two SummaryTables.
"Summmary of A" (picture A), and "Summary  of B" (picture B).
I dont know how I can combine summary A and B in one table, and how to add additional column to calculate Bx100/A.
Can you please explain how to do that?
I would really appreciate that!

Thanks,
Dieter



Josh Doe-2 wrote
What are you using for these windows? ResultsTable? Text window? Why
not just combine summary A and B in the same table, adding an
additional column for the Bx100/A?
-Josh D

On 1/25/07, dieter moehring <dieter.moehring@delfortgroup.com> wrote:
> Hi,
>
> I am looking for a macro that makes a calculation between two summaries.
> I have allready created a macro that gives me two windows named, lets say
> "summary of A" and "summary of B".
> "summary of A" is the summary of results from sample A.
> "summary of B" is the summary of results from sample B.
> Each summary window gives me Threshold, Count, Total Area, Average Size and
> Area Fraction.
> What I need is a macro for the following calculation:
> Total Area of sample B x 100 / Total Area of sample A
> The calculated value should be shown in a new window, that is named, for
> example "Result of Bx100/A"
>
> I hope my description is good enough and someone is able to help,
>
> Thanks in advance,
> Dieter
> --
> View this message in context: http://www.nabble.com/macro-to-divide-two-summary-results-tf3107422.html#a8616617
> Sent from the ImageJ mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: macro to divide two summary results

Gabriel Landini
dieter moehring wrote:
> I am looking for a macro that makes a calculation between two summaries.

> What I need is a macro for the following calculation:
> Total Area of sample B x 100 / Total Area of sample A
> The calculated value should be shown in a new window, that is named, for
> example "Result of Bx100/A"

I am not sure that there is an easy/straightforward way to do this just by
calling one command.
I guess that you would have to get the text from the summary windows, then
parse the quantities into variables, make sure you are getting the right
quantities and operate on them.

If you are just wanting operations between total areas of 2 images, why not do
a macro with a dialog where you input the thresholded image/window names,
then the macro counts the pixels (or extract the areas from the image
histograms) and do the calculation you need within the same macro?

That is the way I would do it.
Cheers,

G.
Reply | Threaded
Open this post in threaded view
|

Re: macro to divide two summary results

dieter moehring
Hello G.,

First, thanks for your reply.
Unfortunately I am not very experienced in writing macros (I use the software-included macros, try to understand and modify them for my purposes), so I dont know how to make it the way you describe.
I have two 8bit black/white pictures that are allready thresholded.
Can you describe the macrotext that will work - it has to calculate amount of black pixels in picture B x 100 / amount of black pixels in picture A. The result should be shown in a new window.
Sorry, but I cannot describe it a better way!

Thanks!
Dieter


Gabriel Landini wrote
dieter moehring wrote:
> I am looking for a macro that makes a calculation between two summaries.

> What I need is a macro for the following calculation:
> Total Area of sample B x 100 / Total Area of sample A
> The calculated value should be shown in a new window, that is named, for
> example "Result of Bx100/A"

I am not sure that there is an easy/straightforward way to do this just by
calling one command.
I guess that you would have to get the text from the summary windows, then
parse the quantities into variables, make sure you are getting the right
quantities and operate on them.

If you are just wanting operations between total areas of 2 images, why not do
a macro with a dialog where you input the thresholded image/window names,
then the macro counts the pixels (or extract the areas from the image
histograms) and do the calculation you need within the same macro?

That is the way I would do it.
Cheers,

G.