MeVisLab Toolbox Reference
mlDICOMTreeModificationTools.h File Reference

A collection of tools related to DICOM tags and tree removal and modifications. More...

#include "MLDICOMTagsSystem.h"
#include <ThirdPartyWarningsDisable.h>
#include <string>
#include <vector>
#include <ThirdPartyWarningsRestore.h>
#include <mlUtilsSystem.h>
#include <DCMTree_Lib.h>

Go to the source code of this file.

Classes

struct  ml::DICOMTagTools::DcmTagIdToRemove
 Small helper class describing the raw-id of the DICOM tag as well as its human readable name. More...
 

Namespaces

 ml
 Main documentation file for ML users and developers.
 
 ml::DICOMTagTools
 A namespace collecting tools related to DICOM tags and tree tools.
 

Typedefs

typedef struct ml::DICOMTagTools::DcmTagIdToRemove ml::DICOMTagTools::TagIdDesc
 < Small structure describing a tag to be removed from a DCMTree tree with the helper function - see removeTags. More...
 

Enumerations

enum  ml::DICOMTagTools::OtherTagModificationModes {
  ml::DICOMTagTools::OtherTagDoNotModify = 0 , ml::DICOMTagTools::DropType2SQTagValues , ml::DICOMTagTools::DropType3SQTagValues , ml::DICOMTagTools::ReplaceType2Tags ,
  ml::DICOMTagTools::ReplaceType3Tags , ml::DICOMTagTools::RemoveType3Tags
}
 Available modes for tag modifications. More...
 
enum  { ml::DICOMTagTools::NumOtherTagModificationModes = RemoveType3Tags+1 }
 Defines the number of available modification modes. More...
 

Functions

MLDICOMTags_EXPORT void ml::DICOMTagTools::removeTag (DCMTree::TreePtr dcmTree, DCMTree::TagId tagId)
 Remove the tag with the ID tagId if it exists, otherwise do nothing; (if dcmTree is nullptr the call is ignored). More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removePrivateTag (DCMTree::TreePtr dcmTree, unsigned char tagIdLowerEightBits, const std::string &privateCreatorString)
 Remove the tag whose lower eight bits of its id is tagIdLowerEightBits and whose private creator has the string privateCreatorString. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removePrivateCreatorTag (DCMTree::TreePtr dcmTree, const std::string &privateCreatorString)
 Remove the private Creator tag with string value privateCreatorString; if not found or nullptr dcmTree, the call will be a no-op. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removePrivateSMFTreeTags (DCMTree::TreePtr dcmTree, bool alsoRemovePrivateCreator)
 Removes the three private tags dimensionsOffset, dimensionSequenceOffset and frameIndexOffset of private creator DCMTree::StructuredMF::privateCreator; if alsoRemovePrivateCreator is true then the private creator tag itself is also removed. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removePrivateTagGroup (DCMTree::TreePtr dcmTree, bool removeAllPrivateTags=false, const std::string &privateCreatorString="")
 Removes all tags from dcmTree which belong to a PrivateCreator privateCreatorString. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removeType3Tags (DCMTree::TreePtr dcmTree)
 Removes all type 3 (sequence and non-sequence) tags from dcmTree as far as such tags are known as only type 3; note that the tables about valid type 3 tags may be incomplete or unsafe, therefore use this function with care; the call is ignored if dcmTree is nullptr. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removeTags (DCMTree::TreePtr resultTree, const DcmTagIdToRemove srcTagsToRemove[])
 Remove the top level tags given by srcTagsToRemove from tree. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removeMaskedTags (DCMTree::TreePtr dcmTree, MLuint32 idVal, MLuint32 idMask)
 Remove all tags from the dcmTree whose ids & idMask == idVal. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::recursiveRemoveTags (DCMTree::TreePtr &dcmTree, const std::vector< DCMTree::TagId > &listOfIdsToRemove)
 Remove recursively all appearances of any tags with ids in listOfIdsToRemove from dcmTree. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removeEmptyItemsAtEnd (DCMTree::TagPtr seqTagPtr)
 As long as empty items or items with a tree with zero tags are found at the end of the sequence they are removed. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::recursiveSequenceTagCleanUp (DCMTree::TagPtr seqTagPtr)
 Ignores the call if tagPtr is a normal tag or nullptr; if it is a sequence tag then it calls recursiveSequenceTagCleanUp(DCMTree::TreePtr) on each of its entries, however, it does not remove any sequence items directly in seqTagPtr even if they become empty after cleanup. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::recursiveSequenceTagCleanUp (DCMTree::TreePtr treePtr)
 Does nothing if treePtr is nullptr, otherwise it recursively removes all entries at the end of all sequence tags which are empty or which have a tree with zero tags in treePtr. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::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)
 Scans the DICOM tree given with treePtr and replaces all values of the tags with id tagId with newVal. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::removePrivateMultiFrameTag (DCMTree::TreePtr &treePtr)
 If the passed tree contains a private MeVis sequence tag with DICOM frame information then the tag will be removed including all other tags of the same private slot. More...
 
