InsertVR method (ILEADDicomDS)

VB.NET example

C# example

Visual Basic example

Visual C++ 6.0 example

 

Syntax

short InsertVR ( short nCode, BSTR pszName, long lLength, short nRestrict, short nUnitSize );

Overview

Refer to Working with Value Representations.

Remarks

Inserts a new item in the Value Representation Table. If successful, it sets the CurrentVR property to the new item. The value specified by nCode must be unique.

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 lLength, you must also consider the values in nRestrict. If nRestrict contains VR_FIXED, then lLength is a fixed value. Therefore, the data stored in the value Field of a data element would have that length and lLength and nUnitSize would be equal.

If nRestrict contains VR_MAXIMUM, lLength 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:

lLength

16

nRestrict

VR_STRING|VR_MAXIMUM

nUnitSize

1

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.

For more information on the structure of the DICOM file format, refer to An Overview of Dicom or the DICOM Spec.

See Also

Elements:

DeleteVR method, ResetVR method, DefaultVR method

Topics:

Value Representations: Inserting and Deleting Value Representations