MeVisLab Toolbox Reference
mlCSADecoder.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
10
15//----------------------------------------------------------------------------------
16/*=========================================================================
17
18 Program: GDCM (Grassroots DICOM). A DICOM library
19 Module: $URL$
20
21 Copyright (c) 2006-2010 Mathieu Malaterre
22 All rights reserved.
23 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
24
25 This software is distributed WITHOUT ANY WARRANTY; without even
26 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27 PURPOSE. See the above copyright notice for more information.
28
29=========================================================================*/
30#pragma once
31
32#include <FMEThirdPartyWarningsDisable.h>
33#include <gdcmTypes.h>
34#include <gdcmDataSet.h>
35#include <gdcmCSAElement.h>
36#include <FMEThirdPartyWarningsRestore.h>
37
39namespace gdcm
40{
41/*
42 * Everything done in this code is for the sole purpose of writing interoperable
43 * software under Sect. 1201 (f) Reverse Engineering exception of the DMCA.
44 * If you believe anything in this code violates any law or any of your rights,
45 * please contact us (gdcm-developers@lists.sourceforge.net) so that we can
46 * find a solution.
47 */
48//-----------------------------------------------------------------------------
49
50class DataElement;
51class PrivateTag;
72{
73 friend std::ostream& operator<<(std::ostream &_os, const CSADecoder &d);
74public :
75 // Constructor.
76 CSADecoder(): InternalDataSet(), InternalType(UNKNOWN), InterfileData(nullptr) {};
77
79 typedef enum {
80 UNKNOWN = 0,
85 ZEROED_OUT
86 } CSAHeaderType;
87
90
92 void Print(std::ostream &os) const;
93
95 const DataSet& GetDataSet() const { return InternalDataSet; }
96
98 const char * GetInterfile() const { return InterfileData; }
99
101 static VR GetVRFromDataSetFormatDict( const Tag& t );
102
106
108 inline const std::set<CSAElement> & getInternalCSADataSet() const { return InternalCSADataSet; }
109
111 inline const std::string& getReportString() const { return reportString; }
112
113private:
115 std::set<CSAElement> InternalCSADataSet;
117 DataSet InternalDataSet;
119 CSAHeaderType InternalType;
121 Tag DataElementTag;
123 const char *InterfileData;
125 std::string reportString;
126};
127
128//-----------------------------------------------------------------------------
130inline std::ostream& operator<<(std::ostream &os, const CSADecoder &d)
131{
132 d.Print( os );
133 return os;
134}
135
136} // end namespace gdcm
137//-----------------------------------------------------------------------------
Class CSADecoder adopted from gdcm implementation to decode Siemens CSA DICOM header tags.
void Print(std::ostream &os) const
Print the CSADecoder (use only if Format == SV10 or NOMAGIC)
const std::set< CSAElement > & getInternalCSADataSet() const
wsp: Added access function to traverse all private elements. I wonder why this is not available norma...
const DataSet & GetDataSet() const
Return the DataSet output (use only if Format == DATASET_FORMAT )
CSAHeaderType GetFormat() const
return the format of the CSADecoder SV10 and NOMAGIC are equivalent.
const char * GetInterfile() const
Return the string output (use only if Format == Interfile)
static VR GetVRFromDataSetFormatDict(const Tag &t)
Helper function to get VR from a DataSet entry if Format is DATASET_FORMAT.
const std::string & getReportString() const
Returns information about the reason why decoding failed.
bool LoadFromDataElement(DataElement const &de)
Decode the CSADecoder from element 'de'.
CSAHeaderType
Divers format of CSADecoder as found 'in the wild'.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
std::ostream & operator<<(std::ostream &out, const ml::Variant &variant)
Definition mlVariant.h:210
Namespace of the Grassroots DICOM library.
std::ostream & operator<<(std::ostream &os, const CSADecoder &d)
Print operator streaming out the CSADecoder.