# HG changeset patch # User Sebastien Jodogne # Date 1438975487 -7200 # Node ID 130511d63f682e954d721757c795b5282b021b26 # Parent 56fef04eab4076e9b5670150eefc846c3e22bb15# Parent dae7a63ff51c46293c14ec549f9a246fd6c4b298 merge diff -r 56fef04eab40 -r 130511d63f68 CMakeLists.txt --- a/CMakeLists.txt Fri Aug 07 21:19:14 2015 +0200 +++ b/CMakeLists.txt Fri Aug 07 21:24:47 2015 +0200 @@ -108,6 +108,7 @@ add_definitions( -DORTHANC_ENABLE_MD5=0 -DORTHANC_ENABLE_BASE64=0 + -DORTHANC_ENABLE_LOGGING=0 ) set(CORE_SOURCES @@ -115,7 +116,7 @@ ${JSONCPP_SOURCES} ${LIBJPEG_SOURCES} ${LIBPNG_SOURCES} - ${ZLIB} + ${ZLIB_SOURCES} ${PUGIXML_SOURCES} ${ORTHANC_ROOT}/Core/ChunkedBuffer.cpp diff -r 56fef04eab40 -r 130511d63f68 NEWS --- a/NEWS Fri Aug 07 21:19:14 2015 +0200 +++ b/NEWS Fri Aug 07 21:24:47 2015 +0200 @@ -1,13 +1,19 @@ Pending changes in the mainline =============================== -No official release yet. Still work in progress. +Version 0.1 (2015/08/03) +======================== + +* Support of WADO-RS - RetrieveMetadata * Support of WADO, in addition to DICOMweb * All the APIs are now under the same root + +Production +---------- + * Inject version information into Windows binaries * Use of Orthanc built-in API for multipart answers (requires Orthanc >= 0.9.1) -* Support of WADO-RS - RetrieveMetadata * Support of Visual Studio 2008 * Support of FreeBSD * Support of OS X diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Core/ImageFormats/ImageAccessor.cpp --- a/Orthanc/Core/ImageFormats/ImageAccessor.cpp Fri Aug 07 21:19:14 2015 +0200 +++ b/Orthanc/Core/ImageFormats/ImageAccessor.cpp Fri Aug 07 21:24:47 2015 +0200 @@ -33,6 +33,7 @@ #include "../PrecompiledHeaders.h" #include "ImageAccessor.h" +#include "../Logging.h" #include "../OrthancException.h" #include "../ChunkedBuffer.h" @@ -40,9 +41,6 @@ #include #include -#if HAVE_GOOGLE_LOG == 1 -#include -#endif namespace Orthanc @@ -108,7 +106,7 @@ { if (readOnly_) { -#if HAVE_GOOGLE_LOG == 1 +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Trying to write on a read-only image"; #endif @@ -136,7 +134,7 @@ { if (readOnly_) { -#if HAVE_GOOGLE_LOG == 1 +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Trying to write on a read-only image"; #endif diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Core/Logging.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Orthanc/Core/Logging.h Fri Aug 07 21:24:47 2015 +0200 @@ -0,0 +1,93 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2015 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * In addition, as a special exception, the copyright holders of this + * program give permission to link the code of its release with the + * OpenSSL project's "OpenSSL" library (or with modified versions of it + * that use the same license as the "OpenSSL" library), and distribute + * the linked executables. You must obey the GNU General Public License + * in all respects for all of the code used other than "OpenSSL". If you + * modify file(s) with this exception, you may extend this exception to + * your version of the file(s), but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. If you delete this exception statement from all source files + * in the program, then also delete it here. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + **/ + + +#pragma once + +#if ORTHANC_ENABLE_LOGGING == 1 + +#if ORTHANC_ENABLE_GOOGLE_LOG == 1 +# include // This fixes a problem in glog for recent releases of MinGW +# include +#else +# include +# include +# define LOG(level) ::Orthanc::Logging::InternalLogger(#level, __FILE__, __LINE__) +# define VLOG(level) ::Orthanc::Logging::InternalLogger("TRACE", __FILE__, __LINE__) +#endif + + +namespace Orthanc +{ + namespace Logging + { + void Initialize(); + + void Finalize(); + + void EnableInfoLevel(bool enabled); + + void EnableTraceLevel(bool enabled); + + void SetTargetFolder(const std::string& path); + + +#if ORTHANC_ENABLE_GOOGLE_LOG != 1 + class InternalLogger + { + private: + boost::mutex::scoped_lock lock_; + std::ostream* stream_; + + public: + InternalLogger(const char* level, + const char* file, + int line); + + ~InternalLogger() + { +#if defined(_WIN32) + *stream_ << "\r\n"; +#else + *stream_ << "\n"; +#endif + } + + std::ostream& operator<< (const std::string& message) + { + return (*stream_) << message; + } + }; +#endif + } +} + +#endif // ORTHANC_ENABLE_LOGGING diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Core/PrecompiledHeaders.h --- a/Orthanc/Core/PrecompiledHeaders.h Fri Aug 07 21:19:14 2015 +0200 +++ b/Orthanc/Core/PrecompiledHeaders.h Fri Aug 07 21:24:47 2015 +0200 @@ -46,7 +46,6 @@ #include #include -#include #include #if ORTHANC_PUGIXML_ENABLED == 1 @@ -54,6 +53,7 @@ #endif #include "Enumerations.h" +#include "Logging.h" #include "OrthancException.h" #include "Toolbox.h" #include "Uuid.h" diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Core/Toolbox.cpp --- a/Orthanc/Core/Toolbox.cpp Fri Aug 07 21:19:14 2015 +0200 +++ b/Orthanc/Core/Toolbox.cpp Fri Aug 07 21:24:47 2015 +0200 @@ -34,6 +34,7 @@ #include "Toolbox.h" #include "OrthancException.h" +#include "Logging.h" #include #include @@ -53,13 +54,9 @@ #include #endif -#if HAVE_GOOGLE_LOG == 1 -#include -#endif - #if defined(_WIN32) #include -#include // For "_spawnvp()" +#include // For "_spawnvp()" and "_getpid()" #else #include // For "execvp()" #include // For "waitpid()" @@ -1135,7 +1132,7 @@ if (pid == -1) { // Error in fork() -#if HAVE_GOOGLE_LOG == 1 +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "Cannot fork a child process"; #endif @@ -1158,7 +1155,7 @@ if (status != 0) { -#if HAVE_GOOGLE_LOG == 1 +#if ORTHANC_ENABLE_LOGGING == 1 LOG(ERROR) << "System command failed with status code " << status; #endif @@ -1274,5 +1271,14 @@ } } + + int Toolbox::GetProcessId() + { +#if defined(_WIN32) + return static_cast(_getpid()); +#else + return static_cast(getpid()); +#endif + } } diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Core/Toolbox.h --- a/Orthanc/Core/Toolbox.h Fri Aug 07 21:19:14 2015 +0200 +++ b/Orthanc/Core/Toolbox.h Fri Aug 07 21:24:47 2015 +0200 @@ -170,5 +170,7 @@ bool StartsWith(const std::string& str, const std::string& prefix); + + int GetProcessId(); } } diff -r 56fef04eab40 -r 130511d63f68 Orthanc/Resources/CMake/ZlibConfiguration.cmake --- a/Orthanc/Resources/CMake/ZlibConfiguration.cmake Fri Aug 07 21:19:14 2015 +0200 +++ b/Orthanc/Resources/CMake/ZlibConfiguration.cmake Fri Aug 07 21:24:47 2015 +0200 @@ -1,9 +1,3 @@ -# This is the minizip distribution to create ZIP files -set(ZLIB_SOURCES - ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/ioapi.c - ${ORTHANC_ROOT}/Resources/ThirdParty/minizip/zip.c - ) - if (STATIC_BUILD OR NOT USE_SYSTEM_ZLIB) SET(ZLIB_SOURCES_DIR ${CMAKE_BINARY_DIR}/zlib-1.2.7) DownloadPackage( diff -r 56fef04eab40 -r 130511d63f68 README --- a/README Fri Aug 07 21:19:14 2015 +0200 +++ b/README Fri Aug 07 21:24:47 2015 +0200 @@ -15,8 +15,9 @@ Currently, a basic support of the following protocols is provided: -* WADO (Web Access to DICOM Persistent Objects) +* WADO-URI (Web Access to DICOM Persistent Objects), previously known as WADO http://medical.nema.org/Dicom/2011/11_18pu.pdf + http://medical.nema.org/medical/dicom/current/output/html/part18.html#sect_6.2 * WADO-RS (Web Access to DICOM Objects by RESTful Services) http://medical.nema.org/medical/dicom/current/output/html/part18.html#sect_6.5 diff -r 56fef04eab40 -r 130511d63f68 Resources/SyncOrthancFolder.py --- a/Resources/SyncOrthancFolder.py Fri Aug 07 21:19:14 2015 +0200 +++ b/Resources/SyncOrthancFolder.py Fri Aug 07 21:24:47 2015 +0200 @@ -26,6 +26,7 @@ 'Core/ImageFormats/ImageBuffer.h', 'Core/ImageFormats/PngReader.cpp', 'Core/ImageFormats/PngReader.h', + 'Core/Logging.h', 'Core/OrthancException.cpp', 'Core/OrthancException.h', 'Core/PrecompiledHeaders.h', diff -r 56fef04eab40 -r 130511d63f68 Status.txt --- a/Status.txt Fri Aug 07 21:19:14 2015 +0200 +++ b/Status.txt Fri Aug 07 21:24:47 2015 +0200 @@ -2,6 +2,29 @@ +======================================= +6.2 WADO-URI (previously known as WADO) +======================================= + +Supported +--------- + +* Retrieval of JPEG images ("&requestType=WADO&...") +* Retrieval of DICOM file ("&requestType=WADO&contentType=application/dicom&...") +* Retrieval of PNG images ("&requestType=WADO&contentType=image/png&...") + + +Not supported +------------- + +* Retrieval of DICOM SR (structured reports) +* Retrieval of a region of a DICOM image +* Manipulation of the image (annotations, windowing, thresholding...) +* DICOM Response with a change in the transfer syntax +* Specification of a quality for JPEG images + + + ================================ 6.5.1 WADO-RS / RetrieveStudy 6.5.2 WADO-RS / RetrieveSeries diff -r 56fef04eab40 -r 130511d63f68 UnitTestsSources/UnitTestsMain.cpp --- a/UnitTestsSources/UnitTestsMain.cpp Fri Aug 07 21:19:14 2015 +0200 +++ b/UnitTestsSources/UnitTestsMain.cpp Fri Aug 07 21:24:47 2015 +0200 @@ -35,17 +35,17 @@ ParseContentType(c, a, "Multipart/Related; TYPE=Application/Dicom; Boundary=heLLO"); ASSERT_EQ(c, "multipart/related"); - ASSERT_EQ(2, a.size()); + ASSERT_EQ(2u, a.size()); ASSERT_EQ(a["type"], "Application/Dicom"); ASSERT_EQ(a["boundary"], "heLLO"); ParseContentType(c, a, ""); ASSERT_TRUE(c.empty()); - ASSERT_EQ(0, a.size()); + ASSERT_EQ(0u, a.size()); ParseContentType(c, a, "multipart/related"); ASSERT_EQ(c, "multipart/related"); - ASSERT_EQ(0, a.size()); + ASSERT_EQ(0u, a.size()); }