0
votes

I have a Dicom image file in dcm format.In matlab by using Dicomread i got image data and by using dicominfo i got window center and window width of that dcm file. Now i want to display the image by using imshow in figure.

My code is below,

ct = dicomread('E:\IM-0001-0001.dcm'); 
info = dicominfo('E:\IM-0001-0001.dcm');
figure
imshow(ct , [info.WindowCenter, info.WindowWidth]);

but it gives a error

 Error using checkDisplayRange (line 20)
HIGH must be greater than LOW.

I knew why this error was came .it occur because of window center value is more than window width.

Now my question is

1.whether my code is right or wrong for assign the Window level and window width for dcm image?

2.How to assign the Window level and window width for dicom image when above condition occur?

2
Can you provide the image?Mark Setchell

2 Answers

1
votes

Just calculate the highest and lowest value by

low = center - width / 2
high = center + width / 2

and use this values for imshow

imshow(ct, [low, high])
0
votes

If I inspect that image with ImageMagick's identify command like this, I get the following...

identify -verbose IM-0001-0001.dcm | grep -i window

dcm:WindowCenter: 2856.4189453125
dcm:WindowWidth: 2475.0

I am inclined to believe these values since ImageMagick appears to extract the image perfectly well as below:

enter image description here

I would suggest you maybe check your window values with some other software.