Re: macro to divide two summary results
Posted by
dieter moehring on
URL: http://imagej.273.s1.nabble.com/macro-to-divide-two-summary-results-tp3700523p3700527.html
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.