MeVisLab Toolbox Reference
mlDICOMTagIdTools.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
5 
10 //----------------------------------------------------------------------------------
11 #pragma once
12 
13 #include "MLDICOMTagsSystem.h"
14 
15 #include <ThirdPartyWarningsDisable.h>
16 #include <string>
17 #include <vector>
18 #include <ThirdPartyWarningsRestore.h>
19 
20 #include <mlUtilsSystem.h>
21 
22 // DICOM Tree prototypes.
23 #include <DCMTree_Lib.h>
24 
25 ML_START_NAMESPACE
26 
27 //----------------------------------------------------------------------------------
29 //----------------------------------------------------------------------------------
30 namespace DICOMTagTools {
31 
34 
37 
52  DCMTree::Const_TreePtr dcmTree,
53  const char *const valueList[],
54  size_t numValues,
55  bool requiresExistingTag=true,
56  bool requiresTextStringValue=true);
57 
71  std::vector<unsigned int> &privateCreators,
72  std::vector<unsigned int> *badPrivateCreators=nullptr);
73 
81  std::vector<unsigned int> privateIds,
82  std::vector<unsigned int> privateCreators);
83 
101  bool printValue=false,
103  const std::string &valueIntro=" with value '",
104  const std::string &valueExtro="'",
105  size_t abbreviateAfter=15u);
106 
120  bool replaceXsByZeros=false);
121 
137  std::string strToReplace,
138  bool correctTagValues=false,
139  const std::string &defaultTagContent="");
140 
141 };
142 
143 ML_END_NAMESPACE
Project global and OS specific declarations.
#define MLDICOMTags_EXPORT
If included by external modules, exported symbols are declared as import symbols.
Class to wrap a tag-id.
Definition: DCMTree_TagId.h:40
MLint64 MLint
A signed ML integer type with at least 64 bits used for index calculations on very large images even ...
Definition: mlTypeDefs.h:578
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73
boost::shared_ptr< const Dict > Const_DictPtr
Definition: DCMTree_Dict.h:53
MLDICOMTags_EXPORT std::string replaceTagIdPlaceholder(DCMTree::Const_TreePtr dcmTree, std::string strToReplace, bool correctTagValues=false, const std::string &defaultTagContent="")
Replaces all substrings of the format "$(TAGID(ABCD,EFGH))" by the values of the first occurrence val...
MLDICOMTags_EXPORT bool hasValidTagIdRange(size_t val)
Returns true if the size_t argument val has a valid uint32 range, otherwise false is returned.
MLDICOMTags_EXPORT MLint parseUserTagIdStringVal(std::string tagIdStrVal, bool replaceXsByZeros=false)
Parses the given string tagIdStrVal and returns it as positive unsigned integer value if the parsed v...
MLDICOMTags_EXPORT std::string validatePrivateTagIds(DCMTree::Const_TreePtr dcmTree, std::vector< unsigned int > privateIds, std::vector< unsigned int > privateCreators)
Applies some consistency checks on private creators and private tags and returns an empty string if n...
MLDICOMTags_EXPORT std::string validatePrivateCreators(DCMTree::Const_TreePtr dcmTree, std::vector< unsigned int > &privateCreators, std::vector< unsigned int > *badPrivateCreators=nullptr)
Applies some consistency checks on private creators and returns an empty string if no issues are foun...
MLDICOMTags_EXPORT std::string checkForOneOf(DCMTree::TagId id, DCMTree::Const_TreePtr dcmTree, const char *const valueList[], size_t numValues, bool requiresExistingTag=true, bool requiresTextStringValue=true)
Checks whether the tag has any of the values in valueList - if yes then an empty string is returned,...
MLDICOMTags_EXPORT std::string printTagId(DCMTree::TagId id, DCMTree::Const_DictPtr dict, bool printValue=false, DCMTree::Const_TreePtr dcmTree=DCMTree::Const_TreePtr(), const std::string &valueIntro=" with value '", const std::string &valueExtro="'", size_t abbreviateAfter=15u)
Convert a tag name with its id and optionally the tag value to a string by using the DicomTree dict...