MLDICOMTags_EXPORT bool ml::DICOMTagTools::removePixelDataTag (DCMTree::TreePtr treePtr)
 Removes the first top level [[Double]Float]Pixel data data tag DCMTree_[[Double]Float]PixelData from the treePtr if it can be found. More...
 
MLDICOMTags_EXPORT bool ml::DICOMTagTools::removeAllTypesPixelDataTags (DCMTree::TreePtr treePtr)
 Removes all top level pixel data data tags from treePtr if there are any by using the functions removePixelDataTag, removeSpectDataTag, and removeREGDataTag as long as no more top level tags are found. More...
 
MLDICOMTags_EXPORT bool ml::DICOMTagTools::removeSpectDataTag (DCMTree::TreePtr treePtr)
 Removes the first top level spectroscopy data tag (0x7fe1, 0x1010) or - if that one does not exist - the tag (0x5600, 0x0020). More...
 
MLDICOMTags_EXPORT bool ml::DICOMTagTools::removeREGDataTag (DCMTree::TreePtr treePtr)
 Removes the first found REG modality VectorGridData tag (0x7fe1, 0x1010) from treePtr which is searched from top level under. More...
 
MLDICOMTags_EXPORT std::vector< DCMTree::RawTagIdml::DICOMTagTools::removeLargeTags (DCMTree::TreePtr treePtr, size_t tagSizeToRemove=0x00040000)
 Removes all top-level tags from the tree which are larger than the given tag size and return a vector of ids of tags which have been removed. More...
 
MLDICOMTags_EXPORT DCMTree::TreePtr ml::DICOMTagTools::getSequenceItemTree (DCMTree::TagPtr tagPtr, size_t itemIdx)
 Returns the DCMTree of the sequence item itemIdx of the DICOM tag given by tagPtr. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::manipulateType2Or3Tags (DCMTree::TreePtr dcmTree, OtherTagModificationModes modificationMode, const std::string &modStrVal)
 On top level of dcmTree apply dropping of sequence entries, or replace or remove operations on type 2 or 3 tags as far as current tags tables have the knowledge about such tags; note that the tables about valid type 2 or 3 tags may be incomplete or unsafe, therefore use this function with care; the call is ignored if dcmTree is nullptr. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::initNULLSequenceItemsToEmptyTrees (DCMTree::TagPtr tag, size_t from, size_t to, std::string &errStr)
 Initialize NULL sequence entries in range [from, to[ with default trees, because many tree operations expect at least empty trees but fail with NULL entries; any error will be appended as textual description to errStr which is left unchanged in case of success. More...
 
MLDICOMTags_EXPORT void ml::DICOMTagTools::resizeToNumberOfSequenceEntries (DCMTree::TagPtr tag, MLint numEntries, std::string &errStr)
 Resizes the sequence in tag to the number of entries given in modificationValue; any error will be appended as textual description to errStr which is left unchanged in case of success. More...
 

Variables

MLDICOMTags_EXPORT const char *const ml::DICOMTagTools::OtherTagModificationModesStrings [NumOtherTagModificationModes]
 String versions for OtherTagModificationModes. More...
 

Detailed Description

A collection of tools related to DICOM tags and tree removal and modifications.

Author
Wolf Spindler.
Date
07/2013

Definition in file mlDICOMTreeModificationTools.h.