DCMTK  Version 3.6.1 20120515
OFFIS DICOM Toolkit
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
DcmTag Class Reference

this class encapsulates an attribute tag (group, element) and a VR. More...

+ Inheritance diagram for DcmTag:

List of all members.

Public Member Functions

 DcmTag ()
 default constructor
 DcmTag (const DcmTagKey &akey, const char *privCreator=NULL)
 constructor.
 DcmTag (Uint16 g, Uint16 e, const char *privCreator=NULL)
 constructor.
 DcmTag (const DcmTagKey &akey, const DcmVR &avr)
 constructor.
 DcmTag (Uint16 g, Uint16 e, const DcmVR &avr)
 constructor.
 DcmTag (const DcmTag &tag)
 copy constructor
 ~DcmTag ()
 destructor
DcmTagoperator= (const DcmTag &tag)
 copy assignment operator
DcmVR setVR (const DcmVR &avr)
 set specific VR
DcmVR getVR () const
 returns VR object by value
DcmEVR getEVR () const
 returns VR code
const char * getVRName () const
 returns name of VR
Uint16 getGTag () const
 returns tag group
Uint16 getETag () const
 returns tag element
DcmTagKey getXTag () const
 returns a copy of the tag key by value
const char * getTagName ()
 returns name of attribute tag.
const char * getPrivateCreator () const
 returns the current private creator string for this object if any, NULL otherwise.
void setPrivateCreator (const char *privCreator)
 assigns a private creator code and deletes a possibly cached attribute name since the attribute name could change if a different private creator code is used.
void lookupVRinDictionary ()
 performs a look-up of the VR for the current tag key in the dictionary, under consideration of the private creator (if defined).
OFBool isSignable () const
 returns true if a data element with the given tag and VR can be digitally signed, false otherwise
OFBool isUnknownVR () const
 returns true if the VR used for writing is "UN"
OFCondition error () const
 returns current status flag

Static Public Member Functions

static OFCondition findTagFromName (const char *name, DcmTag &value)
 convert the given string to a DICOM tag value

Private Member Functions

void updateTagName (const char *c)
 replace tagName with copy of given string
void updatePrivateCreator (const char *c)
 replace privateCreator with copy of given string

Private Attributes

DcmVR vr
 VR of this attribute tag.
char * tagName
 name of this attribute tag, remains NULL unless getTagName() is called
char * privateCreator
 private creator code, remains NULL unless setPrivateCreator() is called
OFCondition errorFlag
 current error code, EC_Normal if a valid VR for the tag is known

Detailed Description

this class encapsulates an attribute tag (group, element) and a VR.

It maintains a private creator name for private tags and caches the attribute name, once it is looked up in the data dictionary. This class maintains the interface to the DICOM data dictionary, i.e. performs look-ups of attribute VR and name in the background. Therefore, creation of DcmTag element is significantly more expensive than creation of simple DcmTagKey objects unless the VR is passed in the constructor.


Constructor & Destructor Documentation

DcmTag::DcmTag ( const DcmTagKey akey,
const char *  privCreator = NULL 
)

constructor.

Initializes group/element from given tag key and performs a dictionary lookup for the VR. The lookup also considers private tags if the private creator is defined (not NULL).

Parameters:
akeytag key
privCreatorprivate creator code (optional)
DcmTag::DcmTag ( Uint16  g,
Uint16  e,
const char *  privCreator = NULL 
)

constructor.

Initializes group/element from given parameters and performs a dictionary lookup for the VR. The lookup also considers private tags if the private creator is defined (not NULL).

Parameters:
gtag group
etag element
privCreatorprivate creator code (optional)
DcmTag::DcmTag ( const DcmTagKey akey,
const DcmVR avr 
)

constructor.

Initializes group/element and VR from given parameters. No dictionary lookup needed/performed.

Parameters:
akeytag key
avrVR
DcmTag::DcmTag ( Uint16  g,
Uint16  e,
const DcmVR avr 
)

constructor.

Initializes group/element and VR from given parameters. No dictionary lookup needed/performed.

Parameters:
gtag group
etag element
avrVR

Member Function Documentation

static OFCondition DcmTag::findTagFromName ( const char *  name,
DcmTag value 
) [static]

convert the given string to a DICOM tag value

Parameters:
namename or tag of the attribute to be searched for. If the name of the attribute is given the spelling has to be consistent with the spelling used in the data dictionary (e.g. "PatientName"). If the tag values are used the format is "gggg,eeee" (i.e. two hexa- decimal numbers separated by a comma).
valuevariable in which the resulting tag value is stored. If this functions fails to find the specified tag, this variable remains unchanged.
Returns:
status, EC_Normal upon success, an error code otherwise
Uint16 DcmTag::getETag ( ) const [inline]

returns tag element

Returns:
tag element
Uint16 DcmTag::getGTag ( ) const [inline]

returns tag group

Returns:
tag group
const char* DcmTag::getPrivateCreator ( ) const

returns the current private creator string for this object if any, NULL otherwise.

Returns:
creator code if present, NULL otherwise
const char* DcmTag::getTagName ( )

returns name of attribute tag.

If name has not been accessed before, a dictionary lookup under consideration of the current private creator code is performed. If no attribute name is found, a default name is used. Never returns NULL.

Returns:
attribute tag name, never NULL.
DcmTagKey DcmTag::getXTag ( ) const [inline]

returns a copy of the tag key by value

Returns:
copy of tag key, by value
OFBool DcmTag::isSignable ( ) const

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

Returns:
true if signable, false otherwise

performs a look-up of the VR for the current tag key in the dictionary, under consideration of the private creator (if defined).

If a dictionary entry is found, the VR of this object is copied from the dictionary entry, otherwise the VR remains unmodified.

void DcmTag::setPrivateCreator ( const char *  privCreator)

assigns a private creator code and deletes a possibly cached attribute name since the attribute name could change if a different private creator code is used.

Parameters:
privCreatorprivate creator code, may be NULL
void DcmTag::updatePrivateCreator ( const char *  c) [private]

replace privateCreator with copy of given string

Parameters:
cnew private creator
void DcmTag::updateTagName ( const char *  c) [private]

replace tagName with copy of given string

Parameters:
cnew tag name

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


Generated on Tue May 15 2012 for DCMTK Version 3.6.1 20120515 by Doxygen 1.7.5.1-20111027