I can get the pixel value by converteing DICOM to mat through OpenCVImageBridge, but I would have some trouble when adjusting the window width and window center. I don’t know whether you have a method that we can obtain the Hu value of the DICOM file in ITK directly.Thank you!
If you read the CT image or DICOM series the normal way, ITK image’s pixels directly represent Hounsfield Units. Something like this: firstPixelHU = image->GetPixel({0,0,0});. Once you apply some intensity transform (such as W/L), the pixel intensities will have some other units.
Thanks for replying. we need to adjust the window width and window center to display DICOM within the specified Hu value range, but what I got with GetPixel() is still pixel value, and the result is the same as the result obtained by OpencvImageBridge.What we need to do is achieving Window width and center adjustment based on Hu value , should we only use the formula(U = m*SV + b) that maps pixel values to Hu values? The slope m and intercept b can be obtained in a certain way, such as the following code, and in general, the slope is 1, the intercept is -1024, Is the Hu value in this way accurate?
Thank you for your answer. I know what my problem is. The Hu value obtained by GetPixel is indeed the Hu value. Since I set the image type to unsigned short, many of the data values obtained by traversing DICOM are abnormally large, like 64512. Thus, I thought that what I got was still the pixel value, but when I set the DICOM type to signed short, the value became -1024, and the Hu-based window width and window center can be adjusted by using the filter. Thanks again for your reply.