Fovia C++ In-Process API
Setting Window Width/Level

Window width is the range of CT numbers (in Hounsfield units) included in the gray scale video display of the CT image, ranging from 1 to 2000 or 3000, depending on the type of the scanning machine.

Window level is the CT number setting (in Hounsfield units) of the midpoint of the window width, which is the gray scale of the image; a typical window level for imaging the lungs if -500; for the abdomen, 0.

$RenderRangeMin = WindowLevel - WindowWidth/2$ $RenderRangeMax = WindowLevel + WindowWidth/2$

//Assign the pointer according to your code
IRenderEngine* piRenderEngine = NULL;
ZEROMEMORY(rp);
rp.cbSize = sizeof(rp);
rp.Mask = RENDER_PARAMS_MASK_RENDER_RANGE_MIN_MAX;
rp.RenderRangeMin = WindowLevel - WindowWidth/2;
rp.RenderRangeMax = WindowLevel + WindowWidth/2;
if(piRenderEngine != NULL)
{
hr = piRenderEngine->SetRenderParams(&rp);
if(FAILED(hr)) return hr;
}