ソースを参照

Implemented generateUID()

Ivo Wolf 13 年 前
コミット
0bac5deea4
共有2 個のファイルを変更した12 個の追加1 個の削除を含む
  1. 11 0
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.cpp
  2. 1 1
      Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.h

+ 11 - 0
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.cpp

@@ -34,6 +34,9 @@
 // STD includes
 #include <iostream>
 
+// DCMTK includes
+#include <dcuid.h>
+
 //----------------------------------------------------------------------------
 ctkExampleDicomHost::ctkExampleDicomHost(ctkHostedAppPlaceholderWidget* placeholderWidget, int hostPort, int appPort) :
     ctkDicomAbstractHost(hostPort, appPort),
@@ -203,3 +206,11 @@ ctkDicomAppHosting::State ctkExampleDicomHost::getApplicationState()const
     return ctkDicomAppHosting::EXIT;
   return ctkDicomAbstractHost::getApplicationState();
 }
+
+//----------------------------------------------------------------------------
+QString ctkExampleDicomHost::generateUID()
+{
+  char uid[100];
+  dcmGenerateUniqueIdentifier(uid, SITE_INSTANCE_UID_ROOT);
+  return uid;
+}

+ 1 - 1
Plugins/org.commontk.dah.examplehost/ctkExampleDicomHost.h

@@ -48,7 +48,7 @@ public:
    * Returns a newly created DICOM UID that the Hosted Application might use, e.g., to create new data
    * objects and structures.
    */
-  virtual QString generateUID() { return ""; }
+  virtual QString generateUID();
 
   /**
    * The Hosted Application supplies its preferred screen size in the appPreferredScreen parameter. The