MeVisLab Toolbox Reference
SiemensASCIIConvertParser.h
Go to the documentation of this file.
1// Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2// **InsertLicense** code
3//----------------------------------------------------------------------------------
7
12//----------------------------------------------------------------------------------
13#pragma once
14
15// Local includes
17
18// ML includes
19#include "mlModuleIncludes.h"
20
21// DICOM tree prototypes
22#include <DCMTree_Lib.h>
23
25
26// STL
27#include <map>
28#include <utility>
29//
30#include <cstdlib>
31
32// Algorithmic includes
33#include <cassert>
34#include <cstddef>
35#include <cstring>
36#include <fstream>
37
38//----------------------------------------------------------------------------------
42//----------------------------------------------------------------------------------
44{
45
46public:
49
53
56 SiemensASCIIConvertParser(ML_NAMESPACE::PagedImage *pImg);
57
60
62 std::string getStringValueFor(std::string key);
63
66 double getDoubleValueFor(std::string key);
67
70 bool isMapValid();
71
73 static std::string getASCIIString(DCMTree::Const_TagPtr tagPtr);
74
77
79 inline const std::map<std::string,std::string> &getValueMap() const { return _keyValueStringMap; }
80
81private:
82
85
92 bool _initKeyValueMap(DCMTree::Const_TagPtr tagPtr);
93
101 bool _initKeyValueMap(DCMTree::Const_TreePtr treePtr);
102
104 static std::string _getASCIIString(DCMTree::Const_TreePtr treePtr);
105
107 DCMTree::Const_TreePtr _treePtr;
108
110 std::map<std::string,std::string> _keyValueStringMap;
111
113 bool _validMap;
114
115};
Project global and OS specific declarations.
#define MLMRSASCIITagDecoders_EXPORT
DLL export macro definition.
Deprecated helper class SiemensASCIIConvertParser to partially decode Siemens ASCII CSAHeader content...
double getDoubleValueFor(std::string key)
Tries to return a double value parsed from the string stored for the given key.
std::string getStringValueFor(std::string key)
Returns a std::string for the given key (regardless of data type stored)
static std::string getASCIIString(DCMTree::Const_TagPtr tagPtr)
Reads the Siemens specific ASCII header to be parsed for spectroscopy information.
static bool isSpectASCIITagId(DCMTree::Const_TagPtr tagPtr)
Returns true if tag id with ASCII tag matches, otherwise false.
const std::map< std::string, std::string > & getValueMap() const
Return the tag map itself.
SiemensASCIIConvertParser(ml::PagedImage *pImg)
Initialization with ML image DicomTreeImagePropertyExtension must exist in the images property contai...
SiemensASCIIConvertParser(DCMTree::Const_TreePtr treePtr)
Initialization with DICOM Tree.
static DCMTree::Const_TagPtr getSpectASCIITag(DCMTree::Const_TreePtr treePtr)
Returns an ASCII tag describing spectroscopy data or return an empty default tag pointer.
SiemensASCIIConvertParser(DCMTree::Const_TagPtr tagPtr)
Initialization with DICOM Tag, assuming that it is the SpectASCIITag of Siemens with private creator ...
bool isMapValid()
Return state of key-value map.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
boost::shared_ptr< const Tag > Const_TagPtr
Definition DCMTree_Lib.h:63
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:73