How to Measure distance between 2 points in DICOM?

1,987 views
Skip to first unread message

NV

unread,
Oct 14, 2015, 9:26:34 AM10/14/15
to Fellow Oak DICOM for .NET
Hi Everyone,

I visited numerous blogs. Seems like Its Pixel Spacing that will help me out. However question is how to retrieve those values & calculate the distance between the two? 

Thanks in Advance.



Marek Fekete

unread,
Oct 14, 2015, 10:31:13 AM10/14/15
to Fellow Oak DICOM for .NET
Hi,
do you mean you have 2 points given by pixel coordinates on a single DICOM image and you want to know a real-word (physical) distance between them?

NV

unread,
Oct 14, 2015, 12:05:30 PM10/14/15
to Fellow Oak DICOM for .NET
Hi Marek,

Thanks for your prompt response. Yes exactly the same. Kindly suggest how to calculate the same?

Regards
NV

Marek Fekete

unread,
Oct 14, 2015, 1:51:27 PM10/14/15
to Fellow Oak DICOM for .NET
Pixel spacing in an image has two values, delimited by backslash - these are Pixel Spacing Rows and Pixel Spacing Columns. They are simply the Y and X distances between individual pixels, lets denote them Py and Px.

Then, if the individual points have pixel coordinates [X1, Y1] and [X2, Y2] respectively, their distance will be

sqrt( ( (X1-X2) * Px)^2 + ((Y1-Y2) * Py)^2)

(this is simply hypotenuse length of a right-angled triangle, its endpoints being the two points you have, and the legs are of lengths |X1-X2| and |Y1-Y2| in pixels, which multiplied by the appropriate pixel spacing gives leg lengths in millimeters).


NV

unread,
Oct 15, 2015, 6:20:47 AM10/15/15
to Fellow Oak DICOM for .NET
Thanks Marek for the response. It looks pretty clear now. 

I have 3 questions for you - 

1) I see there are numerous modalities available. It seems Pixel spacing is not available for all. How to proceed with other modalities?
2) Likewise, I'm also aiming to draw angle & ellipse on the dicom image. Do we have any specific formula for them too?
3) While zooming (in & out) an image with line/angle/ellipse with measurement drawn on it - is there any steps we need to take to make sure measurement will be shown accurate?

Please suggest.

Marek Fekete

unread,
Oct 15, 2015, 8:14:33 AM10/15/15
to Fellow Oak DICOM for .NET
Hi,
1) If you do not have Pixel Spacing, you'll not be able to tell the real-world distances.

Regarding 2) and 3) - these are really problems of realizing the geometry of the situation. You should draw yourself a sketch of the situation to understand how the image (pixel) coordinate system is related to real-world distances, I do not think you'll find it overly complicated once you realize the relationship.

Chris Horn

unread,
Feb 5, 2016, 7:20:58 AM2/5/16
to Fellow Oak DICOM
I know the Question is a little old now in case your still looking for answers

there are number of different tags that need to be checked
  • Pixel Spacing (0028,0030)

  • Imager Pixel Spacing (0018,1164)

  • UltraSound you need to check inside (0018,6011)Sequence of Ultrasound Regions for: Physical Units X Direction

    (0018,6024) and Physical Units Y Direction  (0018,6026) these 2 will tell you the unit of measure for that region eg cm see C.8.5.5.1.15

  • then you need to read:

Physical Delta X

  (0018,602C)


The physical value increments per positive X pixel increment. The units are as specified in the Physical Units X Direction (0018,6024).

Physical Delta Y  

(0018,602E)


The physical value increments per positive Y pixel increment. The units are as specified in the Physical Units Y Direction (0018,6026).



Drawing ellipse's I assume you are referring to to drawing an eliptical ROI this is more tricky as it involves getting all the pixelvalues under the ellipse in HU, then performing calculations to get the Standard deviation
formula for angle between 2 lines

question 3 will will depend on implimentation and and technology used, eg Windows forms vs WPF, a good place to get a feel for this if you have no experience is to look at something like clearcanvas source code as this may be a good starting point
hope it helps

Sameh Samir

unread,
Feb 21, 2020, 1:54:14 AM2/21/20
to Fellow Oak DICOM
Dear All,

I just have a question 

is this correct  (0018,602C) PhysicalDeltaX  -0.036248147487640381  according to dicom standards of US image?

can the physicalDelta X (0018,602C)   have a negative value in the US image according to dicom standard?

thank you for your reply in advance
Reply all
Reply to author
Forward
0 new messages