gdcmVR.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmVR.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:05 $
00007   Version:   $Revision: 1.33 $
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 _GDCMVR_H_
00020 #define _GDCMVR_H_
00021 
00022 #include "gdcmRefCounter.h"
00023 #include "gdcmVRKey.h"
00024 
00025 #include <map>
00026 #include <string>
00027 #include <iostream>
00028 
00029 namespace GDCM_NAME_SPACE 
00030 {
00031 
00032 //-----------------------------------------------------------------------------
00033 typedef std::string VRAtr;
00035 typedef std::map<VRKey, VRAtr> VRHT;
00036 
00037 //-----------------------------------------------------------------------------
00042 class GDCM_EXPORT VR : public RefCounter
00043 {
00044    gdcmTypeMacro(VR);
00045 
00046 public:
00047    static VR *New() {return new VR();}
00048 
00049    virtual void Print(std::ostream &os = std::cout, 
00050                       std::string const & = "" );
00051 
00053    int Count(VRKey const &key) { return vr.count(key); };
00054 
00055    bool IsVROfBinaryRepresentable(VRKey const &tested);
00056    bool IsVROfStringRepresentable(VRKey const &tested);
00057 
00060    bool IsVROfSequence(VRKey const &tested) { return tested == "SQ"; }
00061 
00062 // Remove inline optimization for VS6
00063 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00064    bool IsValidVR(VRKey const &key);
00065 #else
00066 
00067    bool IsValidVR(VRKey const &key) { return vr.find(key) != vr.end(); }
00068 #endif
00069 
00070    unsigned short GetAtomicElementLength(VRKey const &tested);
00071 
00072 protected:
00073    VR();
00074    ~VR();
00075 
00076 private:
00077    VRHT vr;
00078 };
00079 } // end namespace gdcm
00080 
00081 //-----------------------------------------------------------------------------
00082 #endif

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