Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

gdcm::DictEntry Class Reference

the DictEntry in an element contained by the Dict. It contains : -the key referenced by the DICOM norm or the constructor (for private keys) i.e. the Group number the Element number -the VR (Value Representation) -the VM (Value Multplicity) -the corresponding name in english More...

#include <gdcmDictEntry.h>

Inheritance diagram for gdcm::DictEntry:

gdcm::Base List of all members.

Public Member Functions

 DictEntry (uint16_t group, uint16_t elem, TagName const &vr=GDCM_UNKNOWN, TagName const &vm=GDCM_UNKNOWN, TagName const &name=GDCM_UNKNOWN)
 Constructor.

void Print (std::ostream &os=std::cout, std::string const &indent="")
 Prints an entry of the Dicom DictionaryEntry.

void SetVR (TagName const &vr)
 If-and only if-the V(alue) R(epresentation) \ is unset then overwrite it.

void SetVM (TagName const &vm)
 If-and only if-the V(alue) M(ultiplicity) \ is unset then overwrite it.

bool IsVRUnknown ()
 tells if the V(alue) R(epresentation) is known (?!)

bool IsVMUnknown ()
 tells if the V(alue) M(ultiplicity) is known (?!)

uint16_t GetGroup ()
 Returns the Dicom Group Number of the current DictEntry.

uint16_t GetElement ()
 Returns the Dicom Element Number of the current DictEntry.

const TagNameGetVR () const
 Returns the Dicom Value Representation of the current DictEntry.

void SetKey (TagName const &k)
 sets the key of the current DictEntry

const TagNameGetVM () const
 returns the VM field of the current DictEntry

const TagNameGetName () const
 Returns the Dicom Name of the current DictEntry e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010).

const TagNameGetKey () const
 Gets the key of the current DictEntry.

void SetPrintLevel (int level)
 Sets the print level for the Dicom Header Elements.

int GetPrintLevel ()
 Gets the print level for the Dicom Entries.


Static Public Member Functions

TagKey TranslateToKey (uint16_t group, uint16_t elem)
 concatenates 2 uint16_t (supposed to be a Dicom group number and a Dicom element number)


Protected Attributes

int PrintLevel
 Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.


Private Attributes

uint16_t Group
 DicomGroup number.

uint16_t Element
 DicomElement number.

TagName VR
 Value Representation i.e. some clue about the nature of the data represented e.g. "FD" short for "Floating Point Double"(see VR) "PN" short for "Person Name".

TagName VM
 Value Multiplicity (e.g. "1", "1-n", "6").

TagName Name
 e.g. "Patient's Name"

TagKey Key
 Redundant with (group, elem) but we add it for efficiency purpose.


Detailed Description

the DictEntry in an element contained by the Dict. It contains : -the key referenced by the DICOM norm or the constructor (for private keys) i.e. the Group number the Element number -the VR (Value Representation) -the VM (Value Multplicity) -the corresponding name in english

Definition at line 39 of file gdcmDictEntry.h.


Constructor & Destructor Documentation

gdcm::DictEntry::DictEntry uint16_t  group,
uint16_t  elem,
TagName const &  vr = GDCM_UNKNOWN,
TagName const &  vm = GDCM_UNKNOWN,
TagName const &  name = GDCM_UNKNOWN
 

Constructor.

Parameters:
group DICOM-Group Number
elem DICOM-Element Number
vr Value Representation
vm Value Mutlplicity
name description of the element

Definition at line 39 of file gdcmDictEntry.cxx.

References Key, Name, gdcm::TagName, TranslateToKey(), and VM.

00043 {
00044    Group   = group;
00045    Element = elem;
00046    VR      = vr;
00047    VM      = vm;
00048    Name    = name;
00049    Key     = TranslateToKey(group, elem);
00050 }


Member Function Documentation

uint16_t gdcm::DictEntry::GetElement  )  [inline]
 

Returns the Dicom Element Number of the current DictEntry.

Returns:
the Dicom Element Number

Definition at line 69 of file gdcmDictEntry.h.

