# Markups Measurement Tool on 2D \[jpeg\] with scalebar in image

**URL:** <https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570>\
**Category:** Support\
**Created:** [June 3, 2024, 12:58pm UTC](https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570 "2024-06-03T12:58:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skillingsworth](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@skillingsworth](https://discourse.slicer.org/u/skillingsworth)\
**Post date:** [June 3, 2024, 12:58pm UTC](https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570/1 "2024-06-03T12:58:55Z")

</div>

Operating system: Intel(R) Core™ i7-8650U CPU @ 1.90GHz 2.11 GHz Windows 11  
Slicer version: 5.6.2  
Expected behavior: …  
Actual behavior: …

Interested in using 3D Slicer for 2D (jpeg) images. I took all of my images with a scalebar in the photo as seen here, and wondered how I get the markups measuring tool to register the proper scale. See the image here for reference-

 ![img](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/8/b8fe30f298c9e67a22242e822d6ef05ed06eab02.jpeg)

Thank you, Stephanie

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 3, 2024, 3:36pm UTC](https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570/2 "2024-06-03T15:36:21Z")

</div>

First check the spacing of the JPG image you loaded in the Slicer (volumes module). If it is not 1x1x1, set 1x1x1.

Then measure a known distance on the ruler, e.g., from 3 to 10cm (the bigger a distance you measure, the smaller your calibration error will be) using the line tool. Then divide this distance (in mm) to the measurement you obtained by the Line tool (e.g., 1400, so 70/1400 = 0.05 mm/px.

This is the true spacing of your volume after the calibration. If you go back and type in this as your volume spacing, then you should be able to obtain measurements that are correct (you can validate by remeasuring the ruler).

Or you can simply keep the ruler measurement external in a file, and then do the math later.

Regardless though, if you want correct calibration, and your ruler is slanted like this in a picture, you should first put it under a transformation to make the ruler straight to obtain an accurate distance.

---

<div class="post-metadata">

**Author:** ![skillingsworth](https://avatars.discourse-cdn.com/v4/letter/s/e9a140/32.png) [@skillingsworth](https://discourse.slicer.org/u/skillingsworth)\
**Post date:** [June 3, 2024, 3:40pm UTC](https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570/3 "2024-06-03T15:40:19Z")

</div>

Thank you. I’ll give these steps a try.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [June 3, 2024, 3:50pm UTC](https://discourse.slicer.org/t/markups-measurement-tool-on-2d-jpeg-with-scalebar-in-image/36570/5 "2024-06-03T15:50:29Z")

</div>

I made a decimal error in the previous screenshot (and corrected my cm to mm conversion. not enough coffee). Here is the updated screenshot.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/e/8eb280dd3cc82138392d524aa31ee64d9f143840.jpeg)
