I'm trying to implement the dicom veiwer. And i thought i'm almost done. But some CT images different with MATLAB. So i checked tags. Then i found something.
These images have two value of window center and window width.
window center = [2000], window width = [8000]
Then i calculate yMin, yMax.
yMin = (winCenter - 0.5 * winWidth)
yMax = (winCenter + 0.5 * winWidth)
if(inPixel <= yMin)
outpixel = 0;
else if (inPixel > yMax)
outPixel = 255;
else
outPixel = (((i - (winCenter - 0.5)) / (winWidth - 1)) + 0.5) * 255;
But the problem is this case.
window center = [-600;40], window width = [400;1200]
How can i calculate this values? Anyone know how i can implement this.