|
Re: pixel size in DICOM images [message #52697 is a reply to message #52696] |
Tue, 27 February 2007 06:54  |
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  |
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
|
|
|