MeVisLab Toolbox Reference
ml::DicomModifyPrivateRemove Class Reference

#include <mlDicomModifyPrivateRemove.h>

Inheritance diagram for ml::DicomModifyPrivateRemove:
ml::DicomModifyBase

Public Types

enum  ModificationModes { DoNotModify = 0 , RemoveTag , RemoveEntirePrivateCreatorGroup , RemoveAllPrivateTags }
 Available modes for tag/tree modifications. More...
enum  { NumModificationModes = RemoveAllPrivateTags+1 }
 Defines the number of available modification modes. More...

Public Member Functions

 DicomModifyPrivateRemove (DCMTree::TagId tagId=DCMTree::TagId(), const std::string &modStrVal="", ModificationModes modMode=DoNotModify, const std::string &privateCreator="")
 Constructor setting setting TagId, ModificationStringValue, and ModificationMode.
void setModificationMode (ModificationModes modMode)
 Sets how the tag with given id and modification value shall be modified.
ModificationModes getModificationMode () const
 Returns the currently set modification mode.
void setPrivateCreator (const std::string &privateCreator)
 Sets the private creator string.
const std::string & getPrivateCreator () const
 Returns the currently set private creator string.
void setModificationParameters (DCMTree::TagId tagId, const std::string &modStrVal, ModificationModes modMode, const std::string &privateCreator)
void removePrivateTag (DCMTree::TreePtr dcmTree, unsigned char tagIdLowerEightBits, const std::string &privateCreatorString) const
 See DICOMTagTools::removePrivateTag().
std::string applyModifications (DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
Public Member Functions inherited from ml::DicomModifyBase
 DicomModifyBase (DCMTree::TagId tagId=DCMTree::TagId(), const std::string &modStrVal="")
 Constructor setting the tag ID and the string value for modifications.
 DicomModifyBase (const DicomModifyBase &)=default
 Default copy constructor.
DicomModifyBaseoperator= (const DicomModifyBase &)=default
 Default assignment operator.
virtual ~DicomModifyBase ()
 Virtual destructor.
void setTagId (DCMTree::TagId tagId)
 Set the id of the tag to be modified.
void setTagId (const std::string &tagIdStr)
DCMTree::TagId getTagId () const
void setModificationStringValue (const std::string &modStrVal)
const std::string & getModificationStringValue () const
bool getModificationStringValueAsMLInt (MLint &retVal) const
void setTagIdAndModificationStringValue (DCMTree::TagId tagId, const std::string &modStrVal)
 Calls setTagId(tagId) and setModificationStringValue(modStrVal).
bool tagExists (DCMTree::TreePtr dcmTree) const
DCMTree::TagPtr getTagIfItExists (DCMTree::TreePtr dcmTree, std::string *errStr=nullptr) const
DCMTree::TagPtr addTag (DCMTree::TreePtr dcmTree, std::string *errStr=nullptr, bool setValue=true, bool splitValue=false) const
void removeTag (DCMTree::TreePtr dcmTree) const
void setTagValue (DCMTree::TreePtr dcmTree, std::string *errStr=nullptr, const DICOMTagTools::ValueModifyModes modMode=DICOMTagTools::Replace, bool splitValue=false) const

Static Public Attributes

static const char *const ModificationModesStrings [NumModificationModes]
 String versions for ModificationModes.

Detailed Description

A concrete class derived from DicomModifyBase which allows the removal of non-ordinary, non-sequence, private DICOM tags in a (cloned) DICOM tree.

Definition at line 25 of file mlDicomModifyPrivateRemove.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Defines the number of available modification modes.

Enumerator
NumModificationModes 

Definition at line 37 of file mlDicomModifyPrivateRemove.h.

◆ ModificationModes

Available modes for tag/tree modifications.

Enumerator
DoNotModify 

No change is applied to the tree.

RemoveTag 

The tag with id and the given private creator is removed.

RemoveEntirePrivateCreatorGroup 

All tags belonging to the given private creator are removed.

RemoveAllPrivateTags 

All private tags are removed from _dcmTree.

Definition at line 29 of file mlDicomModifyPrivateRemove.h.

Constructor & Destructor Documentation

◆ DicomModifyPrivateRemove()

ml::DicomModifyPrivateRemove::DicomModifyPrivateRemove ( DCMTree::TagId tagId = DCMTree::TagId(),
const std::string & modStrVal = "",
ModificationModes modMode = DoNotModify,
const std::string & privateCreator = "" )

Constructor setting setting TagId, ModificationStringValue, and ModificationMode.

References DoNotModify.

Member Function Documentation

◆ applyModifications()

std::string ml::DicomModifyPrivateRemove::applyModifications ( DCMTree::TreePtr dcmTree,
const FieldContainer * treeInfos = nullptr )
overridevirtual

Apply a change to dcmTree according to the currently selected _modificationMode.

Parameters
dcmTreeThe DICOM tree to be modified.
treeInfosA FieldContainer which - if not nullptr - can contain additional user defined information fields about dcmTree.
Returns
An empty string on success, otherwise a cumulative descriptive string of all problems.

Reimplemented from ml::DicomModifyBase.

◆ getModificationMode()

ModificationModes ml::DicomModifyPrivateRemove::getModificationMode ( ) const

Returns the currently set modification mode.

◆ getPrivateCreator()

const std::string & ml::DicomModifyPrivateRemove::getPrivateCreator ( ) const

Returns the currently set private creator string.

◆ removePrivateTag()

void ml::DicomModifyPrivateRemove::removePrivateTag ( DCMTree::TreePtr dcmTree,
unsigned char tagIdLowerEightBits,
const std::string & privateCreatorString ) const

◆ setModificationMode()

void ml::DicomModifyPrivateRemove::setModificationMode ( ModificationModes modMode)

Sets how the tag with given id and modification value shall be modified.

◆ setModificationParameters()

void ml::DicomModifyPrivateRemove::setModificationParameters ( DCMTree::TagId tagId,
const std::string & modStrVal,
ModificationModes modMode,
const std::string & privateCreator )

Calls setTagId(tagId), setModificationStringValue(modStrVal), setModificationMode(modMode), and setPrivateCreator(privateCreator).

◆ setPrivateCreator()

void ml::DicomModifyPrivateRemove::setPrivateCreator ( const std::string & privateCreator)

Sets the private creator string.

Member Data Documentation

◆ ModificationModesStrings

const char* const ml::DicomModifyPrivateRemove::ModificationModesStrings[NumModificationModes]
static

String versions for ModificationModes.

Definition at line 40 of file mlDicomModifyPrivateRemove.h.


The documentation for this class was generated from the following file: