MeVisLab Toolbox Reference
mlDICOMTreeModificationTools.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 <FMEThirdPartyWarningsDisable.h>
16#include <string>
17#include <vector>
18#include <FMEThirdPartyWarningsRestore.h>
19
20#include <mlUtilsSystem.h>
21
22// DICOM Tree prototypes.
23#include <DCMTree_Lib.h>
24
25ML_START_NAMESPACE
26
27//----------------------------------------------------------------------------------
29//----------------------------------------------------------------------------------
30namespace DICOMTagTools {
31
37 DCMTree::TagId tagId);
38
48 unsigned char tagIdLowerEightBits,
49 const std::string &privateCreatorString);
50
57 const std::string &privateCreatorString);
58
63 bool alsoRemovePrivateCreator);
64
73 bool removeAllPrivateTags=false,
74 const std::string &privateCreatorString="");
75
81
83typedef struct {
85 const char *name;
86}
89
95 const DcmTagIdToRemove srcTagsToRemove[]);
96
103 MLuint32 idVal,
104 MLuint32 idMask);
105
108 const std::vector<DCMTree::TagId> &listOfIdsToRemove);
109
114
120
125
145 const DCMTree::TagId &tagId,
146 bool remove = true,
147 const std::string &newVal = "",
148 size_t *numGoodManips = nullptr,
149 size_t *numBadManips = nullptr,
150 size_t recursionLevel = 0);
151
155
160
170
175
184
190MLDICOMTags_EXPORT std::vector<DCMTree::RawTagId> removeLargeTags(DCMTree::TreePtr treePtr,
191 size_t tagSizeToRemove=0x00040000);
192
204 size_t itemIdx);
205
221
224
226extern MLDICOMTags_EXPORT const char * const OtherTagModificationModesStrings[NumOtherTagModificationModes];
227
236 OtherTagModificationModes modificationMode,
237 const std::string &modStrVal);
238
244 size_t from,
245 size_t to,
246 std::string &errStr);
247
252 MLint numEntries,
253 std::string &errStr);
254
255};
256
257ML_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.
unsigned int MLuint32
Definition mlTypeDefs.h:184
MLint64 MLint
Definition mlTypeDefs.h:489
boost::shared_ptr< Tag > TagPtr
Shared pointer to tag.
Definition DCMTree_Lib.h:56
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66
MLDICOMTags_EXPORT DCMTree::TreePtr getSequenceItemTree(DCMTree::TagPtr tagPtr, size_t itemIdx)
MLDICOMTags_EXPORT void removePrivateTagGroup(DCMTree::TreePtr dcmTree, bool removeAllPrivateTags=false, const std::string &privateCreatorString="")
MLDICOMTags_EXPORT bool removeREGDataTag(DCMTree::TreePtr treePtr)
MLDICOMTags_EXPORT void recursiveSequenceTagCleanUp(DCMTree::TagPtr seqTagPtr)
MLDICOMTags_EXPORT void recursiveTagManipulate(DCMTree::TreePtr treePtr, const DCMTree::TagId &tagId, bool remove=true, const std::string &newVal="", size_t *numGoodManips=nullptr, size_t *numBadManips=nullptr, size_t recursionLevel=0)
MLDICOMTags_EXPORT void removePrivateMultiFrameTag(DCMTree::TreePtr &treePtr)
MLDICOMTags_EXPORT void removeTags(DCMTree::TreePtr resultTree, const DcmTagIdToRemove srcTagsToRemove[])
MLDICOMTags_EXPORT std::vector< DCMTree::RawTagId > removeLargeTags(DCMTree::TreePtr treePtr, size_t tagSizeToRemove=0x00040000)
MLDICOMTags_EXPORT bool removeAllTypesPixelDataTags(DCMTree::TreePtr treePtr)
MLDICOMTags_EXPORT void manipulateType2Or3Tags(DCMTree::TreePtr dcmTree, OtherTagModificationModes modificationMode, const std::string &modStrVal)
MLDICOMTags_EXPORT void removeType3Tags(DCMTree::TreePtr dcmTree)
MLDICOMTags_EXPORT void recursiveRemoveTags(DCMTree::TreePtr &dcmTree, const std::vector< DCMTree::TagId > &listOfIdsToRemove)
Remove recursively all appearances of any tags with ids in listOfIdsToRemove from dcmTree.
struct ml::DICOMTagTools::DcmTagIdToRemove TagIdDesc
< Small structure describing a tag to be removed from a DCMTree tree with the helper function - see r...
MLDICOMTags_EXPORT void removePrivateTag(DCMTree::TreePtr dcmTree, unsigned char tagIdLowerEightBits, const std::string &privateCreatorString)
MLDICOMTags_EXPORT void resizeToNumberOfSequenceEntries(DCMTree::TagPtr tag, MLint numEntries, std::string &errStr)
MLDICOMTags_EXPORT bool removePixelDataTag(DCMTree::TreePtr treePtr)
MLDICOMTags_EXPORT void removeTag(DCMTree::TreePtr dcmTree, DCMTree::TagId tagId)
MLDICOMTags_EXPORT void initNULLSequenceItemsToEmptyTrees(DCMTree::TagPtr tag, size_t from, size_t to, std::string &errStr)
MLDICOMTags_EXPORT void removePrivateCreatorTag(DCMTree::TreePtr dcmTree, const std::string &privateCreatorString)
OtherTagModificationModes
Available modes for tag modifications.
@ RemoveType3Tags
All toplevel tags known as type 3 only, are removed.
@ OtherTagDoNotModify
No tag is not modified.
@ DropType3SQTagValues
Drop all toplevel sequence tags known as type 3 only.
@ DropType2SQTagValues
Drop all toplevel sequence tags known as type 2 only.
MLDICOMTags_EXPORT void removeEmptyItemsAtEnd(DCMTree::TagPtr seqTagPtr)
MLDICOMTags_EXPORT void removePrivateSMFTreeTags(DCMTree::TreePtr dcmTree, bool alsoRemovePrivateCreator)
MLDICOMTags_EXPORT void removeMaskedTags(DCMTree::TreePtr dcmTree, MLuint32 idVal, MLuint32 idMask)
MLDICOMTags_EXPORT bool removeSpectDataTag(DCMTree::TreePtr treePtr)
Small helper class describing the raw-id of the DICOM tag as well as its human readable name.
MLuint32 id
ID of tag to be described or removed.
const char * name
Human readable name of tag to be described or removed.