comparison Plugins/Engine/OrthancPlugins.cpp @ 3710:1c69af37d8ae storage-commitment

integration mainline->storage-commitment
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 28 Feb 2020 13:27:16 +0100
parents 898903022836 1f4910999fe7
children 56f2397f027a
comparison
equal deleted inserted replaced
3707:bf8f17f23c26 3710:1c69af37d8ae
3047 } 3047 }
3048 3048
3049 std::string dicom; 3049 std::string dicom;
3050 3050
3051 { 3051 {
3052 // Fix issue 168 (Plugins can't read private tags from the
3053 // configuration file)
3054 // https://bitbucket.org/sjodogne/orthanc/issues/168/
3055 std::string privateCreator;
3056 {
3057 OrthancConfiguration::ReaderLock lock;
3058 privateCreator = lock.GetConfiguration().GetDefaultPrivateCreator();
3059 }
3060
3052 std::auto_ptr<ParsedDicomFile> file 3061 std::auto_ptr<ParsedDicomFile> file
3053 (ParsedDicomFile::CreateFromJson(json, static_cast<DicomFromJsonFlags>(p.flags), 3062 (ParsedDicomFile::CreateFromJson(json, static_cast<DicomFromJsonFlags>(p.flags),
3054 "" /* TODO - private creator */)); 3063 privateCreator));
3055 3064
3056 if (p.pixelData) 3065 if (p.pixelData)
3057 { 3066 {
3058 file->EmbedImage(*reinterpret_cast<const ImageAccessor*>(p.pixelData)); 3067 file->EmbedImage(*reinterpret_cast<const ImageAccessor*>(p.pixelData));
3059 } 3068 }
3222 3231
3223 DicomTag tag(FromDcmtkBridge::ParseTag(p.name)); 3232 DicomTag tag(FromDcmtkBridge::ParseTag(p.name));
3224 DcmTagKey tag2(tag.GetGroup(), tag.GetElement()); 3233 DcmTagKey tag2(tag.GetGroup(), tag.GetElement());
3225 3234
3226 DictionaryReadLocker locker; 3235 DictionaryReadLocker locker;
3227 const DcmDictEntry* entry = locker->findEntry(tag2, NULL); 3236 const DcmDictEntry* entry = NULL;
3237
3238 if (tag.IsPrivate())
3239 {
3240 // Fix issue 168 (Plugins can't read private tags from the
3241 // configuration file)
3242 // https://bitbucket.org/sjodogne/orthanc/issues/168/
3243 std::string privateCreator;
3244 {
3245 OrthancConfiguration::ReaderLock lock;
3246 privateCreator = lock.GetConfiguration().GetDefaultPrivateCreator();
3247 }
3248
3249 entry = locker->findEntry(tag2, privateCreator.c_str());
3250 }
3251 else
3252 {
3253 entry = locker->findEntry(tag2, NULL);
3254 }
3228 3255
3229 if (entry == NULL) 3256 if (entry == NULL)
3230 { 3257 {
3231 throw OrthancException(ErrorCode_UnknownDicomTag); 3258 throw OrthancException(ErrorCode_UnknownDicomTag);
3232 } 3259 }