GDCM  2.4.5
gdcmCSAHeader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMCSAHEADER_H
15 #define GDCMCSAHEADER_H
16 
17 #include "gdcmTypes.h"
18 #include "gdcmDataSet.h"
19 #include "gdcmCSAElement.h"
20 
21 namespace gdcm
22 {
23 /*
24  * Everything done in this code is for the sole purpose of writing interoperable
25  * software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.
26  * If you believe anything in this code violates any law or any of your rights,
27  * please contact us (gdcm-developers@lists.sourceforge.net) so that we can
28  * find a solution.
29  */
30 //-----------------------------------------------------------------------------
31 
32 class DataElement;
33 class PrivateTag;
63 {
64  friend std::ostream& operator<<(std::ostream &_os, const CSAHeader &d);
65 public :
66  CSAHeader():InternalDataSet(),InternalType(UNKNOWN),InterfileData(0) {};
67  ~CSAHeader() {};
68 
70  typedef enum {
71  UNKNOWN = 0,
76  ZEROED_OUT
77  } CSAHeaderType;
78 
79  template <typename TSwap>
80  std::istream &Read(std::istream &is);
81 
82  template <typename TSwap>
83  const std::ostream &Write(std::ostream &os) const;
84 
86  bool LoadFromDataElement(DataElement const &de);
87 
89  void Print(std::ostream &os) const;
90 
92  const DataSet& GetDataSet() const { return InternalDataSet; }
93 
95  const char * GetInterfile() const { return InterfileData; }
96 
99  CSAHeaderType GetFormat() const;
100 
103  static const PrivateTag & GetCSAImageHeaderInfoTag();
104 
107  static const PrivateTag & GetCSASeriesHeaderInfoTag();
108 
111  static const PrivateTag & GetCSADataInfo();
112 
115  const CSAElement &GetCSAElementByName(const char *name);
116 
119  bool FindCSAElementByName(const char *name);
120 
121 protected:
122  const CSAElement& GetCSAEEnd() const;
123 
124 private:
125  std::set<CSAElement> InternalCSADataSet;
126  DataSet InternalDataSet;
127  CSAHeaderType InternalType;
128  Tag DataElementTag;
129  static CSAElement CSAEEnd;
130  const char *InterfileData;
131 };
132 //-----------------------------------------------------------------------------
133 inline std::ostream& operator<<(std::ostream &os, const CSAHeader &d)
134 {
135  d.Print( os );
136  return os;
137 }
138 
139 } // end namespace gdcm
140 //-----------------------------------------------------------------------------
141 #endif //GDCMCSAHEADER_H
Class for CSAHeader.
Definition: gdcmCSAHeader.h:62
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
~CSAHeader()
Definition: gdcmCSAHeader.h:67
const DataSet & GetDataSet() const
Return the DataSet output (use only if Format == DATASET_FORMAT )
Definition: gdcmCSAHeader.h:92
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner) ...
Definition: gdcmPrivateTag.h:38
Definition: gdcmCSAHeader.h:74
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:88
CSAHeader()
Definition: gdcmCSAHeader.h:66
void Print(std::ostream &os) const
Print the CSAHeader (use only if Format == SV10 or NOMAGIC)
Definition: gdcmCSAHeader.h:73
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
const char * GetInterfile() const
Return the string output (use only if Format == Interfile)
Definition: gdcmCSAHeader.h:95
Definition: gdcmCSAHeader.h:72
Class to represent a CSA Element.
Definition: gdcmCSAElement.h:29
Definition: gdcmCSAHeader.h:75
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element). Basically an uint32_t which...
Definition: gdcmTag.h:38
Definition: gdcmASN1.h:20

Generated on Fri Sep 25 2015 17:58:22 for GDCM by doxygen 1.8.9.1
SourceForge.net Logo