comparison 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
comparison
equal deleted inserted replaced
846:715ab7674993 847:03ea55da7429
43 #include <boost/filesystem.hpp> 43 #include <boost/filesystem.hpp>
44 #include <curl/curl.h> 44 #include <curl/curl.h>
45 #include <boost/thread.hpp> 45 #include <boost/thread.hpp>
46 #include <glog/logging.h> 46 #include <glog/logging.h>
47 47
48
49 #if ORTHANC_JPEG_ENABLED == 1
50 #include <dcmtk/dcmjpeg/djdecode.h>
51 #endif
52
53
54 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
55 #include <dcmtk/dcmjpls/djdecode.h>
56 #endif
57
58
48 namespace Orthanc 59 namespace Orthanc
49 { 60 {
50 static boost::mutex globalMutex_; 61 static boost::mutex globalMutex_;
51 static std::auto_ptr<Json::Value> configuration_; 62 static std::auto_ptr<Json::Value> configuration_;
52 static boost::filesystem::path defaultDirectory_; 63 static boost::filesystem::path defaultDirectory_;
180 191
181 RegisterUserMetadata(); 192 RegisterUserMetadata();
182 RegisterUserContentType(); 193 RegisterUserContentType();
183 194
184 DicomServer::InitializeDictionary(); 195 DicomServer::InitializeDictionary();
196
197 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
198 LOG(WARNING) << "Registering JPEG Lossless codecs";
199 DJLSDecoderRegistration::registerCodecs();
200 #endif
201
202 #if ORTHANC_JPEG_ENABLED == 1
203 LOG(WARNING) << "Registering JPEG codecs";
204 DJDecoderRegistration::registerCodecs();
205 #endif
185 } 206 }
186 207
187 208
188 209
189 void OrthancFinalize() 210 void OrthancFinalize()
190 { 211 {
191 boost::mutex::scoped_lock lock(globalMutex_); 212 boost::mutex::scoped_lock lock(globalMutex_);
192 HttpClient::GlobalFinalize(); 213 HttpClient::GlobalFinalize();
193 configuration_.reset(NULL); 214 configuration_.reset(NULL);
215
216 #if ORTHANC_JPEG_LOSSLESS_ENABLED == 1
217 // Unregister JPEG-LS codecs
218 DJLSDecoderRegistration::cleanup();
219 #endif
220
221 #if ORTHANC_JPEG_ENABLED == 1
222 // Unregister JPEG codecs
223 DJDecoderRegistration::cleanup();
224 #endif
194 } 225 }
195 226
196 227
197 228
198 std::string Configuration::GetGlobalStringParameter(const std::string& parameter, 229 std::string Configuration::GetGlobalStringParameter(const std::string& parameter,