Mercurial > hg > orthanc-stone
view Framework/Loaders/LoadedDicomResources.h @ 1352:159708a38af4 broker
Enforce alignment when using PamReader to retrieve REST images,
only in __EMSCRIPTEN__
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 15 Apr 2020 12:58:01 +0200 |
parents | fef1ec42a7db |
children | 30deba7bc8e2 |
line wrap: on
line source
/** * Stone of Orthanc * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium * Copyright (C) 2017-2020 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU Affero General Public License * as published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. **/ #pragma once #include <Core/DicomFormat/DicomMap.h> namespace OrthancStone { /** Stores an indexed collection of DicomMap objects. The index is a user-specified DicomTag. */ class LoadedDicomResources : public boost::noncopyable { private: typedef std::map<std::string, Orthanc::DicomMap*> Resources; Orthanc::DicomTag indexedTag_; Resources resources_; std::vector<Orthanc::DicomMap*> flattened_; void Flatten(); void AddFromDicomWebInternal(const Json::Value& dicomweb); public: LoadedDicomResources(const Orthanc::DicomTag& indexedTag) : indexedTag_(indexedTag) { } // Re-index another set of resources using another tag LoadedDicomResources(const LoadedDicomResources& other, const Orthanc::DicomTag& indexedTag); ~LoadedDicomResources() { Clear(); } const Orthanc::DicomTag& GetIndexedTag() const { return indexedTag_; } void Clear(); size_t GetSize() const { return resources_.size(); } Orthanc::DicomMap& GetResource(size_t index); bool HasResource(const std::string& id) const { return resources_.find(id) != resources_.end(); } void MergeResource(Orthanc::DicomMap& target, const std::string& id) const; bool LookupStringValue(std::string& target, const std::string& id, const Orthanc::DicomTag& tag) const; void AddResource(const Orthanc::DicomMap& dicom); void AddFromOrthanc(const Json::Value& tags); void AddFromDicomWeb(const Json::Value& dicomweb); bool LookupTagValueConsensus(std::string& target, const Orthanc::DicomTag& tag) const; }; }