diff OrthancServer/OrthancInitialization.cpp @ 847:03ea55da7429 jpeg

fully functional JPEG-LS conversion
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Jun 2014 18:14:16 +0200
parents 84513f2ee1f3
children b3f6fb1130cd
line wrap: on
line diff
--- a/OrthancServer/OrthancInitialization.cpp	Thu Jun 05 16:23:03 2014 +0200
+++ b/OrthancServer/OrthancInitialization.cpp	Thu Jun 05 18:14:16 2014 +0200
@@ -45,6 +45,17 @@
 #include <boost/thread.hpp>
 #include <glog/logging.h>
 
+
+#if ORTHANC_JPEG_ENABLED == 1
+#include <dcmtk/dcmjpeg/djdecode.h>
+#endif
+
+
+#if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
+#include <dcmtk/dcmjpls/djdecode.h>
+#endif
+
+
 namespace Orthanc
 {
   static boost::mutex globalMutex_;
@@ -182,6 +193,16 @@
     RegisterUserContentType();
 
     DicomServer::InitializeDictionary();
+
+#if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
+    LOG(WARNING) << "Registering JPEG Lossless codecs";
+    DJLSDecoderRegistration::registerCodecs();    
+#endif
+
+#if ORTHANC_JPEG_ENABLED == 1
+    LOG(WARNING) << "Registering JPEG codecs";
+    DJDecoderRegistration::registerCodecs(); 
+#endif
   }
 
 
@@ -191,6 +212,16 @@
     boost::mutex::scoped_lock lock(globalMutex_);
     HttpClient::GlobalFinalize();
     configuration_.reset(NULL);
+
+#if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
+    // Unregister JPEG-LS codecs
+    DJLSDecoderRegistration::cleanup();
+#endif
+
+#if ORTHANC_JPEG_ENABLED == 1
+    // Unregister JPEG codecs
+    DJDecoderRegistration::cleanup();
+#endif
   }