GDCM_NAME_SPACE::DictGroupName Class Reference

Container for dicom 'Group Name' Hash Table. (formerly NIH defined ACR-NEMA group name). More...

#include <gdcmDictGroupName.h>

Inheritance diagram for GDCM_NAME_SPACE::DictGroupName:

Inheritance graph
[legend]
Collaboration diagram for GDCM_NAME_SPACE::DictGroupName:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual void Print (std::ostream &os=std::cout, std::string const &indent="")
 Print all.
const TagNameGetName (uint16_t group)
void Delete ()
 Delete the object.
void Register ()
 Register the object.
void Unregister ()
 Unregister the object.
const unsigned long & GetRefCount () const
 Get the reference counting.
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

static DictGroupNameNew ()

Protected Member Functions

 DictGroupName ()
 Constructor.
 ~DictGroupName ()
 Destructor.

Protected Attributes

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

Private Member Functions

 gdcmTypeMacro (DictGroupName)

Private Attributes

DictGroupNameHT groupName

Detailed Description

Container for dicom 'Group Name' Hash Table. (formerly NIH defined ACR-NEMA group name).

Note:
This is a singleton.

Definition at line 41 of file gdcmDictGroupName.h.


Constructor & Destructor Documentation

GDCM_NAME_SPACE::DictGroupName::DictGroupName  )  [protected]
 

Constructor.

Definition at line 40 of file gdcmDictGroupName.cxx.

References GDCM_NAME_SPACE::DictSet::BuildDictPath(), DICT_GROUP_NAME, GDCM_NAME_SPACE::FillDefaultDictGroupName(), gdcmWarningMacro, and groupName.

00041 {
00042    std::string filename = DictSet::BuildDictPath() + DICT_GROUP_NAME;
00043    std::ifstream from(filename.c_str());
00044    if ( !from )
00045    {
00046       gdcmWarningMacro("Can't open dictionary" << filename.c_str());
00047       FillDefaultDictGroupName(groupName);
00048    }
00049    else
00050    {
00051       char buff[1024];
00052       uint16_t key;
00053       TagName value;
00054    
00055       while (!from.eof()) 
00056       {
00057          from >> std::ws;
00058          from >> std::hex;
00059          from >> key;
00060          from >> std::ws;
00061          from.getline(buff, 1024, '"');
00062          from.getline(buff, 1024, '"');
00063          value = buff;
00064          if ( !from.eof() )
00065             groupName[key] = value;
00066 
00067          from.getline(buff, 1024, '\n');
00068       }
00069       from.close();
00070    }
00071 }

GDCM_NAME_SPACE::DictGroupName::~DictGroupName  )  [protected]
 

Destructor.

Definition at line 76 of file gdcmDictGroupName.cxx.

References groupName.

00077 {
00078    groupName.clear();
00079 }


Member Function Documentation

void GDCM_NAME_SPACE::RefCounter::Delete  )  [inline, inherited]
 

Delete the object.

Remarks:
The object is deleted only if its reference counting is to zero

