GetOverlayBitmap method (ILEADDicomDS Interface)

VB.NET example

C# example

Visual Basic example

Visual C++ 6.0 example

 

Syntax

short GetOverlayBitmap(long lOverlayIndex, long lFlags);

Overview

Refer to Overlays Overview.

Remarks

The GetOverlayBitmap method extracts the "Overlay Data" (60xx,3000) for an overlay, initializes and allocates a bitmap based on the "Overlay Columns" (60xx,0011) and "Overlay Rows" (60xx,0010), and then fills the bitmap with the stream of bytes under "Overlay Data" (60xx,3000) element. The handle to the extracted bitmap can then be obtained by accessing the OverlayBitmap property.

If the method doesn’t find the "Overlay Data" element inside the Data Set it will return DICOM_ERROR_OVERLAY_DATA_MISSING.

Before calling this method, you need to use the GetOverlayAttributes method to know if the overlay pixel data is embedded in the "Image Pixel Data" (7FE0,0010) or is under the "Overlay Data" (60xx,3000) element. If the overlay data is embedded in the Image Pixel Data, the flag DICOM_OVERLAY_USEBITPLANE will be set inside the Flags property (specified by the OverlayAttributes property).

If the overlay pixel data is embedded in the "Image Pixel Data" (7FE0, 0010) you will need to follow these steps to get the overlay data as a bitmap handle:

1.

Call one of the methods which can be used to extract the Image Pixel Data like the GetBitmapValue method; this will result in a bitmap handle populated with the Image Pixel Data which has the overlay data embedded. Set the Bitmap property of a LEADRaster object (let’s call it objMainBitmapRaster) to that bitmap handle.

 

2.

Call the GetOverlayAttributes method to get the attributes of the overlay and then set the overlay attributes specified by the OverlayAttributes property of a LEADRasterProcess object (let’s call it objRasterProcess) to the values retrieved by the method.

3.

Now we need to add our overlay as one of the overlays associated with objMainBitmapRaster; to do this, we need to call the SetOverlayAttributes method of the LEADRasterProcess object like this:

objRasterProcess.SetOverlayAttributes objMainBitmapRaster, _
                                                                         0, _
                                      OVERLAYATTRIBUTES_FLAGS + _
                                      OVERLAYATTRIBUTES_BITINDEX + _
                                      OVERLAYATTRIBUTES_ORIGIN + _
                                      OVERLAYATTRIBUTES_DICOM + _
                                      OVERLAYATTRIBUTES_COLOR

 

We are assuming that this is the first overlay in the bitmap and this is why we are passing 0 as the overlay index.

4.

Now we need to extract the overlay data from the main image data:

objRasterProcess.UpdateOverlayBits objMainBitmapRaster, _
                                   0, _
                                   SETOVERLAYBITS_FROMBITMAP

5.

Now to get the overlay data itself as a bitmap handle (LEADRaster object) we need to call the GetOverlayBitmap method of objRasterProcess.

See Also

Elements:

OverlayCount property, OverlayBitmap property, SetOverlayBitmap method, GetOverlayAttributes method, GetOverlayBitmapList method

Topics:

Overlays