diff OrthancServer/FromDcmtkBridge.cpp @ 1307:f796207e3df1

Fix replacement and insertion of private DICOM tags
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 11 Feb 2015 10:26:17 +0100
parents 6e7e5ed91c2d
children 1c8dfedefefe
line wrap: on
line diff
--- a/OrthancServer/FromDcmtkBridge.cpp	Tue Feb 10 17:17:25 2015 +0100
+++ b/OrthancServer/FromDcmtkBridge.cpp	Wed Feb 11 10:26:17 2015 +0100
@@ -186,15 +186,27 @@
 
   bool FromDcmtkBridge::IsPrivateTag(DcmTag& tag)
   {
+#if 1
+    DcmTagKey tmp(tag.getGTag(), tag.getETag());
+    return tmp.isPrivate();
+#else
+    // Implementation for Orthanc versions <= 0.8.5
     return (tag.getPrivateCreator() != NULL ||
             !strcmp("PrivateCreator", tag.getTagName()));  // TODO - This may change with future versions of DCMTK
+#endif
   }
 
 
   bool FromDcmtkBridge::IsPrivateTag(const DicomTag& tag)
   {
+#if 1
+    DcmTagKey tmp(tag.GetGroup(), tag.GetElement());
+    return tmp.isPrivate();
+#else
+    // Implementation for Orthanc versions <= 0.8.5
     DcmTag tmp(tag.GetGroup(), tag.GetElement());
     return IsPrivateTag(tmp);
+#endif
   }