comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: pixel size in DICOM images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: pixel size in DICOM images [message #52696] Tue, 27 February 2007 07:04
Peter Clinch is currently offline  Peter Clinch
Messages: 98
Registered: April 1996
Member
Mike wrote:

> To get the pixel size and image dimensions, you can use IDLffDICOM:
<snip>

That was pretty comprehensive!

Many thanks, problem sorted... :-)

Pete.
--
Peter Clinch Medical Physics IT Officer
Tel 44 1382 660111 ext. 33637 Univ. of Dundee, Ninewells Hospital
Fax 44 1382 640177 Dundee DD1 9SY Scotland UK
net p.j.clinch@dundee.ac.uk http://www.dundee.ac.uk/~pjclinch/
Re: pixel size in DICOM images [message #52697 is a reply to message #52696] Tue, 27 February 2007 06:54 Go to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
On Feb 27, 9:32 am, Peter Clinch <p.j.cli...@dundee.ac.uk> wrote:
> As far as I can tell the QUERY_DICOM routine doesn't actually tell me
> the pixel size (i.e., mm in the original target, not number of pixels
> making up the image) of an image. Which is a shame, as I'd really like
> to know what that is!
>
> Have I got that wrong, or are there any suggestions from The Team as to
> how I'd most easily go about getting that?

To get the pixel size and image dimensions, you can use IDLffDICOM:

IDL> dcm = obj_new('IDLffDICOM')
IDL> var = dcm->read(filename)
IDL> Nx = *(dcm->getvalue('0028'x,'0010'x))[0]
IDL> Ny = *(dcm->getvalue('0028'x,'0011'x))[0]
IDL> pixel_size = *(dcm->getvalue('0028'x,'0030'x))[0]
IDL> help, Nx, Ny, pixel_size
NX UINT = 512
NY UINT = 512
PIXEL_SIZE STRING = '0.9765625\0.9765625 '
IDL> print, float(strsplit(pixel_size, '\', /extract))
0.976562 0.976562

Although I often use the DICOM standard to look up group/element
pairs, it is even easier to use IDLffDICOM::dumpelements:

IDL> dcm->dumpelements

Regards, Mike
Re: pixel size in DICOM images [message #52698 is a reply to message #52697] Tue, 27 February 2007 06:54 Go to previous message
Jo Klein is currently offline  Jo Klein
Messages: 54
Registered: January 2006
Member
Hi Pete,
Pixel size is stored in tag (0028,0030). Note that this is actually
pixel spacing, not pixel size, although in most contexts these terms are
interchangable. The IDLffDICOM object will help you extract this and
other data.
Cheers,
Jo
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: pixel size in DICOM images
Next Topic: Help with georeferencing using envi

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:14:05 PDT 2025

Total time taken to generate the page: 0.00588 seconds