DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
DcmTagKey Class Reference

class maintaining a attribute tag (group and element number) More...

+ Inheritance diagram for DcmTagKey:

Public Member Functions

 DcmTagKey ()
 default constructor
 
 DcmTagKey (const DcmTagKey &key)
 copy constructor More...
 
 DcmTagKey (Uint16 g, Uint16 e)
 constructor More...
 
virtual ~DcmTagKey ()
 destructor
 
void set (const DcmTagKey &key)
 set value to given tag key More...
 
void set (Uint16 g, Uint16 e)
 set value to given group and element More...
 
void setGroup (Uint16 g)
 set group to given number More...
 
void setElement (Uint16 e)
 set element to given number More...
 
Uint16 getGroup () const
 returns group number More...
 
Uint16 getElement () const
 returns element number More...
 
DcmTagKey getBaseTag () const
 returns base tag, i.e. More...
 
OFBool isGroupLength () const
 checks whether the tag key is a valid group length element. More...
 
OFBool isPrivate () const
 returns true if the tag key is private, i.e. More...
 
OFBool isPrivateReservation () const
 returns true, if tag is a private reservation tag of the form (gggg,00xx) with "gggg" being odd and "xx" in the range of 10 and FF. More...
 
OFBool hasValidGroup () const
 returns true, if group is valid (permitted in DICOM command or data sets). More...
 
Uint32 hash () const
 generate a simple hash code for this attribute tag. More...
 
DcmTagKeyoperator= (const DcmTagKey &key)
 assignment operator for initializing this tag key from an existing one More...
 
OFBool operator== (const DcmTagKey &key) const
 Comparison operator. More...
 
OFBool operator!= (const DcmTagKey &key) const
 negation operator. More...
 
OFBool operator< (const DcmTagKey &key) const
 'less than' operator. More...
 
OFBool operator> (const DcmTagKey &key) const
 'greater than' operator. More...
 
OFBool operator<= (const DcmTagKey &key) const
 'less or equal' operator. More...
 
OFBool operator>= (const DcmTagKey &key) const
 'greater or equal' operator. More...
 
OFString toString () const
 convert tag key to string having the form "(gggg,eeee)". More...
 
OFBool isSignableTag () const
 returns true if a data element with the given tag key can be digitally signed, false otherwise More...
 

Protected Member Functions

int groupLT (const DcmTagKey &key) const
 less-than operation comparing only group numbers More...
 
int groupGT (const DcmTagKey &key) const
 greater-than operation comparing only group numbers More...
 
int groupEQ (const DcmTagKey &key) const
 comparison operation comparing only group numbers More...
 
int elementLT (const DcmTagKey &key) const
 less-than operation comparing only element numbers More...
 
int elementGT (const DcmTagKey &key) const
 greater-than operation comparing only element numbers More...
 
int elementEQ (const DcmTagKey &key) const
 comparison operation comparing only element numbers More...
 

Private Attributes

Uint16 group
 tag group number
 
Uint16 element
 tag element number
 

Friends

DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream & operator<< (STD_NAMESPACE ostream &s, const DcmTagKey &k)
 stream output operator for tag keys More...
 

Detailed Description

class maintaining a attribute tag (group and element number)

Constructor & Destructor Documentation

◆ DcmTagKey() [1/2]

DcmTagKey::DcmTagKey ( const DcmTagKey key)
inline

copy constructor

Parameters
key[in] The tag key to initialize from

◆ DcmTagKey() [2/2]

DcmTagKey::DcmTagKey ( Uint16  g,
Uint16  e 
)
inline

constructor

Parameters
ggroup
eelement

Member Function Documentation

◆ elementEQ()

int DcmTagKey::elementEQ ( const DcmTagKey key) const
inlineprotected

comparison operation comparing only element numbers

Parameters
keythe object to compare to

References getElement().

Referenced by operator==().

◆ elementGT()

int DcmTagKey::elementGT ( const DcmTagKey key) const
inlineprotected

greater-than operation comparing only element numbers

Parameters
keythe object to compare to

References getElement().

Referenced by operator>().

◆ elementLT()

int DcmTagKey::elementLT ( const DcmTagKey key) const
inlineprotected

less-than operation comparing only element numbers

Parameters
keythe object to compare to

References getElement().

Referenced by operator<().

◆ getBaseTag()

DcmTagKey DcmTagKey::getBaseTag ( ) const

returns base tag, i.e.

in case of a repeating group tag always the base group number 0x5000 (curve) or 0x6000 (overlay) is used. For non-repeating group tags "this" tag key is returned.

Returns
returns the base tag of the tag key

◆ getElement()

Uint16 DcmTagKey::getElement ( ) const
inline

returns element number

Returns
returns the element number of the tag key

References element.

Referenced by elementEQ(), elementGT(), elementLT(), DcmTag::getETag(), hash(), and DcmDictEntry::isRepeatingElement().

◆ getGroup()

Uint16 DcmTagKey::getGroup ( ) const
inline

returns group number

Returns
returns the group number of the tag key

References group.

Referenced by DcmTag::getGTag(), groupEQ(), groupGT(), groupLT(), hash(), DcmDictEntry::isRepeatingGroup(), DcmDictEntry::setEQ(), and DcmDictEntry::subset().

◆ groupEQ()

