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?