ImageEn, unit ieDicomTags

GenerateDicomColorPalette


Declaration

function GenerateDicomColorPalette(ColorTable: TIEColorTable): TIEArrayOfTRGB;


Description

Returns array of 256 RGB colors for a specified color palette.
These palettes are commonly used to colorize gray-scale DICOM images.

To display images with a color map (without modifying the image) use AssignColorMap.
To change the colors of an image use MapGrayToColor

Notes:
- Add ieDicomTags to your uses clause to support GenerateDicomColorPalette
- ieDicomTags adds about 400KB to your exe


Demos

Demo  Demos\InputOutput\DicomRange\Dicom.dpr
Demo  Demos\Other\ColorPalette\ColorPalette.dpr


Examples

// Show preview of Rainbow color palette
var
  colorMap: TIEArrayOfTRGB;
  aColor: TColor;
begin
  colorMap := GenerateDicomColorPalette( iectRainbow );
  IEPromptForColor( aColor, colorMap, Length( colorMap ));
end;




// Show image with Rainbow palette (image is not changed)
colorMap := GenerateDicomColorPalette( iectRainbow );
ImageEnView1.IEBitmap.AssignColorMap( colorMap );
ImageEnView1.Update();




// Apply Hot Iron palette to image (change image)
colorMap := GenerateDicomColorPalette( iectHotIron );
ImageEnView1.Proc.MapGrayToColor( colorMap );




// Apply PET palette to image
colorMap := GenerateDicomColorPalette( iectPET );
ImageEnView1.Proc.MapGrayToColor( colorMap );




// Apply PET 20 Step palette to image
colorMap := GenerateDicomColorPalette( iectPET20Step );
ImageEnView1.Proc.MapGrayToColor( colorMap );




// Apply Hot Metal Blue palette to image
colorMap := GenerateDicomColorPalette( iectHotMetalBlue );
ImageEnView1.Proc.MapGrayToColor( colorMap );




// Display Hot Iron palette in TIEColorPalette
var
  colorMap: TIEArrayOfTRGB;
begin
  colorMap := GenerateDicomColorPalette( iectHotIron );
  ColorPalette1.AssignPalette( colorMap );
end;

// Show colors as inverted (Negative)
var
  colorMap: TIEArrayOfTRGB;
begin
  colorMap := GenerateDicomColorPalette( iectInverted );
  ColorPalette1.AssignPalette( colorMap );
end;


See Also

- IEPromptForColor
- AssignColorMap
- MapGrayToColor