Visual Basic (Declaration) | |
---|---|
Public Function GetOverlayImage( _ ByVal index As Integer _ ) As RasterImage |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public RasterImage GetOverlayImage( int index ) |
Managed Extensions for C++ | |
---|---|
public: RasterImage GetOverlayImage( int index ) |
C++/CLI | |
---|---|
public: RasterImage GetOverlayImage( int index ) |
Parameters
- index
- The zero-based index of the overlay whose image is required.
Return Value
Image filled with the overlay data.If the method does not find the "Overlay Data" element inside the Data Set it will throw an DicomExceptionCode.OverlayDataMissing exception.
Before calling this method you must call GetOverlayAttributes to determine if the overlay pixel data is embedded in the "Image Pixel Data" (7FE0,0010) element or is under the "Overlay Data" (60xx,3000) element. If the overlay data is embedded in the "Image Pixel Data", UseBitPlane will be set to true in the attributes returned by GetOverlayAttributes.
If the overlay pixel data is embedded in the "Image Pixel Data" (7FE0, 0010), follow these steps to get the overlay data:
Call one of the methods which can be used to extract the "Image Pixel Data", such as GetImage. This will return a raster image populated with the "Image Pixel Data" with the overlay data embedded. For this example, assume that the raster image returned by this method is called mainImage. Call GetOverlayAttributes to get the attributes of the overlay. For this example, assume that the overlay attributes returned by this method is called overlayAttributes. Now we need to add our overlay as one of the overlays associated with mainImage. To do that, we need to call SetOverlayAttributes: mainImage.
(0, overlayAttributes, RasterGetSetOverlayAttributesFlags.Flags | RasterGetSetOverlayAttributesFlags.BitIndex | RasterGetSetOverlayAttributesFlags.Origin | RasterGetSetOverlayAttributesFlags.Dicom | RasterGetSetOverlayAttributesFlags.Color); We are assuming that this is the first overlay in the image; this is why we are passing 0 as the overlay index.
Now we need to extract the overlay data from the main image data: mainImage.
(0, RasterUpdateOverlayBitsFlags.FromImage); Now call mainImage.GetOverlayImage to get the overlay data itself as a raster image.
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family