DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Attributes | List of all members
DcmVR Class Reference

a class representing a DICOM Value Representation More...

## Public Member Functions
| DcmVR ()
| default constructor
| DcmVR (DcmEVR evr)
| constructor More...
| DcmVR (const char *vrName)
| constructor. More...
| DcmVR (const DcmVR &avr)
| copy constructor More...
void | setVR (DcmEVR evr)
| assign new VR value More...
void | setVR (const char *vrName)
| assign new VR value by name. More...
void | setVR (const DcmVR &avr)
| assign new VR value More...
DcmVR & | operator= (const DcmVR &arg)
| copy assignment operator More...
DcmEVR | getEVR () const
| get enumerated VR managed by this object More...
DcmEVR | getValidEVR () const
| get enumerated standard VR managed by this object. More...
const char * | getVRName () const
| get symbolic VR name for this object More...
const char * | getValidVRName () const
| get symbolic standard VR name for this object. More...
size_t | getValueWidth () const
| compute the size for non-empty values of this VR. More...
OFBool | isInvalid () const
| returns true if VR is invalid, i.e. EVR_invalid More...
OFBool | isUnknown () const
| returns true if VR is unknown, i.e. EVR_UNKNOWN or EVR_UNKNOWN2B More...
OFBool | isStandard () const
| returns true if VR is a standard DICOM VR More...
OFBool | isForInternalUseOnly () const
| returns true if VR is for internal use only More...
OFBool | isaString () const
| returns true if VR represents a string. More...
OFBool | isaNumber () const
| returns true if VR represents a number (either encoded as a string or in binary format). More...
OFBool | isInteger () const
| returns true if VR represents an integer number (either encoded as a string or in binary format). More...
OFBool | isUnsigned () const
| returns true if VR represents an unsigned number (either encoded as a string or in binary format). More...
OFBool | usesExtendedLengthEncoding () const
| returns true if VR uses an extended length encoding for explicit transfer syntaxes More...
OFBool | supportsUndefinedLength () const
| returns true if VR supports undefined length for the value length field and a sequence delimitation item marks the end of the value field More...
OFBool | isEquivalent (const DcmVR &avr) const
| check if VRs are equivalent. More...
Uint32 | getMinValueLength () const
| return minimum length of a single value with this VR. More...
Uint32 | getMaxValueLength () const
| return maximum length of a single value with this VR. More...
OFBool | isAffectedBySpecificCharacterSet () const
| return whether elements of this VR are affected by SpecificCharacterSet More...
const OFString & | getDelimiterChars () const
| retrieve delimiter characters to be used for character set conversion (to switch back to the default character set in case code extension techniques like ISO 2022 are used). More...
OFBool | isLengthInChar () const
| check whether the maximum or minimum length of a value with this VR is in bytes or characters. More...

## Private Attributes
DcmEVR | vr
| the enumerated VR value

## Detailed Description

a class representing a DICOM Value Representation

## Constructor & Destructor Documentation

## ◆ DcmVR() [1/3]

DcmVR::DcmVR | ( | DcmEVR | evr | ) |
| inline

constructor

Parameters

  evr | enumerated VR value

## ◆ DcmVR() [2/3]

DcmVR::DcmVR | ( | const char * | vrName | ) |
| inline

constructor.

Please note that only the first two characters of the passed string are actually checked. Value Representations that are labeled for internal use only are mapped to an unknown VR. See setVR() for more details.

Parameters

  vrName | symbolic name of value representation

## ◆ DcmVR() [3/3]

DcmVR::DcmVR | ( | const DcmVR & | avr | ) |
| inline

copy constructor

Parameters

  avr | VR value

## Member Function Documentation

## ◆ getDelimiterChars()

const OFString& DcmVR::getDelimiterChars | ( |  | ) | const

retrieve delimiter characters to be used for character set conversion (to switch back to the default character set in case code extension techniques like ISO 2022 are used).

Returns
  a reference to an OFString containing the delimiter characters for this VR or a reference to an empty OFString.

## ◆ getEVR()

DcmEVR DcmVR::getEVR | ( |  | ) | const
| inline

get enumerated VR managed by this object

Returns
  enumerated VR

## ◆ getMaxValueLength()

Uint32 DcmVR::getMaxValueLength | ( |  | ) | const

return maximum length of a single value with this VR.

Whether the returned length is in bytes or characters can be determined by isLengthInChar().

Returns
  maximum length of a value

## ◆ getMinValueLength()

Uint32 DcmVR::getMinValueLength | ( |  | ) | const

return minimum length of a single value with this VR.

Whether the returned length is in bytes or characters can be determined by isLengthInChar().

Returns
  minimum length of a value

## ◆ getValidEVR()

DcmEVR DcmVR::getValidEVR | ( |  | ) | const

get enumerated standard VR managed by this object.

If this object manages a non-standard, internal VR such as EVR_ox, this method returns the enumerated VR to which the internal VR will be mapped when writing the DICOM object.

Please note that some VR, e.g. EVR_pixelItem, won't be written as EVR_UNKNOWN, although this method will return that value for them. This means that e.g. usesExtendedLengthEncoding() for the returned VR might not be correct.

Also note that DcmItem::checkAndUpdateVR() will in some cases influence the VR that is written out.

Returns
  enumerated VR

## ◆ getValidVRName()

const char* DcmVR::getValidVRName | ( |  | ) | const

get symbolic standard VR name for this object.