int DcmTagKey::groupEQ ( const DcmTagKey key) const
inlineprotected

comparison operation comparing only group numbers

Parameters
keythe object to compare to

References getGroup().

Referenced by operator<(), operator==(), and operator>().

◆ groupGT()

int DcmTagKey::groupGT ( const DcmTagKey key) const
inlineprotected

greater-than operation comparing only group numbers

Parameters
keythe object to compare to

References getGroup().

Referenced by operator>().

◆ groupLT()

int DcmTagKey::groupLT ( const DcmTagKey key) const
inlineprotected

less-than operation comparing only group numbers

Parameters
keythe object to compare to

References getGroup().

Referenced by operator<().

◆ hash()

Uint32 DcmTagKey::hash ( ) const
inline

generate a simple hash code for this attribute tag.

Used for fast look-up in the DICOM dictionary.

Returns
hash code for this tag

References getElement(), and getGroup().

◆ hasValidGroup()

OFBool DcmTagKey::hasValidGroup ( ) const
inline

returns true, if group is valid (permitted in DICOM command or data sets).

Referring to the standard, groups 1, 3, 5, 7 and 0xFFFF are illegal.

Returns
returns OFTrue if tag key has a valid group number.

References group.

Referenced by isGroupLength(), and isPrivate().

◆ isGroupLength()

OFBool DcmTagKey::isGroupLength ( ) const
inline

checks whether the tag key is a valid group length element.

Also calls hasValidGroup().

Returns
returns OFTrue if tag key is a valid group length element

References element, and hasValidGroup().

◆ isPrivate()

OFBool DcmTagKey::isPrivate ( ) const
inline

returns true if the tag key is private, i.e.

whether it has an odd group number. Also hasValidGroup() is called.

Returns
returns OFTrue if group is private and valid.

References group, and hasValidGroup().

Referenced by isPrivateReservation().

◆ isPrivateReservation()

OFBool DcmTagKey::isPrivateReservation ( ) const
inline

returns true, if tag is a private reservation tag of the form (gggg,00xx) with "gggg" being odd and "xx" in the range of 10 and FF.

Returns
returns OFTrue if tag key is a private reservation key

References element, and isPrivate().

◆ isSignableTag()

OFBool DcmTagKey::isSignableTag ( ) const

returns true if a data element with the given tag key can be digitally signed, false otherwise

Returns
true if signable, false otherwise

◆ operator!=()

OFBool DcmTagKey::operator!= ( const DcmTagKey key) const
inline

negation operator.

Returns true if either group or element number are not the same.

Parameters
keykey to compare with
Returns
true if tag keys are not the same

◆ operator<()

OFBool DcmTagKey::operator< ( const DcmTagKey key) const
inline

'less than' operator.

Returns true if the given tag key is greater than "this".

Parameters
keykey to compare with
Returns
true if given key is greater than "this"

References elementLT(), groupEQ(), and groupLT().

◆ operator<=()

OFBool DcmTagKey::operator<= ( const DcmTagKey key) const
inline

'less or equal' operator.

Returns true if the given tag key is greater or the same as "this".

Parameters
keykey to compare with
Returns
true if given key is greater or the same as "this"

◆ operator=()

DcmTagKey & DcmTagKey::operator= ( const DcmTagKey key)
inline

assignment operator for initializing this tag key from an existing one

Parameters
key[in] The key to copy from
Returns
"this" initialization

References set().

◆ operator==()

OFBool DcmTagKey::operator== ( const DcmTagKey key) const
inline

Comparison operator.

Returns true if both group and element number are the same.

Parameters
keykey to compare with
Returns
true if tag keys are the same

References elementEQ(), and groupEQ().

◆ operator>()

OFBool DcmTagKey::operator> ( const DcmTagKey key) const
inline

'greater than' operator.

Returns true if the given tag key is smaller than "this".

Parameters
keykey to compare with
Returns
true if "this" key is smaller than given one.

References elementGT(), groupEQ(), and groupGT().

◆ operator>=()

OFBool DcmTagKey::operator>= ( const DcmTagKey key) const
inline

'greater or equal' operator.

Returns true if the given tag key is smaller or equal as "this".

Parameters
keykey to compare with
Returns
true if "this" key is smaller or equal to given one.

◆ set() [1/2]

void DcmTagKey::set ( const DcmTagKey key)
inline

set value to given tag key

Parameters
keyattribute tag to copy

References element, and group.

Referenced by operator=().

◆ set() [2/2]

void DcmTagKey::set ( Uint16  g,
Uint16  e 
)
inline

set value to given group and element

Parameters
ggroup
eelement

References element, and group.

◆ setElement()

void DcmTagKey::setElement ( Uint16  e)
inline

set element to given number

Parameters
eelement

References element.

◆ setGroup()

void DcmTagKey::setGroup ( Uint16  g)
inline

set group to given number

Parameters
ggroup

References group.

◆ toString()

OFString DcmTagKey::toString ( ) const

convert tag key to string having the form "(gggg,eeee)".

Returns
the string representation of this tag key

Related Definitions

◆ operator<<

DCMTK_DCMDATA_EXPORT STD_NAMESPACE ostream& operator<< ( STD_NAMESPACE ostream &  s,
const DcmTagKey k 
)
friend

stream output operator for tag keys

Parameters
soutput stream
ktag key
Returns
reference to output stream

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


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1