Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

calculate distance

116 views
Skip to first unread message

zia

unread,
Sep 9, 2005, 11:05:16 AM9/9/05
to
hi all!


can anyone tell me that how to calculate distance between any two
points on DICOM Image, and wat will be the approach using DCMTK 3.5.3.


reagrds
Zia

David Clunie

unread,
Sep 10, 2005, 11:05:21 AM9/10/05
to
Hi Zia

zia wrote:

> can anyone tell me that how to calculate distance between any two
> points on DICOM Image, and wat will be the approach using DCMTK 3.5.3.

In general one needs to determine the distance in mm along the column
axis between the two points, and the distance along the row axis
between the two points, using the appropriate pixel spacing
attribute values to convert the distance in pixels to mm, and then
compute the hypotenuse of the triangle so defined.

Given:

Point 1 (C1,R1)
Point 2 (C2,R2)
Spacing (Cs,Rs)

distance (mm) = sqrt( ((C2-C1)*Cs)**2 + ((R2-R1)*Rs)**2 )

One needs to determine the appropriate pixel spacing attribute to
use, depending on the SOP Class, and remember that it has two values,
first the row spacing, and then the column spacing.

NEVER assume that the pixels are square - always use the separate
row and column spacing values, and compute the distance along the
rows and columns before the hypotenuse, or at the very least check
that the row and column spacing values are equal, if for some
reason you want to only support square pixels.

This is the two dimensional case; the three dimensional case (across
multiple slices) is similar (and described in PS 3.3 C.7.6.2).

For cross-sectional imaging (SOP Classes that include the Image
Plane Module or Pixel Measures Functional Group or the NM Image
Module), Pixel Spacing (0028,0030) is the appropriate attribute.

For projection radiography, (those SOP Classes for which Imager
Pixel Spacing (0018,1164) and not Pixel Spacing (0028,0030) is
defined, e.g., CR, DX, XA/XRF), use Imager Pixel Spacing (0018,1164).

See also CP 586 for a discussion of this, and what it (might) mean
when a vendor has included both (0028,0030) and (0018,1164) and
they have different values. I have also made some test images to
detect when what I consider to be non-standard choices are
being made for projection radiography.

See "http://www.dclunie.com/images/pixelspacingtestimages.zip".

For multi-frame secondary capture images, use Nominal Scanned Pixel
Spacing (0018,2010).

For RT Images, use Image Plane Pixel Spacing (3002,0011).

For Slide Microscopy, there is a separate mechanism. See C.8.12.2
Slide Coordinates Module. I am not sure if anyone has ever implemented
this.

For Ultrasound, things are completely different, and if Region
Calibration is supported, you need to determine if the region
is described by a physical distance and use the corresponding
Physical Units and Physical Delta values. See C.8.5.5 US Region
Calibration Module.

When images have been calibrated and this calibration has been
stored in a presentation state, use the Presentation Pixel Spacing
(0070,0101) as defined in C.10.4 Displayed Area Module.

For SOP Classes that do not explicitly support any kind of pixel
spacing information, or for those SOP classes that do but vendors
add extra (Standard Extended) attributes anyway, it is very
difficult to determine what the result of any measurement "means".
E.g., if Pixel Spacing (0028,0030) is present in a Secondary
Capture SOP Class does it mean the physical spacing on the
scanned object or some calibrated or corrected value ? Conformance
statements may or may not say.

As a general rule, if there are multiple potential sources of
information about the spacing of the pixels and these would
result in different measurements, it is appropriate to warn the
user or give them the choice or describe the source of the spacing
information used. Similarly, if the only non-standard spacing
information is available, the user should be warned.

Inappropriate assumptions by the user of the meaning or veracity
of the spacing information is a potential safety hazard.

In general, for other than cross-sectional modalities (for which
the modality really knows the spacing), it is always safer to have
the user calibrate against a known sized object in a known location
or plane.

David

zia

unread,
Sep 18, 2005, 2:23:52 AM9/18/05
to
hi david!

Many Many Thanks for ur reply , but tell wat tags should i read from
DICOM images to calculate distance accurately.

thanks

zia

0 new messages