LEADTOOLS Medical (Leadtools.MedicalWebViewer.DICOMObjectRetrieve assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.25
GetPreCompressedImage Method
See Also 
Leadtools.Dicom.Services.MedicalWebViewer Namespace > MedicalWebViewerObjectRetrieve Class : GetPreCompressedImage Method



dicomFileName
The physical path of the DICOM file containing the image.
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 full image with all frames.
imageWidth
The width, in pixels, of the image. The returned image might have different width to preserve scale ratio. Pass 0 to keep the original width.
imageHeight
The Height, in pixels, of the image. The returned image might have 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 or you can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression.
codec
An initialized Leadtools.Codecs.RasterCodecs object to be used for loading the pre-compressed image or retrieving its information.

The GetPreCompressedImage Method is available as an add-on to the LEADTOOLS Medical Imaging toolkits.

dicomFileName
The physical path of the DICOM file containing the image.
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 full image with all frames.
imageWidth
The width, in pixels, of the image. The returned image might have different width to preserve scale ratio. Pass 0 to keep the original width.
imageHeight
The Height, in pixels, of the image. The returned image might have 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 or you can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression.
codec
An initialized Leadtools.Codecs.RasterCodecs object to be used for loading the pre-compressed image or retrieving its information.
Gets a pre-compressed image for a DICOM object with the specified compression options.

Syntax

Visual Basic (Declaration) 
Protected Overridable Function GetPreCompressedImage( _
   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 codec As RasterCodecs _
) As Byte()
Visual Basic (Usage)Copy Code
Dim instance As MedicalWebViewerObjectRetrieve
Dim dicomFileName As String
Dim sopInstanceUID As String
Dim frameNumber As Integer
Dim imageWidth As Integer
Dim imageHeight As Integer
Dim mimeType As String
Dim bitsPerPixel As Integer
Dim qualityFactor As Integer
Dim codec As RasterCodecs
Dim value() As Byte
 
value = instance.GetPreCompressedImage(dicomFileName, sopInstanceUID, frameNumber, imageWidth, imageHeight, mimeType, bitsPerPixel, qualityFactor, codec)
C# 
protected virtual byte[] GetPreCompressedImage( 
   string dicomFileName,
   string sopInstanceUID,
   int frameNumber,
   int imageWidth,
   int imageHeight,
   string mimeType,
   int bitsPerPixel,
   int qualityFactor,
   RasterCodecs codec
)
C++/CLI 
protected:
virtual array<byte>^ GetPreCompressedImage( 
   String^ dicomFileName,
   String^ sopInstanceUID,
   int frameNumber,
   int imageWidth,
   int imageHeight,
   String^ mimeType,
   int bitsPerPixel,
   int qualityFactor,
   RasterCodecs^ codec
) 

Parameters

dicomFileName
The physical path of the DICOM file containing the image.
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 full image with all frames.
imageWidth
The width, in pixels, of the image. The returned image might have different width to preserve scale ratio. Pass 0 to keep the original width.
imageHeight
The Height, in pixels, of the image. The returned image might have 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 or you can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression.
codec
An initialized Leadtools.Codecs.RasterCodecs object to be used for loading the pre-compressed image or retrieving its information.

Return Value

A buffer containing the pre-compressed Leadtools.RasterImage. If no pre-compressed image is available null value will be returned.

Remarks

Note to developers: override this method to provide your own method of retrieving the pre-compressed images. Also this method will be called before loading any image from the DoGetSeriesImages and DoGetImage methods to check if there exists a pre-compressed image.

Requirements

Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also