diff Core/DicomParsing/ParsedDicomFile.cpp @ 4007:884b55ce01f6

Private tags returned by C-FIND SCP
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 06 Jun 2020 14:50:21 +0200
parents 3d2fc1b5cc8c
children 914b15dedae3
line wrap: on
line diff
--- a/Core/DicomParsing/ParsedDicomFile.cpp	Sat Jun 06 11:21:39 2020 +0200
+++ b/Core/DicomParsing/ParsedDicomFile.cpp	Sat Jun 06 14:50:21 2020 +0200
@@ -1001,10 +1001,11 @@
 
   void ParsedDicomFile::CreateFromDicomMap(const DicomMap& source,
                                            Encoding defaultEncoding,
-                                           bool permissive)
+                                           bool permissive,
+                                           const std::string& privateCreator)
   {
     pimpl_->file_.reset(new DcmFileFormat);
-    pimpl_->frameIndex_.reset(NULL);
+    InvalidateCache();
 
     const DicomValue* tmp = source.TestAndGetValue(DICOM_TAG_SPECIFIC_CHARACTER_SET);
 
@@ -1046,7 +1047,9 @@
       {
         try
         {
-          ReplacePlainString(it->first, it->second->GetContent());
+          // Same as "ReplacePlainString()", but with support for private creator
+          const std::string& utf8Value = it->second->GetContent();
+          Replace(it->first, utf8Value, false, DicomReplaceMode_InsertIfAbsent, privateCreator);
         }
         catch (OrthancException&)
         {
@@ -1062,10 +1065,11 @@
 
   ParsedDicomFile::ParsedDicomFile(const DicomMap& map,
                                    Encoding defaultEncoding,
-                                   bool permissive) :
+                                   bool permissive,
+                                   const std::string& privateCreator) :
     pimpl_(new PImpl)
   {
-    CreateFromDicomMap(map, defaultEncoding, permissive);
+    CreateFromDicomMap(map, defaultEncoding, permissive, privateCreator);
   }