Referenced by Print(), and gdcm::DocEntryArchive::Push().

00069 { return Element; }

uint16_t gdcm::DictEntry::GetGroup  )  [inline]
 

Returns the Dicom Group Number of the current DictEntry.

Returns:
the Dicom Group Number

Definition at line 65 of file gdcmDictEntry.h.

Referenced by Print(), and gdcm::DocEntryArchive::Push().

00065 { return Group; }

const TagName& gdcm::DictEntry::GetKey  )  const [inline]
 

Gets the key of the current DictEntry.

Returns:
the key.

Definition at line 91 of file gdcmDictEntry.h.

References gdcm::TagName.

Referenced by gdcm::Dict::AddEntry(), and gdcm::Dict::ReplaceEntry().

00091 { return Key; }

const TagName& gdcm::DictEntry::GetName  )  const [inline]
 

Returns the Dicom Name of the current DictEntry e.g. "Patient Name" for Dicom Tag (0x0010, 0x0010).

Returns:
the Dicom Name

Definition at line 87 of file gdcmDictEntry.h.

References gdcm::TagName.

Referenced by gdcm::DocEntrySet::GetDictEntry(), and Print().

00087 { return Name; } 

int gdcm::Base::GetPrintLevel  )  [inline, inherited]
 

Gets the print level for the Dicom Entries.

Definition at line 48 of file gdcmBase.h.

00048 { return PrintLevel; };

const TagName& gdcm::DictEntry::GetVM  )  const [inline]
 

returns the VM field of the current DictEntry

Returns:
The 'Value Multiplicity' field

Definition at line 82 of file gdcmDictEntry.h.

References gdcm::TagName.

00082 { return VM; } 

const TagName& gdcm::DictEntry::GetVR  )  const [inline]
 

Returns the Dicom Value Representation of the current DictEntry.

Returns:
the Dicom Value Representation

Definition at line 74 of file gdcmDictEntry.h.

References gdcm::TagName.

Referenced by gdcm::DocEntrySet::GetDictEntry(), Print(), and gdcm::Document::ReadNextDocEntry().

00074 { return VR; }

bool gdcm::DictEntry::IsVMUnknown  )  [inline]
 

tells if the V(alue) M(ultiplicity) is known (?!)

Returns:

Definition at line 61 of file gdcmDictEntry.h.

References gdcm::GDCM_UNKNOWN.

Referenced by SetVM().

00061 { return VM == GDCM_UNKNOWN; }

bool gdcm::DictEntry::IsVRUnknown  )  [inline]
 

tells if the V(alue) R(epresentation) is known (?!)

Returns:

Definition at line 57 of file gdcmDictEntry.h.

References gdcm::GDCM_UNKNOWN.

Referenced by SetVR().

00057 { return VR == GDCM_UNKNOWN; }

void gdcm::DictEntry::Print std::ostream &  os = std::cout,
std::string const &  indent = ""
[virtual]
 

Prints an entry of the Dicom DictionaryEntry.

Parameters:
os ostream we want to print in
indent Indentation string to be prepended during printing

Reimplemented from gdcm::Base.

Definition at line 113 of file gdcmDictEntry.cxx.

References gdcm::GDCM_UNKNOWN, GetElement(), GetGroup(), GetName(), and GetVR().

00114 {
00115    std::string vr;
00116    std::ostringstream s;
00117 
00118    vr = GetVR();
00119    if(vr==GDCM_UNKNOWN)
00120       vr="  ";
00121 
00122    s << DictEntry::TranslateToKey(GetGroup(),GetElement()); 
00123    s << " [" << vr  << "] ";
00124 
00125    if (PrintLevel >= 1)
00126    {
00127       s.setf(std::ios::left);
00128       s << std::setw(66-GetName().length()) << " ";
00129    }
00130 
00131    s << "[" << GetName()<< "]";
00132    os << s.str() << std::endl;
00133 }

void gdcm::DictEntry::SetKey TagName const &  k  )  [inline]
 

sets the key of the current DictEntry

Parameters:
k New key to be set.

