ImageGear for C and C++ on Linux v19.10 - Updated
MED_DCM_util_data_to_string
API Reference Guide > MD Component API Reference > MD Component Functions Reference > Utility Functions > MED_DCM_util_data_to_string

This function takes the DICOM Data Field of the Current Data Element, designated in lpData, and converts it to a NULL-terminated character string.

Declaration:

 
Copy Code
BOOL ACCUAPI MED_DCM_util_data_to_string(
        const LPCHAR lpData, 
        const AT_DCM_VR vr, 
        const AT_DCM_VL vl, 
        const INT first_item, 
        const INT last_item, 
        LPCHAR lpString, 
        const DWORD string_len, 
        const CHAR separator
);

Arguments:

Name Type Description
lpData const LPCHAR A far pointer to the data from a Data Element which you would like to convert to a string.
vr const AT_DCM_VR Set to the Value Representation (VR) for the Data. See enumIGMedVR for possible VR values.
vl const AT_DCM_VL Set to the Value Length of the Data.
first_item const INT First data value to process. Set to -1 to process all values.
last_item const INT Data value to stop processing at. This argument is only effective if first_item is not set to -1. If first_item is 0, set this argument to the number of values you'd like to process.
lpString LPCHAR A far pointer to a NULL-terminated string which returns the representation of the DICOM data field specified in lpData.
string_len const DWORD Set this to the length in bytes of lpString. If the length is shorter than the data being retrieved, it will simply truncate the data.
separator const CHAR Set this to the character that you would like to use to separate multiple data values; for example, you might set it to a comma or semicolon.

Return Value:

Returns the number of ImageGear errors that occurred during the function call.

Supported Raster Image Formats:

This function does not process image pixels.

Remarks:

Set the vr argument to determine how the lpData is to be interpreted.

lpString can only be filled up to string_len - 1. 1 is subtracted from the string_len to accommodate the NULL. Any remainder is simply clipped.

For Data Fields with more than one data value, the separator character specified in separator is used to delimit the items.