gdcmCommon.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmCommon.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:03 $
00007   Version:   $Revision: 1.116 $
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 _GDCMCOMMON_H_
00020 #define _GDCMCOMMON_H_
00021 
00022 #include "gdcmConfigure.h"
00023 #include "gdcmSystem.h"
00024 #include "gdcmMacro.h"
00025 #include "gdcmVRKey.h"
00026 #include <string>
00027 
00028 //-----------------------------------------------------------------------------
00029 #if defined(_WIN32) && defined(BUILD_SHARED_LIBS)
00030   #ifdef gdcm_EXPORTS
00031     #define GDCM_EXPORT __declspec( dllexport )
00032   #else
00033     #define GDCM_EXPORT __declspec( dllimport )
00034   #endif
00035 #else
00036   #define GDCM_EXPORT
00037 #endif
00038 
00039 #ifdef __BORLANDC__
00040 #include <mem.h>
00041 #endif
00042 
00043 //-----------------------------------------------------------------------------
00045 namespace GDCM_NAME_SPACE
00046 {
00047 
00048 // Centralize information about the gdcm dictionary in only one file:
00049 //
00050 // ==>
00051 // ==> Don't forget gdcm/gdcmPython/gdcm.i
00052 // ==>
00053 //
00054 
00055 #ifndef PUB_DICT_PATH
00056 #  define PUB_DICT_PATH   "../Dicts/"
00057 #endif
00058 #define PUB_DICT_NAME     "dicomV3Dict"
00059 
00060 // dicomV3.dic replaced by the generated gdcm.dic/
00061 // if gdcm.dic not found, method FillDefaultDataDict() is invoked
00062 //#define PUB_DICT_FILENAME "dicomV3.dic"
00063 #define PUB_DICT_FILENAME "gdcm.dic"
00064 #define DICT_ELEM         "DicomDir.dic"
00065 #define DICT_TS           "dicomTS.dic"
00066 #define DICT_VR           "dicomVR.dic"
00067 #define DICT_GROUP_NAME   "DictGroupName.dic"
00068 
00069 GDCM_EXPORT extern const std::string GDCM_UNKNOWN;
00070 GDCM_EXPORT extern const std::string GDCM_UNFOUND;
00071 GDCM_EXPORT extern const std::string GDCM_BINLOADED;
00072 GDCM_EXPORT extern const std::string GDCM_NOTLOADED;
00073 GDCM_EXPORT extern const std::string GDCM_UNREAD;
00074 GDCM_EXPORT extern const std::string GDCM_NOTASCII;
00075 GDCM_EXPORT extern const std::string GDCM_PIXELDATA;
00076 
00077 GDCM_EXPORT extern const char GDCM_VRUNKNOWN[2];
00078 
00079 GDCM_EXPORT extern const char GDCM_FILESEPARATOR;
00080 
00088 
00089 #if defined(_MSC_VER) && (_MSC_VER == 1200)
00090 // Doing everything within gdcm namespace to avoid polluting 3d party software
00091 inline std::ostream& operator<<(std::ostream& _O, std::string _val)
00092 {
00093   return _O << _val.c_str();
00094 }
00095 #endif
00096 
00099 typedef std::string TagName;
00100 
00102 enum FileType {
00103 // note to developer : don't forget to add as well in vtkGdcmWriter.h !
00104    Unknown = 0,
00105    ExplicitVR, // DicomDir is in this case. Except when it's ImplicitVR !...
00106    ImplicitVR,
00107    ACR,
00108    ACR_LIBIDO,
00111    JPEG,
00112    JPEG2000
00113 };
00114 
00116 enum DicomDirType {
00117    DD_UNKNOWN = 0,
00118    DD_META,
00119    DD_PATIENT,
00120    DD_STUDY,
00121    DD_SERIE,
00122    DD_IMAGE,
00123    DD_VISIT
00124 };
00125 
00127 enum CompOperators {
00128    GDCM_EQUAL = 0,
00129    GDCM_DIFFERENT,
00130    GDCM_GREATER,
00131    GDCM_GREATEROREQUAL,
00132    GDCM_LESS,
00133    GDCM_LESSOREQUAL
00134 };
00135 
00137 enum LodModeType
00138 {
00139    LD_ALL         = 0x00000000, // Load all
00140    LD_NOSEQ       = 0x00000001, // Don't load Sequences
00141    LD_NOSHADOW    = 0x00000002, // Don't load odd groups
00142    LD_NOSHADOWSEQ = 0x00000004  // Don't load Sequences if they belong 
00143                                 //            to an odd group
00144                                 // (*exclusive* from LD_NOSEQ and LD_NOSHADOW)
00145 };
00146 
00157 enum ImageContentType
00158 {
00159 // note to developer : don't forget to add as well in vtkGdcmWriter.h !
00160       USER_OWN_IMAGE = 1,
00161       FILTERED_IMAGE,
00162       CREATED_IMAGE,      
00163       UNMODIFIED_PIXELS_IMAGE            
00164 }; 
00165   
00169 struct DicomElement
00170 {
00172    unsigned short int Group;
00174    unsigned short int Elem;
00176    VRKey VR;
00178    std::string Value;
00179 };
00180 
00181 } //namespace gdcm
00182 //-----------------------------------------------------------------------------
00183 #endif

Generated on Fri Aug 24 12:59:29 2007 for gdcm by  doxygen 1.4.6