Definition at line 78 of file gdcmDictEntry.h.

References gdcm::TagName.

00078 { Key = k; }

void gdcm::Base::SetPrintLevel int  level  )  [inline, inherited]
 

Sets the print level for the Dicom Header Elements.

Note:
0 for Light Print; 1 for 'medium' Print, 2 for Heavy

Definition at line 45 of file gdcmBase.h.

Referenced by gdcm::SQItem::Print(), gdcm::SeqEntry::Print(), gdcm::FileHelper::Print(), gdcm::ElementSet::Print(), and gdcm::DicomDir::Print().

00045 { PrintLevel = level; };

void gdcm::DictEntry::SetVM TagName const &  vm  ) 
 

If-and only if-the V(alue) M(ultiplicity) \ is unset then overwrite it.

Parameters:
vm New V(alue) M(ultiplicity) to be set.

Definition at line 76 of file gdcmDictEntry.cxx.

References gdcmErrorMacro, IsVMUnknown(), gdcm::TagName, and VM.

00077 {
00078    if ( IsVMUnknown() )
00079    {
00080       VM = vm;
00081    }
00082    else 
00083    {
00084       gdcmErrorMacro( "Overwriting VM might compromise a dictionary");
00085    }
00086 }

void gdcm::DictEntry::SetVR TagName const &  vr  ) 
 

If-and only if-the V(alue) R(epresentation) \ is unset then overwrite it.

Parameters:
vr New V(alue) R(epresentation) to be set.

Definition at line 59 of file gdcmDictEntry.cxx.

References gdcmErrorMacro, IsVRUnknown(), and gdcm::TagName.

00060 {
00061    if ( IsVRUnknown() )
00062    {
00063       VR = vr;
00064    }
00065    else 
00066    {
00067       gdcmErrorMacro( "Overwriting VR might compromise a dictionary");
00068    }
00069 }

TagKey gdcm::DictEntry::TranslateToKey uint16_t  group,
uint16_t  elem
[static]
 

concatenates 2 uint16_t (supposed to be a Dicom group number and a Dicom element number)

Parameters:
group the Dicom group number used to build the tag
elem the Dicom element number used to build the tag
Returns:
the built tag

Definition at line 95 of file gdcmDictEntry.cxx.

References gdcm::TagKey.

Referenced by DictEntry().

00096 {
00097    return Util::Format("%04x|%04x", group, elem);
00098 }


Member Data Documentation

uint16_t gdcm::DictEntry::Element [private]
 

DicomElement number.

Definition at line 109 of file gdcmDictEntry.h.

uint16_t gdcm::DictEntry::Group [private]
 

DicomGroup number.

Todo:
FIXME where are the group and elem used except from building up a TagKey. If the answer is nowhere then there is no need to store the group and elem independently.
--> EVERYWHERE ! The alternate question would be : What's TagKey used for ?

Definition at line 106 of file gdcmDictEntry.h.

TagKey gdcm::DictEntry::Key [private]
 

Redundant with (group, elem) but we add it for efficiency purpose.

Definition at line 172 of file gdcmDictEntry.h.

Referenced by DictEntry().

TagName gdcm::DictEntry::Name [private]
 

e.g. "Patient's Name"

Definition at line 169 of file gdcmDictEntry.h.

Referenced by DictEntry().

int gdcm::Base::PrintLevel [protected, inherited]
 

Amount of printed details for each Dicom Entries : 0 : stands for the least detail level.

Definition at line 53 of file gdcmBase.h.

Referenced by gdcm::Base::Base().

TagName gdcm::DictEntry::VM [private]
 

Value Multiplicity (e.g. "1", "1-n", "6").

Definition at line 166 of file gdcmDictEntry.h.

Referenced by DictEntry(), and SetVM().

TagName gdcm::DictEntry::VR [private]
 

Value Representation i.e. some clue about the nature of the data represented e.g. "FD" short for "Floating Point Double"(see VR) "PN" short for "Person Name".

Definition at line 115 of file gdcmDictEntry.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 10 22:18:07 2005 for gdcm by doxygen 1.3.6