I am currently adjusting the brightness and contrast of a grayscale image using fo-dicom.
Loading the image:
_dicomFile = DicomFile.Open(GetImageFileName());
_dicomImage = new DicomImage(_dicomFile.Dataset);
WindowLevel = _dicomImage.WindowCenter;
WindowWidth = _dicomImage.WindowWidth;
var grayScaleOptions = GrayscaleRenderOptions.FromBitRange(_dicomFile.Dataset);
Depth = grayScaleOptions.BitDepth.BitsAllocated;
DisplayedImage = _dicomImage.RenderImage().As<WriteableBitmap>();
On mouse move, I am adjusting the brightness and contrast
public void OnMouseMove(object sender, MouseCaptureArgs e)
{
//...
_dicomImage.WindowWidth += e.X - _lastXPos;
_dicomImage.WindowCenter += e.Y - _lastYPos;
_dicomImage.UseVOILUT = false;
_lastXPos = e.X;
_lastYPos = e.Y;
DisplayedImage = _dicomImage.RenderImage().As<WriteableBitmap>();
}
Everything is working as expected. I am little confused where Hounsfield values come into picture. I know about how HU is calculated based on slope and intercept.
I have checked the fo-dicom code and did not find any references to HU.
If I display the WW and WC values that I am calculating here on the image, it won't be the HU values that user expects to see?