MeVisLab Toolbox Reference
mlGenericPrivateDICOMTagDecoder.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
6 
11 //----------------------------------------------------------------------------------
12 
13 #pragma once
14 
16 #include <mlUtilsSystemC.h>
19 #include <mlPrivateDICOMTags.h>
20 
21 ML_START_NAMESPACE
22 
27 
28 public:
29 
32 
34 
46  DCMTree::Const_TagPtr tagPtr,
47  PrivateDICOMTagValueFields &resultFields) override;
48 
56  static void dumpHexArea(const std::string &prefix,
57  const unsigned char *tagData,
58  size_t tagDataSize,
59  PrivateDICOMTagValueFields &resultFields,
60  size_t rowSize=16);
61 
81  const unsigned char *&tagData,
82  MLuint32 &tagDataSize,
83  bool decodeImplicitSeqVR,
84  PrivateDICOMTagValueFields &resultFields,
85  bool translateStdIdToName) const;
86 
88  static bool isValidVRString(const std::string &vrStr);
89 
90 protected:
91 
99  bool _getTagNameAndVrFromId(unsigned int groupId,
100  unsigned int elementId,
101  std::string &retName,
102  std::string &retVr) const;
103 
110  const unsigned char *_findStr(const unsigned char *buffer,
111  const std::string &str,
112  size_t bufferSize) const;
113 
133  static std::string _dumpRange(const unsigned char *start,
134  size_t num = 16,
135  bool showStartAddress = true,
136  bool showHexDump = true,
137  bool showASCII = true,
138  size_t maxRowSize = 16,
139  char defaultNonReadableChar = '.');
140 
155  const unsigned char *&tagData,
156  MLuint32 &tagDataSize,
157  bool implicit,
158  PrivateDICOMTagValueFields &resultFields,
159  bool translateStdIdToName) const;
160 
161 private:
162 
165 
176 
178  void _decodeATTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
179  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
180 
182  void _decodeDLTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
183  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
184 
186  void _decodeFDTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
187  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
188 
190  void _decodeFLTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
191  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
192 
194  void _decodeOXTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
195  MLuint32 &tagValueSize,
196  MLuint32 maxTagValueSize,
197  std::string &addStr,
198  PrivateDICOMTagValueFields &resultFields,
199  const std::string &VRstr) const;
200 
202  void _decodeSQTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
203  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields,
204  bool decodeImplicitSeqVR,
205  bool translateStdIdToName) const;
206 
208  void _decodeSLTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
209  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
210 
212  void _decodeSSTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
213  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
214 
216  void _decodeULTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
217  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
218 
220  void _decodeUSTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
221  MLuint32 &tagValueSize,
222  MLuint32 maxTagValueSize,
223  std::string &addStr,
224  PrivateDICOMTagValueFields &resultFields) const;
225 
227  void _decodeUNTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
228  MLuint32 &tagValueSize, std::string &addStr, PrivateDICOMTagValueFields &resultFields) const;
229 
231  void _decodeStrLikeTagData(const std::string &prefix, bool useImplicitVR, const unsigned char *tagData,
232  MLuint32 &tagValueSize,
233  MLuint32 maxTagValueSize,
234  std::string &addStr,
235  PrivateDICOMTagValueFields &resultFields,
236  std::string &strValue) const;
237 
252  bool _decodeVrTagData(const std::string &prefix,
253  bool useImplicitVR,
254  const unsigned char *tagData,
255  MLuint32 &tagValueSize,
256  MLuint32 maxDataSize,
257  std::string &addStr,
258  PrivateDICOMTagValueFields &resultFields,
259  bool decodeImplicitSeqVR,
260  const std::string &vr,
261  std::string &strValue,
262  bool translateStdIdToName) const;
264 
265 
268 };
269 
270 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLGENERIC_PRIVATEDICOMTAGDECODERS_EXPORT
DLL export macro definition.
The GenericPrivateDICOMTagDecoder class is a default decoder usable for all private DICOM tags as wel...
static void dumpHexArea(const std::string &prefix, const unsigned char *tagData, size_t tagDataSize, PrivateDICOMTagValueFields &resultFields, size_t rowSize=16)
Add a range of bytes as a hex dump to the PrivateDICOMTagValueFields resultFields as "otherInfo" tag ...
GenericPrivateDICOMTagDecoder()
Constructor doing nothing.
PrivateDICOMTagDecoderPluginBase::DecodeStates extractTag(const std::string &prefix, const unsigned char *&tagData, MLuint32 &tagDataSize, bool decodeImplicitSeqVR, PrivateDICOMTagValueFields &resultFields, bool translateStdIdToName) const
Assume a DICOM tag as binary data and add human readable information to resultFields of the tag id,...
PrivateDICOMTagDecoderPluginBase::DecodeStates _decodeSequenceTagData(const std::string &prefix, const unsigned char *&tagData, MLuint32 &tagDataSize, bool implicit, PrivateDICOMTagValueFields &resultFields, bool translateStdIdToName) const
Extract a sequence of DICOM tag values whose value representations are given in VRs.
PrivateDICOMTagDecoderPluginBase::DecodeStates decodePrivateTag(const std::string &privateCreator, DCMTree::Const_TagPtr tagPtr, PrivateDICOMTagValueFields &resultFields) override
If a private Toshiba PMTF header tag is passed then this routine converts its data element(s) to fiel...
static std::string _dumpRange(const unsigned char *start, size_t num=16, bool showStartAddress=true, bool showHexDump=true, bool showASCII=true, size_t maxRowSize=16, char defaultNonReadableChar='.')
Creates a string containing one row with a hexadecimal start address of the buffer,...
bool _getTagNameAndVrFromId(unsigned int groupId, unsigned int elementId, std::string &retName, std::string &retVr) const
Determines the tag name and value representation corresponding to a tag id given by groupId and eleme...
const unsigned char * _findStr(const unsigned char *buffer, const std::string &str, size_t bufferSize) const
Returns the pointer to the first occurrence of str in the buffer given by buffer and bufferSize.
static bool isValidVRString(const std::string &vrStr)
Returns true if the passed VR string is a valid known one, otherwise false.
Base class for plugins decoding private DICOM tags to a PrivateDICOMTagValueFields container.
List type managing and maintaining a number of PrivateDICOMTagValueFields::PrivateTagField containers...
Header file of class PrivateDICOMTags collecting some known private DICOM tag information.
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
unsigned int MLuint32
Definition: mlTypeDefs.h:191
boost::shared_ptr< const Tag > Const_TagPtr
Definition: DCMTree_Lib.h:63