GDCM 3.0.24
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#include "gdcmMrProtocol.h"
21
22namespace gdcm
23{
24/*
25 * Everything done in this code is for the sole purpose of writing interoperable
26 * software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.
27 * If you believe anything in this code violates any law or any of your rights,
28 * please contact us (gdcm-developers@lists.sourceforge.net) so that we can
29 * find a solution.
30 */
31//-----------------------------------------------------------------------------
32
33class DataElement;
34class PrivateTag;
64{
65 friend std::ostream& operator<<(std::ostream &_os, const CSAHeader &d);
66public :
67 CSAHeader():InternalDataSet(),InternalType(UNKNOWN),InterfileData(nullptr) {}
68 ~CSAHeader() = default;
69
71 typedef enum {
72 UNKNOWN = 0,
77 ZEROED_OUT
78 } CSAHeaderType;
79
82
84 void Print(std::ostream &os) const;
85
87 const DataSet& GetDataSet() const { return InternalDataSet; }
88
90 const char * GetInterfile() const { return InterfileData; }
91
95
99
103
106 static const PrivateTag & GetCSADataInfo();
107
110 const CSAElement &GetCSAElementByName(const char *name);
111
114 bool FindCSAElementByName(const char *name);
115
117 bool GetMrProtocol( const DataSet & ds, MrProtocol & mrProtocol );
118
119protected:
120 const CSAElement& GetCSAEEnd() const;
121
122private:
123 std::set<CSAElement> InternalCSADataSet;
124 DataSet InternalDataSet;
125 CSAHeaderType InternalType;
126 Tag DataElementTag;
127 static CSAElement CSAEEnd;
128 const char *InterfileData;
129};
130//-----------------------------------------------------------------------------
131inline std::ostream& operator<<(std::ostream &os, const CSAHeader &d)
132{
133 d.Print( os );
134 return os;
135}
136
137} // end namespace gdcm
138//-----------------------------------------------------------------------------
139#endif //GDCMCSAHEADER_H
Class to represent a CSA Element.
Definition gdcmCSAElement.h:30
Class for CSAHeader.
Definition gdcmCSAHeader.h:64
CSAHeaderType GetFormat() const
static const PrivateTag & GetCSAImageHeaderInfoTag()
~CSAHeader()=default
bool FindCSAElementByName(const char *name)
const CSAElement & GetCSAElementByName(const char *name)
void Print(std::ostream &os) const
Print the CSAHeader (use only if Format == SV10 or NOMAGIC)
CSAHeader()
Definition gdcmCSAHeader.h:67
const CSAElement & GetCSAEEnd() const
static const PrivateTag & GetCSASeriesHeaderInfoTag()
const DataSet & GetDataSet() const
Return the DataSet output (use only if Format == DATASET_FORMAT )
Definition gdcmCSAHeader.h:87
CSAHeaderType
Diverse format of CSAHeader as found 'in the wild'.
Definition gdcmCSAHeader.h:71
@ INTERFILE
Definition gdcmCSAHeader.h:76
@ NOMAGIC
Definition gdcmCSAHeader.h:74
@ DATASET_FORMAT
Definition gdcmCSAHeader.h:75
@ SV10
Definition gdcmCSAHeader.h:73
const char * GetInterfile() const
Return the string output (use only if Format == Interfile)
Definition gdcmCSAHeader.h:90
bool LoadFromDataElement(DataElement const &de)
Decode the CSAHeader from element 'de'.
static const PrivateTag & GetCSADataInfo()
bool GetMrProtocol(const DataSet &ds, MrProtocol &mrProtocol)
Retrieve the ASCII portion stored within the MrProtocol/MrPhoenixProtocol:
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
Class for MrProtocol.
Definition gdcmMrProtocol.h:37
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner)
Definition gdcmPrivateTag.h:39
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88