Declaration
procedure TIEBitmap.AssignColorMap(Map: TIEArrayOfTRGB);
Description
Display image with the gray scale mapped to an
RGB color palette.
AssignColorMap does not modify the image (only what is displayed). To modify the image use
MapGrayToColor.
This method is commonly used to colorize gray-scale DICOM images to make them easier to view.
Parameter | Description |
map | Array of 256 elements of TRGB values |
Note:
◼Pass Map as nil to disable mapping (show true colors)
◼Map must be a 256 item array
◼Standard color palettes can be generated using
GenerateDicomColorPalette,
GenerateColorLuminancePalette,
GenerateHuePalette and
GenerateGradientPalette
◼TIEPixelFormat cannot be ieCMYK
◼Color to gray conversion is controlled by:
RedToGrayCoef,
GreenToGrayCoef,
BlueToGrayCoef
| Demos\InputOutput\DicomRange\Dicom.dpr |
// Show image with inverted Green values
var
map: array [0..255] of TRGB;
i: Integer;
begin
for i := 0 to 255 do
begin
map[i].r := i;
map[i].g := 255-i;
map[i].b := i;
end;
ImageEnView1.IO.LoadFromFile('grayimage.jpg');
ImageEnView1.IEBitmap.AssignColorMap( map );
ImageEnView1.Update();
end;
// Clear color mapping (show true colors)
ImageEnView1.IEBitmap.AssignColorMap( nil );
ImageEnView1.Update();
// Show image with Rainbow palette (image is not changed)
colorMap := GenerateDicomColorPalette( iectRainbow );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();
// Show image with Hot Iron palette
colorMap := GenerateDicomColorPalette( iectHotIron );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();
// Show image with PET palette
colorMap := GenerateDicomColorPalette( iectPET );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();
// Show image with PET 20 Step palette
colorMap := GenerateDicomColorPalette( iectPET20Step );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();
// Show image with Hot Metal Blue palette
colorMap := GenerateDicomColorPalette( iectHotMetalBlue );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();
See Also
◼MapGrayToColor
◼GenerateDicomColorPalette
◼GenerateColorLuminancePalette
◼GenerateHuePalette
◼GenerateGradientPalette