Obtain x- and y-coordinates of where the cursor is

Hello and good day,

I have started using imagej 1.50b.
Using a photograph, I used a straight line and analyzed using Plot Profile to obtain a grey value plot along the line. For distance, I scaled pixels into centimeters. That works very nicely.
With the cursor I now would like to point to a place on the plot and obtain the x- and y- coordinates.
I made use of the getCursorLoc macro, but am obtaining the pixel coordinates of the place where I click with the cursor.
Any suggestions on how to replace pixel coordinates with x- and y?
Best regards, Marcel

Hello,
I looked a bit further. I see the coordinates in the box next to Live (and when you click on Live the coordinates are not shown).
How can you copy the contents of the box to the Log?
Best regards again, Marcel

In the getCursorLoc documentation, it says:

Returns the cursor location in pixels and the mouse event modifier flags. The z coordinate is zero for 2D images. For stacks, it is one less than the slice number. Use toScaled(x,y) to scale the coordinates.
For examples, see the GetCursorLocDemo and the GetCursorLocDemoTool macros.

Did you try the GetCursorLocDemo?

yes, I did. What I missed was the toScaled(x,y). Topic resolved. Thanks!

I am not yet fit writing macros…
Using the above, I would like to make three cursor clicks in the Plot profile and print all three scaled coordinates on a single line in the Log file. I think a little loop in the macro is required.
Can someone help me getting there?