changeset 1655:e40fd0d925c5

/tools/create-dicom can create tags with unknown VR
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 29 Sep 2015 14:54:24 +0200
parents 3727a09e7b53
children d3ba98d6b6e9
files NEWS OrthancServer/FromDcmtkBridge.cpp OrthancServer/FromDcmtkBridge.h OrthancServer/ParsedDicomFile.cpp
diffstat 4 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Mon Sep 28 15:03:35 2015 +0200
+++ b/NEWS	Tue Sep 29 14:54:24 2015 +0200
@@ -13,7 +13,8 @@
 -----------
 
 * "/system" URI gives information about the plugins used for storage area and DB back-end
-* Plugin callbacks must now return explicit "OrthancPluginErrorCode" instead of integers
+* Plugin callbacks should now return explicit "OrthancPluginErrorCode" instead of integers
+* "/tools/create-dicom" can create tags with unknown VR
 
 
 Version 0.9.4 (2015/09/16)
--- a/OrthancServer/FromDcmtkBridge.cpp	Mon Sep 28 15:03:35 2015 +0200
+++ b/OrthancServer/FromDcmtkBridge.cpp	Tue Sep 29 14:54:24 2015 +0200
@@ -618,6 +618,13 @@
   }
 
 
+  bool FromDcmtkBridge::IsUnknownTag(const DicomTag& tag)
+  {
+    DcmTag tmp(tag.GetGroup(), tag.GetElement());
+    return tmp.isUnknownVR();
+  }
+
+
   void FromDcmtkBridge::Print(FILE* fp, const DicomMap& m)
   {
     for (DicomMap::Map::const_iterator 
--- a/OrthancServer/FromDcmtkBridge.h	Mon Sep 28 15:03:35 2015 +0200
+++ b/OrthancServer/FromDcmtkBridge.h	Tue Sep 29 14:54:24 2015 +0200
@@ -56,6 +56,8 @@
 
     static bool IsPrivateTag(const DicomTag& tag);
 
+    static bool IsUnknownTag(const DicomTag& tag);
+
     static DicomValue* ConvertLeafElement(DcmElement& element,
                                           Encoding encoding);
 
--- a/OrthancServer/ParsedDicomFile.cpp	Mon Sep 28 15:03:35 2015 +0200
+++ b/OrthancServer/ParsedDicomFile.cpp	Tue Sep 29 14:54:24 2015 +0200
@@ -864,7 +864,8 @@
   {
     OFCondition cond;
 
-    if (FromDcmtkBridge::IsPrivateTag(tag))
+    if (FromDcmtkBridge::IsPrivateTag(tag) ||
+        FromDcmtkBridge::IsUnknownTag(tag))
     {
       // This is a private tag
       // http://support.dcmtk.org/redmine/projects/dcmtk/wiki/howto_addprivatedata
@@ -915,7 +916,8 @@
     }
     else
     {
-      if (FromDcmtkBridge::IsPrivateTag(tag))
+      if (FromDcmtkBridge::IsPrivateTag(tag) ||
+          FromDcmtkBridge::IsUnknownTag(tag))
       {
         if (!element->putUint8Array((const Uint8*) value.c_str(), value.size()).good())
         {
@@ -968,6 +970,7 @@
     DcmDataset& dataset = *pimpl_->file_->getDataset();
 
     if (FromDcmtkBridge::IsPrivateTag(tag) ||
+        FromDcmtkBridge::IsUnknownTag(tag) ||
         tag == DICOM_TAG_PIXEL_DATA ||
         tag == DICOM_TAG_ENCAPSULATED_DOCUMENT)
     {