ImageEn, unit iexBitmaps

TIEBitmap.WhiteValue

TIEBitmap.WhiteValue


Declaration

property BlackValue: double;


Description

Specifies (along with BlackValue) the values range from black to white.

For example, if your image is a gray scale (256 levels) where only values from 100 to 200 are used (100 is black and 200 is white), to display the image you must write:

ImageEnView1.IEBitmap.BlackValue := 100;
ImageEnView1.IEBitmap.WhiteValue := 200;
ImageEnView1.Update();


Valid ranges will depend on the format, e.g.
ie8g, ie24RGB: 0 - 255
ie16g: 0 - 65535
ie32f: 0.0 - 1.0

Note:
To permanently apply the range to the image, use StretchValues
Set both WhiteValue and BlackValue to 0 to disable stretching

Default: 0


Demos

Demo  Demos\Display\DisplayAdjust\Display.dpr
Demo  Demos\InputOutput\DicomRange\Dicom.dpr


Examples

// Calculate Window Center and Width
WindowWidth  := Round( ImageEnView1.IEBitmap.WhiteValue - ImageEnView1.IEBitmap.BlackValue + 1 );
WindowCenter := Round( ImageEnView1.IEBitmap.BlackValue + 0.5 + ( ImageEnView1.IEBitmap.WhiteValue - ImageEnView1.IEBitmap.BlackValue ) / 2 );
Caption := 'WindowWidth: ' + IntToStr( WindowWidth ) + ' - WindowCenter: ' + IntToStr( WindowCenter );

// Set black and white values based on Window Center and Width
ImageEnView1.IEBitmap.BlackValue := WindowCenter - 0.5 - ( WindowWidth - 1) / 2;
ImageEnView1.IEBitmap.WhiteValue := WindowCenter - 0.5 + ( WindowWidth - 1) / 2;


See Also

BlackValue
StretchValues
Dicom_WindowCenter
Dicom_WindowWidth
DICOMWindowingStrategy