Mercurial > hg > orthanc
diff OrthancServer/FromDcmtkBridge.h @ 948:e57e08ed510f dicom-rt
integration mainline -> dicom-rt
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Jun 2014 13:57:05 +0200 |
parents | 8cfc6119a5bd 87791ebc1f50 |
children |
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.h Wed Apr 16 16:15:58 2014 +0200 +++ b/OrthancServer/FromDcmtkBridge.h Wed Jun 25 13:57:05 2014 +0200 @@ -32,98 +32,15 @@ #pragma once -#include "../Core/DicomFormat/DicomInstanceHasher.h" -#include "../Core/RestApi/RestApiOutput.h" -#include "../Core/Toolbox.h" +#include "ServerEnumerations.h" + +#include "../Core/DicomFormat/DicomMap.h" #include <dcmtk/dcmdata/dcdatset.h> -#include <dcmtk/dcmdata/dcfilefo.h> #include <json/json.h> -#include <memory> namespace Orthanc { - enum DicomRootLevel - { - DicomRootLevel_Patient, - DicomRootLevel_Study, - DicomRootLevel_Series, - DicomRootLevel_Instance - }; - - enum DicomReplaceMode - { - DicomReplaceMode_InsertIfAbsent, - DicomReplaceMode_ThrowIfAbsent, - DicomReplaceMode_IgnoreIfAbsent - }; - - class ParsedDicomFile : public IDynamicObject - { - private: - std::auto_ptr<DcmFileFormat> file_; - - ParsedDicomFile(DcmFileFormat& other) : - file_(dynamic_cast<DcmFileFormat*>(other.clone())) - { - } - - void Setup(const char* content, - size_t size); - - public: - typedef std::list< std::pair<DicomTag, unsigned int> > SequencePath; - - ParsedDicomFile(const char* content, - size_t size) - { - Setup(content, size); - } - - ParsedDicomFile(const std::string& content) - { - if (content.size() == 0) - Setup(NULL, 0); - else - Setup(&content[0], content.size()); - } - - DcmFileFormat& GetDicom() - { - return *file_; - } - - ParsedDicomFile* Clone() - { - return new ParsedDicomFile(*file_); - } - - void SendPathValue(RestApiOutput& output, - const UriComponents& uri); - - void Answer(RestApiOutput& output); - - void Remove(const DicomTag& tag); - - void Insert(const DicomTag& tag, - const std::string& value); - - void Replace(const DicomTag& tag, - const std::string& value, - DicomReplaceMode mode); - - void RemovePrivateTags(); - - bool GetTagValue(std::string& value, - const DicomTag& tag); - - bool GetTagValue(std::string& value, - const SequencePath& path, - const DicomTag& tag); - - DicomInstanceHasher GetHasher(); - }; - class FromDcmtkBridge { public: @@ -141,16 +58,6 @@ const std::string& path, unsigned int maxStringLength = 256); - static void ExtractPngImage(std::string& result, - DcmDataset& dataset, - unsigned int frame, - ImageExtractionMode mode); - - static void ExtractPngImage(std::string& result, - const std::string& dicomContent, - unsigned int frame, - ImageExtractionMode mode); - static std::string GetName(const DicomTag& tag); static DicomTag ParseTag(const char* name); @@ -185,7 +92,7 @@ static void ToJson(Json::Value& result, const DicomMap& values); - static std::string GenerateUniqueIdentifier(DicomRootLevel level); + static std::string GenerateUniqueIdentifier(ResourceType level); static bool SaveToMemoryBuffer(std::string& buffer, DcmDataset* dataSet);