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

Home » Public Forums » archive » Reading DICOM images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Reading DICOM images [message #47191 is a reply to message #47102] Wed, 25 January 2006 12:27 Go to previous messageGo to previous message
Mike[2] is currently offline  Mike[2]
Messages: 99
Registered: December 2005
Member
DICOM image data is stored as integers. To scale them to the
appropriate units, you can use the following function. (This will work
for any DICOM image)

function rescaled_dicom_image, filename
;; rescaled_dicom_image: load a single dicom image slice from filename
;; and rescale it with rescale slope and intercept.
dcm = obj_new('IDLffDICOM')
dcm->Reset
var = dcm->Read(filename)
rescale_slope = *(dcm->GetValue('0028'x,'1053'x))[0]
rescale_intercept = *(dcm->GetValue('0028'x,'1052'x))[0]
img = float(*(dcm->GetValue('7fe0'x,'0010'x))[0]) * rescale_slope +
rescale_intercept
obj_destroy, dcm
return, img
end

This will give you a properly scaled image for for almost all DICOM
data. I think that this is always in HU for CT image data, but YMMV on
that. For some modalities, you can find the units of the image values
as well. For example, for PET data, you can learn the units from the
NMI Units (0054,1001).
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: MODE in IDL?
Next Topic: 2D density plot *** hist_2d *** LARGE ARRAYS

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

Current Time: Wed Oct 08 18:40:04 PDT 2025

Total time taken to generate the page: 0.00435 seconds