Thread Subject: wrong extraction of signed data with dicomread

Subject: wrong extraction of signed data with dicomread

From: Eva

Date: 30 Aug, 2010 13:20:22

Message: 1 of 3

Hello,
I am using dicomread in MATLAB 7.0 to process medical MRI data. Although this command works fine for regular DICOM images with positive pixel values (magnitude reconstruction at the MRI scanner), it gives out wrong values for a set of data which contain positive and negative pixel values (real reconstruction at the MRI scanner). I think the problem emerges because the DICOM data are signed while dicomread reads them as uint16. Not only the minus sign is lost, but the values are wrong as well.
I changed in the DICOM header the PixelRepresentation from 0 to 1 , hoping that dicom_read_native.m would treat the data as int16. The dicomread output were int16 indeed but again wrong positive or zero values.
Can anybody suggest a way to extract the signed pixel values correctly?
Thanks,
Eva

Subject: wrong extraction of signed data with dicomread

From: Jeff Mather

Date: 30 Aug, 2010 18:04:23

Message: 2 of 3

"Eva " <kazaevan@uni-greifswald.de> wrote in message <i5gb6m$8ch$1@fred.mathworks.com>...
> Hello,
> I am using dicomread in MATLAB 7.0 to process medical MRI data. Although this command works fine for regular DICOM images with positive pixel values (magnitude reconstruction at the MRI scanner), it gives out wrong values for a set of data which contain positive and negative pixel values (real reconstruction at the MRI scanner). I think the problem emerges because the DICOM data are signed while dicomread reads them as uint16. Not only the minus sign is lost, but the values are wrong as well.
> I changed in the DICOM header the PixelRepresentation from 0 to 1 , hoping that dicom_read_native.m would treat the data as int16. The dicomread output were int16 indeed but again wrong positive or zero values.
> Can anybody suggest a way to extract the signed pixel values correctly?
> Thanks,
> Eva

Hi Eva,

It's quite possible that the values are stored in the file as unsigned values (as suggested by the PixelRepresentation value) but that some scaling was applied. Take a look at the RescaleSlope and RescaleIntercept values from DICOMINFO. These define a linear rescaling of pixel values (y=mx+b).

If that doesn't solve the discrepancy you're seeing, feel free to contact me directly.

Jeff Mather
Image Processing Group
MathWorks

Subject: wrong extraction of signed data with dicomread

From: Eva

Date: 31 Aug, 2010 16:20:19

Message: 3 of 3

Hi Jeff,

thank you very much for your quick answer: with rescaling I got the negative values too, after converting first the values read by dicomread to int16:
y = int16(x) *info.RescaleSlope + info.RescaleIntercept;

Thanks again,
Eva


> It's quite possible that the values are stored in the file as unsigned values (as suggested by the PixelRepresentation value) but that some scaling was applied. Take a look at the RescaleSlope and RescaleIntercept values from DICOMINFO. These define a linear rescaling of pixel values (y=mx+b).
>
> If that doesn't solve the discrepancy you're seeing, feel free to contact me directly.
>
> Jeff Mather
> Image Processing Group
> MathWorks

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
int16 Eva 30 Aug, 2010 11:06:19
dicomread Eva 30 Aug, 2010 11:06:07
rssFeed for this Thread

Contact us at files@mathworks.com