diff OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp @ 4105:c02a2d9efbc2

move FromDcmtkBridge::ExecuteToDicom() to LuaFunctionCall, to remove dependency of DCMTK on Lua
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 06 Jul 2020 13:48:10 +0200
parents d25f4c0fa160
children bf7b9edf6b81
line wrap: on
line diff
--- a/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Mon Jul 06 11:45:39 2020 +0200
+++ b/OrthancFramework/Sources/DicomParsing/FromDcmtkBridge.cpp	Mon Jul 06 13:48:10 2020 +0200
@@ -2047,46 +2047,6 @@
   }
 
 
-#if ORTHANC_ENABLE_LUA == 1
-  void FromDcmtkBridge::ExecuteToDicom(DicomMap& target,
-                                       LuaFunctionCall& call)
-  {
-    Json::Value output;
-    call.ExecuteToJson(output, true /* keep strings */);
-
-    target.Clear();
-
-    if (output.type() == Json::arrayValue &&
-        output.size() == 0)
-    {
-      // This case happens for empty tables
-      return;
-    }
-
-    if (output.type() != Json::objectValue)
-    {
-      throw OrthancException(ErrorCode_LuaBadOutput,
-                             "Lua: The script must return a table");
-    }
-
-    Json::Value::Members members = output.getMemberNames();
-
-    for (size_t i = 0; i < members.size(); i++)
-    {
-      if (output[members[i]].type() != Json::stringValue)
-      {
-        throw OrthancException(ErrorCode_LuaBadOutput,
-                               "Lua: The script must return a table "
-                               "mapping names of DICOM tags to strings");
-      }
-
-      DicomTag tag(ParseTag(members[i]));
-      target.SetValue(tag, output[members[i]].asString(), false);
-    }
-  }
-#endif
-
-
   void FromDcmtkBridge::ExtractDicomSummary(DicomMap& target, 
                                             DcmItem& dataset,
                                             const std::set<DicomTag>& ignoreTagLength)