L_LTDIC_API pDICOMVR L_DicomInsertVR(nCode, pszName, nLength, nRestrict, nUnitSize)
Inserts a new item in the Value Representation Table.
Code that indicates the type of value to be stored in the data element. For a list of existing values refer to Value Representation Constants.
Character string that contains the name of the value representation. For examples of Value Representation Names, refer to the Default Value Representation Table.
The length of the value to be stored in the data element.
Restrictions on the length. Possible values are:
|VR_FIXED||[0x00] The length of the stored value is a fixed number of bytes.|
|VR_MAXIMUM||[0x01] nLength is the maximum number of bytes allowed.|
|VR_MAXIMUM_GROUP||[0x02] nLength is the maximum number of bytes allowed per component group|
|VR_ANY||[0x03] Any length is valid.|
|VR_NOT_APPLICABLE||[0x04] nLength is not applicable|
|VR_BINARY||[0x0100] Binary value.|
|VR_STRING||[0x0200] String value (The character '\' is used as the delimiter between values for multiple data elements).|
|VR_TEXT||[0x0400] Text value. (Data elements with this VR cannot be multi-valued).|
The size of the smallest item to be stored in the value field of the data element.
|!NULL||A pointer to a DICOMVR structure containing the newly inserted item.|
|NULL||Not enough memory to insert item.|
All items are inserted at the bottom of the table.
To see the default values for the Value Representation Table, refer to the Default Value Representation Table.
When evaluating nLength, you must also consider the values in nRestrict. If nRestrict contains VR_FIXED, then nLength is a fixed value. Therefore, the data stored in the value Field of a data element would have that length and nLength and nUnitSize would be equal.
If nRestrict contains VR_MAXIMUM, nLength is the maximum length of data that can be stored in the Value Field of a Data Element. In this case, nUnitSize would contain the minimum length of data to be stored in the Value Field of a Data Element.
For example, in the Default Value Representation Table, value representation VR_AE has the following default values:
Therefore, the Value Field of a Data Element that has a Value Representation of VR_AE can store between 1 and 16 bytes of string data.
Required DLLs and Libraries
Win32, x64, Linux.
This example inserts 2 new items in the VR table
pDICOMVR pTemp = NULL;
pTemp = L_DicomInsertVR(0x5858, TEXT("New XXX VR"), 16, VR_STRING | VR_MAXIMUM, 1);
if (pTemp == NULL)
pTemp = L_DicomInsertVR(0x5959, TEXT("New YYY VR"), 4, VR_TEXT | VR_FIXED, 1);
if (pTemp == NULL)
Medical Web Viewer .NET
.NET, Java, Android, and iOS/macOS Assemblies
C API/C++ Class Libraries