gdcmDictEntry.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmDictEntry.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:04 $
00007   Version:   $Revision: 1.46 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef _GDCMDICTENTRY_H_
00020 #define _GDCMDICTENTRY_H_
00021 
00022 #include "gdcmRefCounter.h"
00023 #include "gdcmTagKey.h"
00024 #include "gdcmVRKey.h"
00025 
00026 namespace GDCM_NAME_SPACE 
00027 {
00028 //-----------------------------------------------------------------------------
00029 class VRKey;
00030 class TagKey;
00042 class GDCM_EXPORT DictEntry : public RefCounter
00043 {
00044    gdcmTypeMacro(DictEntry);
00045 
00046 public:
00047    static DictEntry *New(uint16_t group, uint16_t elem,
00048              VRKey const &vr       = GDCM_VRUNKNOWN,
00049              TagName const &vm     = GDCM_UNKNOWN,
00050              TagName const &name   = GDCM_UNKNOWN);
00051 
00052 // Print
00053    void Print(std::ostream &os = std::cout, std::string const &indent = "");
00054 
00057    const uint16_t &GetGroup() const { return Tag[0]; }
00058 
00061    const uint16_t &GetElement() const { return Tag[1]; }   
00062 
00065    virtual void SetVR(VRKey const &vr) { VR = vr; }
00068    const VRKey &GetVR() const { return VR; }
00071    bool IsVRUnknown() const { return VR == GDCM_VRUNKNOWN; }
00072 
00073    const TagKey &GetKey() const { return Tag; }
00074 
00075 // Key creation
00076    static TagKey TranslateToKey(uint16_t group, uint16_t elem);
00077 
00080    const TagName &GetVM() const { return VM; } 
00083    virtual void SetVM(TagName const &vm) { VM = vm; }
00086    bool IsVMUnknown() const { return VM == GDCM_UNKNOWN; }
00087 
00091    const TagName &GetName() const { return Name; } 
00092 
00093 protected:
00094    DictEntry(uint16_t group, uint16_t elem,
00095              VRKey const &vr       = GDCM_VRUNKNOWN,
00096              TagName const &vm     = GDCM_UNKNOWN,
00097              TagName const &name   = GDCM_UNKNOWN);
00098 
00099    ~DictEntry();
00100    
00101 private:
00103    TagKey Tag;
00104 
00109    VRKey VR;
00110    
00112    TagName VM; 
00113 
00115    TagName Name;      
00116 };
00117 } // end namespace gdcm
00118 //-----------------------------------------------------------------------------
00119 #endif

Generated on Fri Aug 24 12:53:13 2007 for gdcm by  doxygen 1.4.6