←Select platform

DoGetImage Method

Summary

Gets an image from a DICOM object with the preferred compression options.

Syntax

C#
VB
C++
protected override byte[] DoGetImage( 
   string dicomFileName, 
   string sopInstanceUID, 
   int frameNumber, 
   int imageWidth, 
   int imageHeight, 
   string mimeType, 
   int bitsPerPixel, 
   int qualityFactor, 
   string extraData 
) 
  
Protected Overrides Function DoGetImage( _ 
   ByVal dicomFileName As String, _ 
   ByVal sopInstanceUID As String, _ 
   ByVal frameNumber As Integer, _ 
   ByVal imageWidth As Integer, _ 
   ByVal imageHeight As Integer, _ 
   ByVal mimeType As String, _ 
   ByVal bitsPerPixel As Integer, _ 
   ByVal qualityFactor As Integer, _ 
   ByVal extraData As String _ 
) As Byte() 
protected: 
array<byte>^ DoGetImage(  
   String^ dicomFileName, 
   String^ sopInstanceUID, 
   int frameNumber, 
   int imageWidth, 
   int imageHeight, 
   String^ mimeType, 
   int bitsPerPixel, 
   int qualityFactor, 
   String^ extraData 
) override  

Parameters

dicomFileName
The physical path of the DICOM file to extract the image from.

sopInstanceUID
The SOP Instance UID of the DICOM object.

frameNumber
A 1-based number of the frame you want to retrieve from the image. Pass 0 to get a representative frame and -1 to get the complete image with all frames.

imageWidth
The width, in pixels, of the image. The returned image can have a different width (to preserve scale ratio). Pass 0 to keep the original width.

imageHeight
The height, in pixels, of the image. The returned image can have a different height (to preserve scale ratio). Pass 0 to keep the original height.

mimeType
A System.String representing the file format and compression of the image. Check the Leadtools.Dicom.Services.DataTypes.SupportedImageFormat class for supported file formats and compression.

bitsPerPixel
Resulting image's pixel depth. Note that not all bits per pixel are available to all image formats. If bitsPerPixel is 0, the image will be stored using the original or closet bits/pixel value supported by that format.

qualityFactor
The quality factor (Q factor) is a number that determines the degree of loss in the compression process. Use 0 for Lossless compression. Valaid values range from 2 to 255, where 2 is the highest quality and 255 is the most compression.

extraData
User custom data.

Return Value

A buffer containing the image file (e.g. JPEG, TIFF).

Remarks

You should use a file format which supports multi pages if you set the frameNumber value to -1.

Only the TIFF file format supports multi pages so you can use SupportedImageFormat.Tiff, SupportedImageFormat.TiffJ2k or SupportedImageFormat.TiffJpeg in the mimeType.

The SOP Instance UID value of the retrieved DICOM object will be stored as a private Tag in the first image frame when using any of the TIFF file formats. To retrieve the private Tag from the first frame as an ASCII string, use the Tag ID 0X9C40 (40000)

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.