LDicomDS::ChangeTransferSyntax

#include "Ltdic.h"

L_UINT16 LDicomDS::ChangeTransferSyntax(pszUID, nQFactor, uFlags)

L_TCHAR * pszUID;

/* character string */

L_INT32 nQFactor;

/* quality factor */

L_UINT32 uFlags;

/* reserved */

Changes the transfer syntax of the data set.

Parameter

Description

pszUID

Character string that contains the UID of the new Transfer Syntax. Possible values are:

 

Value

Meaning

 

UID_IMPLICIT_VR_LITTLE_ENDIAN

"1.2.840.10008.1.2"

 

UID_EXPLICIT_VR_LITTLE_ENDIAN

"1.2.840.10008.1.2.1"

 

UID_EXPLICIT_VR_BIG_ENDIAN

"1.2.840.10008.1.2.2"

 

UID_JPEG_BASELINE_1

"1.2.840.10008.1.2.4.50"

 

UID_JPEG_EXTENDED_2_4

"1.2.840.10008.1.2.4.51"

 

UID_JPEG_LOSSLESS_NONHIER_14

"1.2.840.10008.1.2.4.57"

 

UID_JPEG_LOSSLESS_NONHIER_14B

"1.2.840.10008.1.2.4.70"

 

UID_JPEG2000_LOSSLESS_ONLY

"1.2.840.10008.1.2.4.90"

 

UID_JPEG2000

"1.2.840.10008.1.2.4.91"

 

UID_RLE_LOSSLESS

"1.2.840.10008.1.2.5"

nQFactor

The quality factor (Q factor) is a number that determines the degree of loss in the compression process. You can set a value from 2 to 255, where 2 is the highest quality and 255 is the most compression. This parameter only applies when the new transfer syntax will involve compressing pixel data using a lossy compression.

uFlags

Flag that indicates how the compression will be performed. Possible values are:

 

Value

Meaning

 

DICOM_CHANGETRAN_MINIMIZE_JPEG_SIZE

[0x00000001] If set, and the new transfer syntax uses JPEG compression, the JPEG compression engine will use optimized Huffman tables, which results in better compression, but slower speed.

Returns

0

SUCCESS

>0

An error occurred. Refer to Return Codes.

Comments

This function will convert the data set's transfer syntax to the transfer syntax specified in pszUID, maintaining all elements and values in the data set.

After this function is called all previous references to data elements in the data set will no longer be valid.

This function is especially useful when sending a C_STORE_REQ message using the LDicomNet::SendCStoreRequest function. The user can match the data set transfer syntax with the transfer syntax of the SCP.

Required DLLs and Libraries

LTDIC

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application

See Also

Functions:

LDicomNet::SendCStoreRequest, Class Members

Topics:

Working with Data Sets

 

How to Disable the Automatic Loading of the default DICOM IOD Table

Example

L_INT LDicomDS_ChangeTransferSyntaxExample()
{
   L_INT       nRet;
   LDicomDS*   pDS;
   pDS = new LDicomDS(NULL);
   nRet = pDS->LoadDS(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\image1.dic"), 0);
   if(nRet != DICOM_SUCCESS)
      return nRet;
   // Change transfer syntax to explicit VR Big Endian
   nRet = pDS->ChangeTransferSyntax(UID_EXPLICIT_VR_BIG_ENDIAN,0,0);
   if(nRet != DICOM_SUCCESS)
      return nRet;
   // Save the new dataset
   nRet = pDS->SaveDS(TEXT("%UserProfile%\\My Documents\\LEADTOOLS Images\\temp.dic"), 0);
   if(nRet != DICOM_SUCCESS)
      return nRet;
   delete pDS;
   return DICOM_SUCCESS;
}