ImageGear for C and C++ on Windows v19.10 - Updated
Write Data Elements
User Guide > How to Work with... > Formats with Additional Functionality > DICOM > DICOM Metadata > Write Data Elements

The following API functions allow you to write or overwrite the data of a Data field, respectively:

Function Description
MED_DCM_DS_DE_insert() Inserts a new DE to the Data Set. Its placement are determined automatically according to its Tag value. Your only power of placement is in specifying what level in the hierarchy of the Data Set to place the new DE.
MED_DCM_DS_curr_data_set() Overwrites the Data Field of an existing Data Element.

Whether you are inserting or overwriting a Data Element, given a specified tag (see enumIGMedTag) you may need to query the VR (Value Representation; data type of the tag) and VM (Value Multiplicity; number of items in the tag) by calling MED_DCM_util_tag_info_get().

With the data type (VR), MED_DCM_util_VR_info_mode() can return the length that each item can have, and whether the items are of fixed or variable length.

Part 10 Header Access

Access to the values in the Part 10 Template is done using a small set of methods or functions, which include either "Part10" or "preamble" in their names.

Function Description
MED_DCM_DS_preamble_get() Get Part 10 Header Preamble
MED_DCM_DS_preamble_set() Set Part 10 Header Preamble
MED_DCM_DS_part10_get() Get Part 10 Header Data Elements, except Preamble
MED_DCM_DS_part10_set() Set Part 10 Header Data Elements, except Preamble

See DICOM Data Structures for detailed information and usage of the preamble functions and writing data.