comparison Resources/Orthanc/Plugins/Samples/Common/DicomDatasetReader.h @ 32:517c46f527cd

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 19 Dec 2016 11:00:23 +0100
parents 9aace933cb64
children 7207a407bcd8
comparison
equal deleted inserted replaced
31:9aace933cb64 32:517c46f527cd
33 #pragma once 33 #pragma once
34 34
35 #include "IDicomDataset.h" 35 #include "IDicomDataset.h"
36 36
37 #include <memory> 37 #include <memory>
38 #include <vector>
38 39
39 namespace OrthancPlugins 40 namespace OrthancPlugins
40 { 41 {
41 class DicomDatasetReader : public boost::noncopyable 42 class DicomDatasetReader : public boost::noncopyable
42 { 43 {
43 private: 44 private:
44 std::auto_ptr<IDicomDataset> dataset_; 45 const IDicomDataset& dataset_;
45 46
46 public: 47 public:
47 DicomDatasetReader(IDicomDataset* dataset); // takes ownership 48 DicomDatasetReader(const IDicomDataset& dataset);
48 49
49 IDicomDataset& GetDataset() const 50 const IDicomDataset& GetDataset() const
50 { 51 {
51 return *dataset_; 52 return dataset_;
52 } 53 }
54
55 std::string GetStringValue(const DicomPath& path,
56 const std::string& defaultValue) const;
53 57
54 std::string GetMandatoryStringValue(const DicomPath& path) const; 58 std::string GetMandatoryStringValue(const DicomPath& path) const;
55 59
56 int GetIntegerValue(const DicomPath& path); 60 bool GetIntegerValue(int& target,
61 const DicomPath& path) const;
57 62
58 unsigned int GetUnsignedIntegerValue(const DicomPath& path); 63 bool GetUnsignedIntegerValue(unsigned int& target,
64 const DicomPath& path) const;
65
66 bool GetFloatValue(float& target,
67 const DicomPath& path) const;
68
69 bool GetDoubleValue(double& target,
70 const DicomPath& path) const;
59 }; 71 };
60 } 72 }