Main Page | File List | Related Pages

gdcmDictEntry.cxx

00001 // gdcmDictEntry.cxx
00002 //-----------------------------------------------------------------------------
00003 #include "gdcmDictEntry.h"
00004 
00005 #include <stdio.h>    // FIXME For sprintf
00006 #include "gdcmUtil.h"
00007 
00008 //-----------------------------------------------------------------------------
00009 // Constructor / Destructor
00021 gdcmDictEntry::gdcmDictEntry(guint16 InGroup, guint16 InElement,
00022                              std::string  InVr, std::string InFourth,
00023                              std::string  InName) {
00024         group   = InGroup;
00025         element = InElement;
00026         vr      = InVr;
00027         fourth  = InFourth;
00028         name    = InName;
00029         key     = TranslateToKey(group, element);
00030 }
00031 
00032 //-----------------------------------------------------------------------------
00033 // Print
00034 
00035 //-----------------------------------------------------------------------------
00036 // Public
00046 TagKey gdcmDictEntry::TranslateToKey(guint16 group, guint16 element) {
00047         char trash[10];
00048         TagKey key;
00049         // CLEAN ME: better call the iostream<< with the hex manipulator on.
00050         // This requires some reading of the stdlibC++ sources to make the
00051         // proper call (or copy).
00052         sprintf(trash, "%04x|%04x", group , element);
00053         key = trash;  // Convertion through assignement
00054         return key;
00055 }
00056 
00063 void gdcmDictEntry::SetVR(std::string NewVr) 
00064 {
00065         if ( IsVRUnknown() )
00066                 vr = NewVr;
00067         else 
00068    {
00069                 dbg.Error(true, "gdcmDictEntry::SetVR",
00070                           "Overwriting vr might compromise a dictionary");
00071         }
00072 }
00073 
00074 //-----------------------------------------------------------------------------
00075 // Protected
00076 
00077 //-----------------------------------------------------------------------------
00078 // Private
00079 
00080 //-----------------------------------------------------------------------------
00081 

Generated on Mon Feb 14 16:13:43 2005 for gdcm by doxygen 1.3.6