InsertVR method

Delphi example

C++Builder example

 

Builder Syntax

int __fastcall InsertVR(Word nCode, System::AnsiString sName, Cardinal uLength, Word nRestrict, Word nUnitSize);

Delphi Syntax

function InsertVR(nCode: Word; sName: String; uLength: Cardinal; nRestrict, nUnitSize: Word): Integer;

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

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

uLength

16

nRestrict

VR_STRING OR 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

Functions:

DeleteVR method, ResetVR method, DefaultVR method