If this object manages a non-standard, internal VR such as EVR_ox, this method returns the name of the VR to which the internal VR will be mapped when writing the DICOM object.

Returns
  VR name string, never NULL

## ◆ getValueWidth()

size_t DcmVR::getValueWidth | ( |  | ) | const

compute the size for non-empty values of this VR.

For fixed size VRs such as OW, US, SL, the method returns the size of each value, in bytes. For variable length VRs (strings), it returns 1. For internal VRs it returns 0.

Returns
  size of values of this VR

## ◆ getVRName()

const char* DcmVR::getVRName | ( |  | ) | const

get symbolic VR name for this object

Returns
  VR name string, never NULL

## ◆ isAffectedBySpecificCharacterSet()

OFBool DcmVR::isAffectedBySpecificCharacterSet | ( |  | ) | const

return whether elements of this VR are affected by SpecificCharacterSet

Returns
  true for the following VRs: PN, LO, LT, SH, ST, UC and UT, false for all others.

## ◆ isaNumber()

OFBool DcmVR::isaNumber | ( |  | ) | const

returns true if VR represents a number (either encoded as a string or in binary format).

Note
  This method is only applicable to standard DICOM VRs.

Returns
  true if VR represents a number, false otherwise

## ◆ isaString()

OFBool DcmVR::isaString | ( |  | ) | const

returns true if VR represents a string.

Note
  This method is only applicable to standard DICOM VRs.

Returns
  true if VR represents a string, false otherwise

## ◆ isEquivalent()

OFBool DcmVR::isEquivalent | ( | const DcmVR & | avr | ) | const

check if VRs are equivalent.

VRs are considered equivalent if equal or if one of them is an internal VR and the other one is a possible standard VR to which the internal one maps.

Parameters

  avr | VR to compare with

Returns
  true if VRs are equivalent, false otherwise

## ◆ isForInternalUseOnly()

OFBool DcmVR::isForInternalUseOnly | ( |  | ) | const

returns true if VR is for internal use only

Returns
  true if VR is for internal use only, false otherwise

## ◆ isInteger()

OFBool DcmVR::isInteger | ( |  | ) | const

returns true if VR represents an integer number (either encoded as a string or in binary format).

Note
  This method is only applicable to standard DICOM VRs.

Returns
  true if VR represents an integer number, false otherwise

## ◆ isInvalid()

OFBool DcmVR::isInvalid | ( |  | ) | const

returns true if VR is invalid, i.e. EVR_invalid

Returns
  true if VR is invalid, false otherwise

## ◆ isLengthInChar()

OFBool DcmVR::isLengthInChar | ( |  | ) | const

check whether the maximum or minimum length of a value with this VR is in bytes or characters.

See getMinValueLength() and getMaxValueLength().

Returns
  true if length is stated in characters, false if in bytes

## ◆ isStandard()

OFBool DcmVR::isStandard | ( |  | ) | const

returns true if VR is a standard DICOM VR

Returns
  true if VR is a standard DICOM VR, false otherwise

## ◆ isUnknown()

OFBool DcmVR::isUnknown | ( |  | ) | const

returns true if VR is unknown, i.e. EVR_UNKNOWN or EVR_UNKNOWN2B

Returns
  true if VR is unknown, false otherwise

## ◆ isUnsigned()

OFBool DcmVR::isUnsigned | ( |  | ) | const

returns true if VR represents an unsigned number (either encoded as a string or in binary format).

Note
  This method is only applicable to standard DICOM VRs.

Returns
  true if VR represents an unsigned number, false otherwise

## ◆ operator=()

DcmVR& DcmVR::operator= | ( | const DcmVR & | arg | ) |
| inline

copy assignment operator

Parameters

  arg | vr to assign from

Returns
  reference to this object

References vr.

## ◆ setVR() [1/3]

void DcmVR::setVR | ( | const char * | vrName | ) |

assign new VR value by name.

Please note that only the first two characters of the passed string are actually checked. Value Representations that are labeled for internal use only are ignored, so they are mapped to an unknown VR. For unknown VRs consisting of two uppercase letters, extended length (4 bytes) is assumed, since it could be a new DICOM VR that is not yet supported. For other unknown VRs consisting of characters in the range of 32 to 127, a 2-byte length field is assumed. This also applies to a VR string of "??", which has been observed in the wild not to use extended length. All other VR strings are considered invalid.

Parameters

  vrName | symbolic name of value representation

## ◆ setVR() [2/3]

void DcmVR::setVR | ( | const DcmVR & | avr | ) |
| inline

assign new VR value

Parameters

  avr | VR value

References vr.

## ◆ setVR() [3/3]

void DcmVR::setVR | ( | DcmEVR | evr | ) |

assign new VR value

Parameters

  evr | enumerated VR value

## ◆ supportsUndefinedLength()

OFBool DcmVR::supportsUndefinedLength | ( |  | ) | const

returns true if VR supports undefined length for the value length field and a sequence delimitation item marks the end of the value field

Returns
  true if VR supports undefined length, false otherwise

## ◆ usesExtendedLengthEncoding()

OFBool DcmVR::usesExtendedLengthEncoding | ( |  | ) | const

returns true if VR uses an extended length encoding for explicit transfer syntaxes

Returns
  true if VR uses an extended length encoding for explicit transfer syntaxes, false otherwise

The documentation for this class was generated from the following file:

- dcmdata/include/dcmtk/dcmdata/dcvr.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1