GDCM: gdcmCSAHeader.h Source File

GDCM 3.2.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#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;
63 class GDCM_EXPORT CSAHeader
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,
73 SV10,
74 NOMAGIC,
75 DATASET_FORMAT,
76 INTERFILE,
77 ZEROED_OUT
78 } CSAHeaderType;
79
81 bool LoadFromDataElement(DataElement const &de);
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
94 CSAHeaderType GetFormat() const;
95
98 static const PrivateTag & GetCSAImageHeaderInfoTag();
99
102 static const PrivateTag & GetCSASeriesHeaderInfoTag();
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//-----------------------------------------------------------------------------
131 inline 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
gdcm::CSAElement
Class to represent a CSA Element.
Definition gdcmCSAElement.h:30
gdcm::CSAHeader::GetFormat
CSAHeaderType GetFormat() const
gdcm::CSAHeader::GetCSAImageHeaderInfoTag
static const PrivateTag & GetCSAImageHeaderInfoTag()
gdcm::CSAHeader::~CSAHeader
~CSAHeader()=default
gdcm::CSAHeader::FindCSAElementByName
bool FindCSAElementByName(const char *name)
gdcm::CSAHeader::GetCSAElementByName
const CSAElement & GetCSAElementByName(const char *name)
gdcm::CSAHeader::Print
void Print(std::ostream &os) const
Print the CSAHeader (use only if Format == SV10 or NOMAGIC).
gdcm::CSAHeader::CSAHeader
CSAHeader()
Definition gdcmCSAHeader.h:67
gdcm::CSAHeader::operator<<
friend std::ostream & operator<<(std::ostream &_os, const CSAHeader &d)
Definition gdcmCSAHeader.h:131
gdcm::CSAHeader::GetCSAEEnd
const CSAElement & GetCSAEEnd() const
gdcm::CSAHeader::GetCSASeriesHeaderInfoTag
static const PrivateTag & GetCSASeriesHeaderInfoTag()
gdcm::CSAHeader::GetDataSet
const DataSet & GetDataSet() const
Return the DataSet output (use only if Format == DATASET_FORMAT ).
Definition gdcmCSAHeader.h:87
gdcm::CSAHeader::CSAHeaderType
CSAHeaderType
Diverse format of CSAHeader as found 'in the wild'.
Definition gdcmCSAHeader.h:71
gdcm::CSAHeader::INTERFILE
@ INTERFILE
Definition gdcmCSAHeader.h:76
gdcm::CSAHeader::NOMAGIC
@ NOMAGIC
Definition gdcmCSAHeader.h:74
gdcm::CSAHeader::DATASET_FORMAT
@ DATASET_FORMAT
Definition gdcmCSAHeader.h:75
gdcm::CSAHeader::ZEROED_OUT
@ ZEROED_OUT
Definition gdcmCSAHeader.h:77
gdcm::CSAHeader::UNKNOWN
@ UNKNOWN
Definition gdcmCSAHeader.h:72
gdcm::CSAHeader::SV10
@ SV10
Definition gdcmCSAHeader.h:73
gdcm::CSAHeader::GetInterfile
const char * GetInterfile() const
Return the string output (use only if Format == Interfile).
Definition gdcmCSAHeader.h:90
gdcm::CSAHeader::LoadFromDataElement
bool LoadFromDataElement(DataElement const &de)
Decode the CSAHeader from element 'de'.
gdcm::CSAHeader::GetCSADataInfo
static const PrivateTag & GetCSADataInfo()
gdcm::CSAHeader::GetMrProtocol
bool GetMrProtocol(const DataSet &ds, MrProtocol &mrProtocol)
Retrieve the ASCII portion stored within the MrProtocol/MrPhoenixProtocol:
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements).
Definition gdcmDataSet.h:56
gdcm::MrProtocol
Class for MrProtocol.
Definition gdcmMrProtocol.h:37
gdcm::PrivateTag
Class to represent a Private DICOM Data Element (Attribute) Tag (Group, Element, Owner).
Definition gdcmPrivateTag.h:39
gdcm::Tag
Class to represent a DICOM Data Element (Attribute) Tag (Group, Element).
Definition gdcmTag.h:39
gdcmCSAElement.h
gdcmDataSet.h
gdcmMrProtocol.h
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88