gdcmCSAHeader.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef __gdcmCSAHeader_h
00016 #define __gdcmCSAHeader_h
00017
00018 #include "gdcmTypes.h"
00019 #include "gdcmDataSet.h"
00020 #include "gdcmCSAElement.h"
00021
00022 namespace gdcm
00023 {
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 class DataElement;
00034 class PrivateTag;
00061 class GDCM_EXPORT CSAHeader
00062 {
00063 friend std::ostream& operator<<(std::ostream &_os, const CSAHeader &d);
00064 public :
00065 CSAHeader():InternalDataSet(),InternalType(UNKNOWN),InterfileData(0) {};
00066 ~CSAHeader() {};
00067
00069 typedef enum {
00070 UNKNOWN = 0,
00071 SV10,
00072 NOMAGIC,
00073 DATASET_FORMAT,
00074 INTERFILE,
00075 ZEROED_OUT
00076 } CSAHeaderType;
00077
00078 template <typename TSwap>
00079 std::istream &Read(std::istream &is);
00080
00081 template <typename TSwap>
00082 const std::ostream &Write(std::ostream &os) const;
00083
00085 bool LoadFromDataElement(DataElement const &de);
00086
00088 void Print(std::ostream &os) const;
00089
00091 const DataSet& GetDataSet() const { return InternalDataSet; }
00092
00094 const char * GetInterfile() const { return InterfileData; }
00095
00098 CSAHeaderType GetFormat() const;
00099
00102 static const PrivateTag & GetCSAImageHeaderInfoTag();
00103
00106 static const PrivateTag & GetCSASeriesHeaderInfoTag();
00107
00110 static const PrivateTag & GetCSADataInfo();
00111
00114 const CSAElement &GetCSAElementByName(const char *name);
00115
00118 bool FindCSAElementByName(const char *name);
00119
00120 protected:
00121 const CSAElement& GetCSAEEnd() const;
00122
00123 private:
00124 std::set<CSAElement> InternalCSADataSet;
00125 DataSet InternalDataSet;
00126 CSAHeaderType InternalType;
00127 Tag DataElementTag;
00128 static CSAElement CSAEEnd;
00129 const char *InterfileData;
00130 };
00131
00132 inline std::ostream& operator<<(std::ostream &os, const CSAHeader &d)
00133 {
00134 d.Print( os );
00135 return os;
00136 }
00137
00138 }
00139
00140 #endif //__gdcmCSAHeader_h