I have taken this picture from a scientific paper:

enter image description here

The paper says that the size of picture is 92.3 microns. By importing the picture in Mathematica and right-clicking on it and using Get Coordinates, I can calculate the distance between the centers of two circles. How can I obtain the real distance in micrometer? (In other words, after obtaining coordinates of centers of circles with Get Coordinates, is there a neat way to recast the relative coordinates in microns?)


2 Answers 2


Get the pixel dimensions of the image and find a scaling-factor in microns/pixel (assuming the width is 92.3 microns). Use EuclideanDistance to find a distance in pixels and multiply by scale.

{w, h} = ImageDimensions[img = Import["https://i.sstatic.net/V4Jy3.jpg"]];
scale = Quantity[92.3, "Microns"] / w;

Then a distance of 900 pixels is 92.3 microns.

scale * EuclideanDistance[{0, 0}, {900, 0}]
(* 92.3microns *)

After copying two points in pixels from the image using Get Coordinates, paste the values as {p1, p2} and compute the distance in microns. For example:

{p1, p2} = {{96.50935683139538, 21.65470566860472},{780.5289335029071, 434.6668332122093}};
scale * EuclideanDistance[p1, p2]
(* 81.9458microns *)

This scales the width to 90 microns. The "Get Coordinates" tool works fine.

  img00 = Import["https://i.sstatic.net/V4Jy3.jpg"];
    imgDims = ImageDimensions[img00];
    scale = 10^-10; (* Width adjusted to 90 micron because width = 900 pixels *)
    Graphics[Raster[ImageData[img00], scale {{0, 0}, imgDims}], 
     Frame -> True] 

enter image description here

  • 1
    $\begingroup$ The size is effectively 4.5 10^-15 and not what you asked. I didn't want to obfuscate the answer which details that are not the point (I think). $\endgroup$
    – andre314
    Commented May 3, 2021 at 18:11
  • $\begingroup$ Thanks for your answer. I understood how to proceed from here. $\endgroup$
    – user79703
    Commented May 3, 2021 at 18:21
  • 1
    $\begingroup$ Have a look at component measurements and like. There's a centroid option that gives you all centers of these cells. $\endgroup$
    – Lou
    Commented May 3, 2021 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.