From: Saman on
"Ida Haggstrom" <ida_haggstrom(a)yahoo.se> wrote in message <gcv0j1$rjg$1(a)fred.mathworks.com>...
> Hi!
> I have a problem with DICOMREAD. I have a dynamic PET data set (medical), with pixel values above 16 bit. When I read the DICOM file into Matlab, using DICOMREAD, this changes the pixel values of the images, probably because it can't handle pixel values above 2^16. If I study one pixels value dynamically, the intensity as a function of time is completely different from what it should be!
> Has anyone encountered this problem, and found out how to get around it? Is there another way to read DICOM images into Matlab without using DICOMREAD? Thanks!
> /Ida

Hi Ida,

Did you by any chance figure out why dicomread changes the pixel values and what to do about it?

Thanks,
Saman
From: Jeff Mather on
Saman wrote:
> "Ida Haggstrom" <ida_haggstrom(a)yahoo.se> wrote in message
> <gcv0j1$rjg$1(a)fred.mathworks.com>...
>> Hi!
>> I have a problem with DICOMREAD. I have a dynamic PET data set
>> (medical), with pixel values above 16 bit. When I read the DICOM file
>> into Matlab, using DICOMREAD, this changes the pixel values of the
>> images, probably because it can't handle pixel values above 2^16. If I
>> study one pixels value dynamically, the intensity as a function of
>> time is completely different from what it should be! Has anyone
>> encountered this problem, and found out how to get around it? Is there
>> another way to read DICOM images into Matlab without using DICOMREAD?
>> Thanks!
>> /Ida
>
> Hi Ida,
>
> Did you by any chance figure out why dicomread changes the pixel values
> and what to do about it?
>
> Thanks,
> Saman


Saman and Ida,

I don't think this is the intended behavior of DICOMREAD, which is
supposed to give back the data exactly as it's stored in the
Pixel/Instance Data field of the DICOM file.

If one of you are able to send me a file containing data that you feel
is read incorrectly, I will investigate it.

Jeff
From: Saman on
Jeff Mather <jeff.mather(a)mathworks.com> wrote in message <4C06A168.6030609(a)mathworks.com>...
> Saman wrote:
> > "Ida Haggstrom" <ida_haggstrom(a)yahoo.se> wrote in message
> > <gcv0j1$rjg$1(a)fred.mathworks.com>...
> >> Hi!
> >> I have a problem with DICOMREAD. I have a dynamic PET data set
> >> (medical), with pixel values above 16 bit. When I read the DICOM file
> >> into Matlab, using DICOMREAD, this changes the pixel values of the
> >> images, probably because it can't handle pixel values above 2^16. If I
> >> study one pixels value dynamically, the intensity as a function of
> >> time is completely different from what it should be! Has anyone
> >> encountered this problem, and found out how to get around it? Is there
> >> another way to read DICOM images into Matlab without using DICOMREAD?
> >> Thanks!
> >> /Ida
> >
> > Hi Ida,
> >
> > Did you by any chance figure out why dicomread changes the pixel values
> > and what to do about it?
> >
> > Thanks,
> > Saman
>
>
> Saman and Ida,
>
> I don't think this is the intended behavior of DICOMREAD, which is
> supposed to give back the data exactly as it's stored in the
> Pixel/Instance Data field of the DICOM file.
>
> If one of you are able to send me a file containing data that you feel
> is read incorrectly, I will investigate it.
>
> Jeff

Thank you so much Jeff for your help.

Here is the solution (for everyone's benefit):
X = dicomread('the file name');
meta = dicominfo('the file name');
Y = X * meta.RescaleSlope + meta.RescaleIntercept;

Y will now have the scaled pixel values.

Thanks again.
Saman