MeVisLab Toolbox Reference
mlDicomCIDEditTagInterface.h
Go to the documentation of this file.
1 // Copyright (c) Fraunhofer MEVIS, Germany. All rights reserved.
2 // **InsertLicense** code
3 //----------------------------------------------------------------------------------
6 
11 //----------------------------------------------------------------------------------
12 #pragma once
13 
16 #include <DICOMPart16Tables.h>
17 
18 ML_START_NAMESPACE
19 
20 //----------------------------------------------------------------------------------
22 //----------------------------------------------------------------------------------
24 {
25 public:
45  const char * const CIDGroupTable[][CIDGroups::NUM_CID_COLUMNS],
46  size_t CIDGroupTableSize,
47  const std::string &sequenceName,
48  size_t numAllowedEntries,
49  bool zeroEntriesAllowed,
50  const std::string &cidEntryDefault="");
51 
53  void addFields() override;
54 
57  virtual void setCIDEntryDefault();
58 
61 
64 
66  void inheritValues(DCMTree::Const_TreePtr dcmTree) override;
67 
69  std::string applyModifications(DCMTree::TreePtr dcmTree,
70  const FieldContainer *treeInfos=nullptr) override;
71 
73  std::string checkConsistency() const override;
74 
77 
80  void setActive(bool active);
81 
83  bool isActive() const;
84 
88 
89  // Definition only for tests:
90 #ifndef DicomCIDEditTagInterface_DEACTIVATE_PROTECTION
91  protected:
92 #endif
95 
99 
102 
105 
108 
112 
113 #ifndef DicomCIDEditTagInterface_DEACTIVATE_PROTECTION
114  private:
115 #endif
118 
120  const char * const (*_CIDGroupTable)[CIDGroups::NUM_CID_COLUMNS];
121 
123  const size_t _CIDGroupTableSize;
124 
126  const std::string _sequenceName;
127 
129  const size_t _numAllowedEntries;
130 
132  const bool _zeroEntriesAllowed;
133 
135  const std::string _cidEntryDefault;
137 
140  BoolField *_makeCIDEditGUIInsensitiveFld;
141 
144  bool _isActive;
145 };
146 
147 ML_END_NAMESPACE
Tables containing DICOM tables from Part 16.
Project global and OS specific declarations.
#define MLDICOMTAGINTERFACES_EXPORT
DLL export macro definition.
Field to encapsulate a boolean value.
Definition: mlFields.h:62
Manages a module field interface to edit a list of CID value from a given table.
EnumField * _cidEntryFld
Enumerator field selecting one of the entries of the CIDGroupTable.
std::string checkConsistency() const override
Checks for invalid parameters; return textual description on error, or empty string on success.
NotifyField * _clearFld
Removes all entries from _contextGroupSequenceFld.
BoolField & getMakeGUIInsensitiveFld()
Return reference to _makeGUIInsensitiveFld to allow modules hosting this add to change sensitivity.
NotifyField * _prependEntryFld
Inserts the selected entry at first position to _contextGroupSequenceFld.
void handleFieldActivationChanges() override
Handle class changes according to Module::activateAttachments.
std::string applyModifications(DCMTree::TreePtr dcmTree, const FieldContainer *treeInfos=nullptr) override
See DicomModifyFieldAddOnBase::applyModifications() for documentation.
void inheritValues(DCMTree::Const_TreePtr dcmTree) override
Implements the copy of tag values from the given dcmTree to the fields.
DicomCIDEditTagInterface(Module &modRef, const char *const CIDGroupTable[][CIDGroups::NUM_CID_COLUMNS], size_t CIDGroupTableSize, const std::string &sequenceName, size_t numAllowedEntries, bool zeroEntriesAllowed, const std::string &cidEntryDefault="")
Constructor, setting the reference of the module for which the fields shall be managed.
virtual void setCIDEntryDefault()
Initializes _cidEntryFld to the default value as described for constructor parameter cidEntryDefault ...
bool isActive() const
Returns true if FieldAddOn is active,,otherwise false.
NotifyField * _appendEntryFld
Appends the selected entry to _contextGroupSequenceFld.
ReleaseToolsString::StringVector getCodeSequence() const
Returns the sequence of codes which is managed by the editor as string vector; always returns an empt...
void setActive(bool active)
Sets flag which (de)activates this FieldAddOn; if deactivated: checkConsistency always returns an emp...
FieldAddOnBase::FieldChangeState handleFieldChanges(Field *field) override
Handle field notifications according to Module::activateAttachments with a return of field change sta...
StringField * _contextGroupSequenceFld
The string containing the composition of CID entries separated by "/"; it is the field which typica...
void addFields() override
Add fields to field container of module.
The class DicomModifyFieldAddOnBase is dedicated to manage fields for ML modules and instances derive...
Field to encapsulate an enumerated value.
Definition: mlFields.h:363
FieldChangeState
Describes the type of a field changes detected in handleFieldChanges(Field *field).
Defines the class FieldContainer to encapsulate a vector of fields for (see class Field).
Base class for all fields used in the ML.
Definition: mlField.h:73
Base class for an image processing module of the ML.
Definition: mlModule.h:156
Field without value for notifications.
Definition: mlFields.h:1049
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
std::vector< std::string > StringVector
Define often used string vector type.