Hi there,

I’m using the StackProfileData ( to get results of profiles in entire stacks. A very powerful and nice macro!° It gives the profile results of a given line or rectangle selection for an entire stack.

 	x	1 (0,1s)	2 (1,6s)	…
1	0	63	62	…
2	1	63	62	…
3	2	63	63	…
4	3	64	65	…
…	…	…	…	…

My wish is to get the coordinates of the selection printed in an extra row if it’s easily done. I thought of using “getSelectionBounds(x, y, width, height)”? Any Ideas how?

Best wishes, jonas


You are searching for something like this:

print("bounds: ",x,y,w,h);

But also have a look at the macro API:

Here an example:

So you can, e.g., add this at the end of the macro to get the selection coord. in the first row (all other columns are 0 - take care of the variable names!):

Roi.getBounds(xc, yc, xwidth, xheight);
//print("bounds: ", xc, yc, xwidth, xheight);
setResult("xc", 0, xc);
setResult("yc", 0, yc);
setResult("xwidth", 0, xc);
setResult("xheight", 0, xheight);

Of course you could also put the values at the end (last row).


Thank you, Bio7!
Exactly what I searched for! Have a nice day wishes