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;
00063 class GDCM_EXPORT CSAHeader
00064 {
00065 friend std::ostream& operator<<(std::ostream &_os, const CSAHeader &d);
00066 public :
00067 CSAHeader():InternalDataSet(),InternalType(UNKNOWN),InterfileData(0) {};
00068 ~CSAHeader() {};
00069
00071 typedef enum {
00072 UNKNOWN = 0,
00073 SV10,
00074 NOMAGIC,
00075 DATASET_FORMAT,
00076 INTERFILE,
00077 ZEROED_OUT
00078 } CSAHeaderType;
00079
00080 template <typename TSwap>
00081 std::istream &Read(std::istream &is);
00082
00083 template <typename TSwap>
00084 const std::ostream &Write(std::ostream &os) const;
00085
00087 bool LoadFromDataElement(DataElement const &de);
00088
00090 void Print(std::ostream &os) const;
00091
00093 const DataSet& GetDataSet() const { return InternalDataSet; }
00094
00096 const char * GetInterfile() const { return InterfileData; }
00097
00100 CSAHeaderType GetFormat() const;
00101
00104 static const PrivateTag & GetCSAImageHeaderInfoTag();
00105
00108 static const PrivateTag & GetCSASeriesHeaderInfoTag();
00109
00112 static const PrivateTag & GetCSADataInfo();
00113
00116 const CSAElement &GetCSAElementByName(const char *name);
00117
00120 bool FindCSAElementByName(const char *name);
00121
00122 protected:
00123 const CSAElement& GetCSAEEnd() const;
00124
00125 private:
00126 std::set<CSAElement> InternalCSADataSet;
00127 DataSet InternalDataSet;
00128 CSAHeaderType InternalType;
00129 Tag DataElementTag;
00130 static CSAElement CSAEEnd;
00131 const char *InterfileData;
00132 };
00133
00134 inline std::ostream& operator<<(std::ostream &os, const CSAHeader &d)
00135 {
00136 d.Print( os );
00137 return os;
00138 }
00139
00140 }
00141
00142 #endif //GDCMCSAHEADER_H