MeVisLab Toolbox Reference
mlDicomTreeImagePropertyExtension.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2007, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 #ifndef ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_H
14 #define ML_DICOM_TREE_IMAGE_PROPERTY_EXTENSION_H
15 
18 
19 // Resolve platform independencies.
21 
23 
24 // Include DicomTree support for the ML.
25 #include "DCMTree_Dict.h"
26 #include "DCMTree_Tree.h"
27 
28 // These header files are not necessary here, but are usually needed by files
29 // including this header.
30 #include <DCMTree_Exception.h>
31 #include <DCMTree_Tag.h>
32 
33 
34 ML_UTILS_START_NAMESPACE
35 
36  // -------------------------------------------------------------------
42  // -------------------------------------------------------------------
44  {
45  public:
46 
49 
52 
54  DicomTreeImagePropertyExtension(const DCMTree::Const_TreePtr &initDCMTree, const std::string& fileName);
55 
58 
61 
63  const std::string& getFileName() const;
64 
66  void setFileName(const std::string& fileName);
67 
70 
73 
75  bool equals(const ImagePropertyExtension &imgPropExt) const override;
76 
79 
81  std::string getValueAsString() const override;
82 
84  void getValueAsString(std::string &valueAsString) const override;
85 
88  MLErrorCode setValueFromString(const std::string &str) override;
89 
90  private:
93  DCMTree::Const_TreePtr _dcmTreeSharedPtr;
94 
96  std::string _fileName;
97 
100  };
101 
102 ML_UTILS_END_NAMESPACE
103 
104 #endif // __mlDicomTreeImagePropertyExtension_H
105 
106 
#define MLDICOM_TREE_IMAGE_PROPERTY_EXTENSION_EXPORT
Global and OS specific declarations for the MLDicomTreeImagePropertyExtension project.
Implement an ImagePropertyExtension object which can be passed to the ML.
~DicomTreeImagePropertyExtension() override
Destructor.
bool equals(const ImagePropertyExtension &imgPropExt) const override
Equality operation.
const std::string & getFileName() const
Returns the filename from which the dicom tree was originally loaded.
DicomTreeImagePropertyExtension(const DCMTree::Const_TreePtr &initDCMTree, const std::string &fileName)
Convenience constructor.
void getValueAsString(std::string &valueAsString) const override
Alternative version to get the object as string which can be faster and less memory intensive on larg...
MLErrorCode setValueFromString(const std::string &str) override
Set value of property from string value and return ML_RESULT_OK on success or another MLErrorCode on ...
void setFileName(const std::string &fileName)
Sets the filename that should be associated with the dicom tree.
void setDicomTagTree(const DCMTree::Const_TreePtr &newTree)
Set new shared DICOM tree object.
const DCMTree::Const_TreePtr & getDicomTagTree() const
Return pointer to the shared DICOM tree object.
DicomTreeImagePropertyExtension & operator=(const DicomTreeImagePropertyExtension &origObj)
Assignment operator.
std::string getValueAsString() const override
Return value of object as string.
DicomTreeImagePropertyExtension(const DicomTreeImagePropertyExtension &origObj)
Copy constructor.
ImagePropertyExtension * createClone() const override
Create a copy of this object.
Base class from which one can derive own image properties.
MLint32 MLErrorCode
Type of an ML Error code.
Definition: mlTypeDefs.h:818
#define ML_CLASS_HEADER(className)
Same like ML_CLASS_HEADER_EXPORTED with a non existing export symbol.
boost::shared_ptr< const Tree > Const_TreePtr
Definition: DCMTree_Lib.h:73