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 
54 
55  // Other members.
57  const bool _allowEmptyStrings;
58 
60  const bool _allowOldFormats;
61 
63  const std::string _contentDateFieldName;
64 
66  const std::string _contentTimeFieldName;
67 
69  const std::string _msgContentDateFieldName;
70 
72  const std::string _msgContentTimeFieldName;
73 
76 
79 };
80 
81 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.
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 for (see class Field).
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field to encapsulate a string value.
Definition: mlFields.h:1000
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:73
boost::shared_ptr< Tree > TreePtr
shared pointer to a DCMTree::Tree
Definition: DCMTree_Lib.h:70
unsigned int RawTagId
Definition: DCMTree_Lib.h:147