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 
17 ML_START_NAMESPACE
18 
19 //----------------------------------------------------------------------------------
21 //----------------------------------------------------------------------------------
23 {
24 public:
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 
43  std::string applyModifications(DCMTree::TreePtr dcmTree,
44  const FieldContainer *treeInfos=nullptr) override;
45 
47  std::string checkConsistency() const override;
48 
50  StringField &getContentDateFld() { return *_contentDateFld; }
51  StringField &getContentTimeFld() { return *_contentTimeFld; }
52  DCMTree::RawTagId getContentDateTagId() const { return _contentDateTagId; }
53  DCMTree::RawTagId getContentTimeTagId() const { return _contentTimeTagId; }
54  const std::string &getContentDateMessage() const { return _msgContentDateFieldName; }
55  const std::string &getContentTimeMessage() const { return _msgContentTimeFieldName; }
57 
58 protected:
64 
65  // Other members.
67  const bool _allowEmptyStrings;
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 
91 ML_END_NAMESPACE
#define DCMTree_ContentTime
#define DCMTree_ContentDate
Project global and OS specific declarations.
#define MLDICOMTAGINTERFACES_EXPORT
DLL export macro definition.
Manages the module field interface according to DICOM ContentDate and ContentTime tags.
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.
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.
StringField & getContentDateFld()
Provide access to fields and tag ids; for documentation see corresponding fields.
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.
The class DicomModifyFieldAddOnBase is dedicated to manage fields for ML modules and instances derive...
Defines the class FieldContainer to encapsulate a vector of fields (see class Field).
Base class for an image processing module of the ML.
Definition: mlModule.h:151
Field to encapsulate a string value.
Definition: mlFields.h:553
Header file of the DicomModifyFieldAddOnBase class dedicated to manage fields for ML modules and inst...
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:64
unsigned int RawTagId
Definition: DCMTree_Lib.h:141