diff OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp @ 2825:8aa6aef11b70

New configuration option "OverwriteInstances" to choose how duplicate SOPInstanceUID are handled
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Sep 2018 15:24:01 +0200
parents a21b244efb37
children 99863d6245b2
line wrap: on
line diff
--- a/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Tue Sep 18 16:31:42 2018 +0200
+++ b/OrthancServer/OrthancRestApi/OrthancRestAnonymizeModify.cpp	Wed Sep 19 15:24:01 2018 +0200
@@ -130,9 +130,13 @@
   {
     std::string id = call.GetUriComponent("id", "");
 
-    ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);
+    std::auto_ptr<ParsedDicomFile> modified;
 
-    std::auto_ptr<ParsedDicomFile> modified(locker.GetDicom().Clone(true));
+    {
+      ServerContext::DicomCacheLocker locker(OrthancRestApi::GetContext(call), id);
+      modified.reset(locker.GetDicom().Clone(true));
+    }
+    
     modification.Apply(*modified);
     modified->Answer(call.GetOutput());
   }