# HG changeset patch # User Sebastien Jodogne # Date 1559021590 -7200 # Node ID a6c590cb8181cbd82a4ef393f6b81d865b298317 # Parent 0528a6c36f3d12f4890a9a09f3a4d7db7021de4e OrthancPlugins::DicomPath::SetPrefixIndex() diff -r 0528a6c36f3d -r a6c590cb8181 Plugins/Samples/Common/DicomPath.cpp --- a/Plugins/Samples/Common/DicomPath.cpp Thu May 23 12:06:26 2019 +0200 +++ b/Plugins/Samples/Common/DicomPath.cpp Tue May 28 07:33:10 2019 +0200 @@ -50,6 +50,19 @@ } + DicomPath::Prefix& DicomPath::GetPrefixItem(size_t depth) + { + if (depth >= prefix_.size()) + { + ORTHANC_PLUGINS_THROW_EXCEPTION(ParameterOutOfRange); + } + else + { + return prefix_[depth]; + } + } + + DicomPath::DicomPath(const DicomTag& sequence, size_t index, const DicomTag& tag) : diff -r 0528a6c36f3d -r a6c590cb8181 Plugins/Samples/Common/DicomPath.h --- a/Plugins/Samples/Common/DicomPath.h Thu May 23 12:06:26 2019 +0200 +++ b/Plugins/Samples/Common/DicomPath.h Tue May 28 07:33:10 2019 +0200 @@ -50,6 +50,8 @@ const Prefix& GetPrefixItem(size_t depth) const; + Prefix& GetPrefixItem(size_t depth); + public: DicomPath(const DicomTag& finalTag) : finalTag_(finalTag) @@ -94,6 +96,12 @@ { return GetPrefixItem(depth).second; } + + void SetPrefixIndex(size_t depth, + size_t value) + { + GetPrefixItem(depth).second = value; + } const DicomTag& GetFinalTag() const {