MATLAB: Dicomread() not handling negative values properly

dicomdicominfodicomreadImage Processing Toolboxintegernegativesignedunsignedzero

I am using the "dicomread" function to read in a DICOM file. The function seems to be converting all my negative values to zero which then shows a black spot at those points when it is extracted to an image.
>> x = dicomread(filename)
How do I fix this?

Best Answer

This is occurring because MATLAB is reading the DICOM as unsigned integers. This can be seen by looking at the output of the "dicominfo" function.
>> info = dicominfo(filename)
The 'PixelRepresentation' shows 0 when the DICOM is unsigned and 1 when the DICOM is signed.
In order to get the desired values back, simply use the following equation to do a linear rescaling.
>> y = int16(x) *info.RescaleSlope + info.RescaleIntercept