# Fixing image spacing for ultrasound images

**URL:** <https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487>\
**Category:** Support\
**Created:** [February 23, 2024, 2:51am UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487 "2024-02-23T02:51:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arian\_Amini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arian_amini/32/69452_2.png) [@Arian\_Amini](https://discourse.slicer.org/u/Arian_Amini)\
**Post date:** [February 23, 2024, 2:51am UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/1 "2024-02-23T02:51:09Z")

</div>

Hello,

I recently began using 3D Slicer to measure ultrasound images, but the ruler isn’t at a 1:1 scale with the ultrasound images (see attached). Other forum posts state that this is an image spacing issue that can be fixed in the “Volume Information” tab, but I’m unsure on how I would determine the correct spacing. Would there also be a way to automate this or not need to do it for every image I work with? I would appreciate any help on this.

Thank you,  
Arian

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

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 23, 2024, 2:56am UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/2 "2024-02-23T02:56:28Z")

</div>

Do you read the image from DICOM or you load screenshots from jpg/png/tiff files?

---

<div class="post-metadata">

**Author:** ![Arian\_Amini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arian_amini/32/69452_2.png) [@Arian\_Amini](https://discourse.slicer.org/u/Arian_Amini)\
**Post date:** [February 23, 2024, 3:41am UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/3 "2024-02-23T03:41:26Z")

</div>

I load them as a JPG, and then save them as a NRRD file, and then I open the NRRD file and work on that.

---

<div class="post-metadata">

**Author:** ![David\_Clunie](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/david_clunie/32/10689_2.png) [@David\_Clunie](https://discourse.slicer.org/u/David_Clunie)\
**Post date:** [February 25, 2024, 2:40pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/4 "2024-02-25T14:40:48Z")

</div>

In traditional DICOM Ultrasound images, since different areas of the screen image may have different information, the pixel size information is specific to “regions” and, if present at all, may be in the [US Region Calibration Module](https://dicom.nema.org/medical/dicom/current/output/chtml/part03/sect_C.8.5.5.html), specifically in PhysicalDeltaX and PhysicalDeltaY, with corresponding units in PhysicalUnitsXDirection and PhysicalUnitsYDirection.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [February 26, 2024, 3:37am UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/5 "2024-02-26T03:37:18Z")

</div>

@Arian_Amini How did you acquire the jpegs: took screenshots, exported from DICOM, …?

---

<div class="post-metadata">

**Author:** ![Arian\_Amini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arian_amini/32/69452_2.png) [@Arian\_Amini](https://discourse.slicer.org/u/Arian_Amini)\
**Post date:** [March 8, 2024, 7:46pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/6 "2024-03-08T19:46:20Z")

</div>

I apologize for the long delay in responding. I have been away the past 2 weeks. I am actually unsure how the jpeg files are obtained. Someone else operates the US and the images are shared with us as JPEG files. I can ask them about that if that would be helpful. Sorry for the lack of info

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 8, 2024, 8:21pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/7 "2024-03-08T20:21:59Z")

</div>

The best would be to get the ultrasound images in DICOM format. Those files store the correct image spacing.

---

<div class="post-metadata">

**Author:** ![Arian\_Amini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arian_amini/32/69452_2.png) [@Arian\_Amini](https://discourse.slicer.org/u/Arian_Amini)\
**Post date:** [March 8, 2024, 8:24pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/8 "2024-03-08T20:24:36Z")

</div>

Ok got it, I’ll try to get my hands on them. In the case that wouldn’t be possible, would I be out of luck or would there still be a possible solution? Thanks for all your help thus far!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 8, 2024, 10:04pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/9 "2024-03-08T22:04:37Z")

</div>

You can compute scale factor by dividing the size of the depth marker line in physical size (as shown in the image) by the line length indicated by the line markup. Then use this value in the first two diagonal value of a transformation matrix (in Transforms module).

@muratmaga Is there a module for this in SlicerMorph extension?

---

<div class="post-metadata">

**Author:** ![Arian\_Amini](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/arian_amini/32/69452_2.png) [@Arian\_Amini](https://discourse.slicer.org/u/Arian_Amini)\
**Post date:** [March 8, 2024, 10:22pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/10 "2024-03-08T22:22:25Z")

</div>

Perfect, thank you so much Andras! It seems like I’ll be able to acquire the DICOM files anyways, so hopefully the issue will resolve itself once I start working with those. I appreciate your help.

---

<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:** [March 8, 2024, 10:35pm UTC](https://discourse.slicer.org/t/fixing-image-spacing-for-ultrasound-images/34487/11 "2024-03-08T22:35:19Z")

</div>

No,

> [@lassoan](#):
>
> @muratmaga Is there a module for this in SlicerMorph extension?

No, it is simple enough with length tool and python console as calculator, we didn’t bother…
