MeVisLab Toolbox Reference
mlDicomContentDateTimeTagInterface.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
15#include "DCMTree_DicomTags.h"
16
17ML_START_NAMESPACE
18
19//----------------------------------------------------------------------------------
21//----------------------------------------------------------------------------------
23{
24public:
27 bool allowEmptyStrings=true,
28 bool allowOldFormats=true,
29 const std::string &contentDateFieldName="contentDate",
30 const std::string &contentTimeFieldName="contentTime",
31 const std::string &msgContentDateFieldName="Content Date",
32 const std::string &msgContentTimeFieldName="Content Time",
33 const DCMTree::RawTagId dateTagId = DCMTree_ContentDate,
34 const DCMTree::RawTagId timeTagId = DCMTree_ContentTime);
35
37 void addFields() override;
38
40 void inheritValues(DCMTree::Const_TreePtr dcmTree) override;
41
44 const FieldContainer *treeInfos=nullptr) override;
45
47 std::string checkConsistency() const override;
48
54 const std::string &getContentDateMessage() const { return _msgContentDateFieldName; }
55 const std::string &getContentTimeMessage() const { return _msgContentTimeFieldName; }
57
58protected:
64
65 // Other members.
68
70 const bool _allowOldFormats;
71
73 const std::string _contentDateFieldName;
74
76 const std::string _contentTimeFieldName;
77
79 const std::string _msgContentDateFieldName;
80
82 const std::string _msgContentTimeFieldName;
83
86
89};
90
91ML_END_NAMESPACE
#define DCMTree_ContentTime
#define DCMTree_ContentDate
Project global and OS specific declarations.
#define MLDICOMTAGINTERFACES_EXPORT
DLL export macro definition.
DicomContentDateTimeTagInterface(Module &modRef, bool allowEmptyStrings=true, bool allowOldFormats=true, const std::string &contentDateFieldName="contentDate", const std::string &contentTimeFieldName="contentTime", const std::string &msgContentDateFieldName="Content Date", const std::string &msgContentTimeFieldName="Content Time", const DCMTree::RawTagId dateTagId=DCMTree_ContentDate, const DCMTree::RawTagId timeTagId=DCMTree_ContentTime)
Constructor, setting the reference of the module for which the fields shall be managed.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
See DicomModifyFieldAddOnBase::applyModifications() for documentation.
StringField & getContentDateFld()
Provide access to fields and tag ids; for documentation see corresponding fields.
const std::string _contentTimeFieldName
The constructor defined name to be used for the _contentTimeFld.
const std::string _msgContentDateFieldName
The constructor defined name to be used for the content date in messages.
void inheritValues(DCMTree::Const_TreePtr dcmTree) override
Implements the copy of tag values from the given dcmTree to the fields.
const std::string _contentDateFieldName
The constructor defined name to be used for the _contentDateFld.
const bool _allowOldFormats
If true then old date specification formats are allowed, otherwise not.
const bool _allowEmptyStrings
If true then empty strings in date/time settings are allowed, otherwise not.
const DCMTree::RawTagId _contentDateTagId
The constructor defined tag id to be used for the content date.
const DCMTree::RawTagId _contentTimeTagId
The constructor defined tag id to be used for the content time.
const std::string _msgContentTimeFieldName
The constructor defined name to be used for the content time in messages.
void addFields() override
Add fields to field container of module.
std::string checkConsistency() const override
Checks for invalid parameters; return textual description on error, or empty string on success.
StringField * _contentTimeFld
Content of the corresponding DICOM tag definition.
DicomModifyFieldAddOnBase(FieldContainer &fieldContainerRef, size_t numInstances=1, bool createInputModifyTagsPluginBaseConnectorField=false, bool createOutputModifyTagsPluginBaseConnectorField=false)
boost::shared_ptr< const Tree > Const_TreePtr
Definition DCMTree_Lib.h:67
boost::shared_ptr< Tree > TreePtr
Shared pointer to a DCMTree::Tree.
Definition DCMTree_Lib.h:66
unsigned int RawTagId