Definition at line 41 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SerieHelper::AddFileName(), GDCM_NAME_SPACE::Document::Backtrack(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryElements(), GDCM_NAME_SPACE::FileHelper::CheckMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::CopyMandatoryEntry(), GDCM_NAME_SPACE::Dict::DoTheLoadingJob(), GDCM_NAME_SPACE::FillDefaultDataDict(), GDCM_NAME_SPACE::DicomDirObject::FillObject(), vtkGdcmReader::GetFileInformation(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryBinArea(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::DocEntrySet::InsertSeqEntry(), vtkGdcmReader::LoadFileInformation(), GDCM_NAME_SPACE::DicomDir::NewMeta(), GDCM_NAME_SPACE::DicomDirStudy::NewVisit(), GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::DicomDir::SetElement(), GDCM_NAME_SPACE::FileHelper::SetMandatoryEntry(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToExplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToImplicitVR(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG(), GDCM_NAME_SPACE::FileHelper::SetWriteFileTypeToJPEG2000(), GDCM_NAME_SPACE::FileHelper::SetWriteToLibido(), GDCM_NAME_SPACE::DicomDir::~DicomDir(), GDCM_NAME_SPACE::DictSet::~DictSet(), and GDCM_NAME_SPACE::Global::~Global().

00041 { Unregister(); }

GDCM_NAME_SPACE::DictGroupName::gdcmTypeMacro DictGroupName   )  [private]
 

const TagName & GDCM_NAME_SPACE::DictGroupName::GetName uint16_t  group  ) 
 

Returns:
the formerly NIH defined ACR-NEMA group name

Definition at line 84 of file gdcmDictGroupName.cxx.

References GDCM_NAME_SPACE::GDCM_UNFOUND, and groupName.

00085 {
00086    DictGroupNameHT::const_iterator it = groupName.find(group);
00087    if ( it == groupName.end() )
00088    {
00089       return GDCM_UNFOUND;
00090    }
00091    return it->second;
00092 }

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

Gets the print level for the Dicom Entries.

Definition at line 50 of file gdcmBase.h.

00050 { return PrintLevel; }

const unsigned long& GDCM_NAME_SPACE::RefCounter::GetRefCount  )  const [inline, inherited]
 

Get the reference counting.

Returns:
Reference count

Definition at line 59 of file gdcmRefCounter.h.

00060    {
00061       return RefCount;
00062    }

static DictGroupName* GDCM_NAME_SPACE::DictGroupName::New  )  [inline, static]
 

Definition at line 46 of file gdcmDictGroupName.h.

Referenced by GDCM_NAME_SPACE::Global::Global().

00046 {return new DictGroupName();}

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

Print all.

Parameters:
os The output stream to be written to.

Reimplemented from GDCM_NAME_SPACE::Base.

Definition at line 106 of file gdcmDictGroupName.cxx.

References groupName.

00107 {
00108    std::ostringstream s;
00109 
00110    for (DictGroupNameHT::iterator it = groupName.begin(); it != groupName.end(); ++it)
00111    {
00112       s << "DictGroupName : 0x" << std::hex << std::setw(4) << it->first 
00113         << std::dec << " = " << it->second << std::endl;
00114    }
00115    os << s.str();
00116 }

void GDCM_NAME_SPACE::RefCounter::Register  )  [inline, inherited]
 

Register the object.

Remarks:
It increments the reference counting

Definition at line 46 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::SQItem::AddEntry(), GDCM_NAME_SPACE::SeqEntry::AddSQItem(), GDCM_NAME_SPACE::SeqEntry::Copy(), GDCM_NAME_SPACE::DicomDir::Copy(), GDCM_NAME_SPACE::FileHelper::FileHelper(), GDCM_NAME_SPACE::DocEntrySet::GetDictEntry(), GDCM_NAME_SPACE::DocEntry::GetName(), GDCM_NAME_SPACE::DocEntry::GetVM(), GDCM_NAME_SPACE::DocEntrySet::InsertEntryString(), GDCM_NAME_SPACE::CommandManager::InSetCommand(), GDCM_NAME_SPACE::DocEntryArchive::Push(), and GDCM_NAME_SPACE::SeqEntry::SetDelimitationItem().

00046 { RefCount++; }

void GDCM_NAME_SPACE::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 Print

Definition at line 47 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::FileHelper::Print(), and GDCM_NAME_SPACE::DicomDir::Print().

00047 { PrintLevel = level; }

void GDCM_NAME_SPACE::RefCounter::Unregister  )  [inline, inherited]
 

Unregister the object.

Remarks:
It decrements the reference counting

Definition at line 50 of file gdcmRefCounter.h.

Referenced by GDCM_NAME_SPACE::Document::ReadNextDocEntry(), GDCM_NAME_SPACE::SQItem::RemoveEntry(), GDCM_NAME_SPACE::ElementSet::RemoveEntry(), and GDCM_NAME_SPACE::FileHelper::~FileHelper().

00051    {
00052 //std::cout <<"================Unreg " << typeid(*this).name() << std::endl;
00053       RefCount--;
00054       if(RefCount<=0)
00055         delete this;
00056    }


Member Data Documentation

DictGroupNameHT GDCM_NAME_SPACE::DictGroupName::groupName [private]
 

Definition at line 58 of file gdcmDictGroupName.h.

Referenced by DictGroupName(), GetName(), Print(), and ~DictGroupName().

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

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

Definition at line 55 of file gdcmBase.h.

Referenced by GDCM_NAME_SPACE::SeqEntry::Print(), GDCM_NAME_SPACE::FileHelper::Print(), GDCM_NAME_SPACE::ElementSet::Print(), GDCM_NAME_SPACE::DocEntry::Print(), GDCM_NAME_SPACE::DictEntry::Print(), GDCM_NAME_SPACE::DicomDirStudy::Print(), GDCM_NAME_SPACE::DicomDirSerie::Print(), GDCM_NAME_SPACE::DicomDirPatient::Print(), GDCM_NAME_SPACE::DicomDirMeta::Print(), GDCM_NAME_SPACE::DicomDir::Print(), and GDCM_NAME_SPACE::DataEntry::Print().


The documentation for this class was generated from the following files:
Generated on Fri Aug 24 13:01:39 2007 for gdcm by  doxygen 1.4.6