Basic ImageJ question: using the makepoint(x,y) command where x,y are to set scale, not pixel

I have set the scale in the open image to 12pixels/mm through the GUI
Then…
When I use the command in the macro editor and type the lines:
makepoint(5,5);
roiManager(“add”);
The point is assigned to the pixel coordinates not the mm coordinates.

I’ve tried various things like setting a variable equal to 12
i = 12
And then doing makepoint(5* i,5* i)
But this is not practical because I have 300 images and each image is set to a different scale.

I’ve worked some with the (specify…) command but it feels like I’m missing something here.
Perhaps is there a way to switch the xy coordinate system to create selections via the scaled pixel values that I could set at the beginning of my command. Redoing the (set scale…) doesn’t seem to make a difference.

Thank you so much for any insight you might have on this.

My best, Ken

1 Like

Hi Ken @TREEBARK_forlife ,

you can read out pixel size in physical units from calibrated images using the getPixelSize function.

Does that help in your use-case?

Best,
Robert

1 Like

Thank you very much Robert. I have been able to make some headway on my project thanks to you. The following seems to work for me reaching my next step:

getPixelSize(unit, pW, pH);
makePoint(60/pW, 60/pH);
roiManager(“add”);

The point is now 60mm down and 60mm to the right from the upper lefthand corner of the image.
Thank you.
and the number I input now equals each photos unique calibration/setscale

Thanks so much for this help.

My best,

Ken

1 Like