# HG changeset patch # User Sebastien Jodogne # Date 1477493634 -7200 # Node ID 62adabb8c12243fcb3f64242450787fd749ab359 # Parent bc3ca410b765d023b25aa855a4052bbb6bf549dc Provide "--version" in command-line tools diff -r bc3ca410b765 -r 62adabb8c122 Applications/ApplicationToolbox.cpp --- a/Applications/ApplicationToolbox.cpp Wed Oct 26 15:42:52 2016 +0200 +++ b/Applications/ApplicationToolbox.cpp Wed Oct 26 16:53:54 2016 +0200 @@ -176,5 +176,19 @@ throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); } } + + + void PrintVersion(const char* path) + { + std::cout + << path << " " << ORTHANC_WSI_VERSION << std::endl + << "Copyright (C) 2012-2016 Sebastien Jodogne, " + << "Medical Physics Department, University Hospital of Liege (Belgium)" << std::endl + << "Licensing AGPL: GNU AGPL version 3 or later ." << std::endl + << "This is free software: you are free to change and redistribute it." << std::endl + << "There is NO WARRANTY, to the extent permitted by law." << std::endl + << std::endl + << "Written by Sebastien Jodogne " << std::endl; + } } } diff -r bc3ca410b765 -r 62adabb8c122 Applications/ApplicationToolbox.h --- a/Applications/ApplicationToolbox.h Wed Oct 26 15:42:52 2016 +0200 +++ b/Applications/ApplicationToolbox.h Wed Oct 26 16:53:54 2016 +0200 @@ -40,5 +40,7 @@ uint8_t& green, uint8_t& blue, const std::string& color); + + void PrintVersion(const char* path); } } diff -r bc3ca410b765 -r 62adabb8c122 Applications/CMakeLists.txt --- a/Applications/CMakeLists.txt Wed Oct 26 15:42:52 2016 +0200 +++ b/Applications/CMakeLists.txt Wed Oct 26 16:53:54 2016 +0200 @@ -66,6 +66,8 @@ include(${ORTHANC_ROOT}/Resources/CMake/LibPngConfiguration.cmake) include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake) +# Include components specific to WSI +include(${ORTHANC_WSI_DIR}/Resources/CMake/Version.cmake) include(${ORTHANC_WSI_DIR}/Resources/CMake/BoostExtendedConfiguration.cmake) include(${ORTHANC_WSI_DIR}/Resources/CMake/OpenJpegConfiguration.cmake) include(${ORTHANC_WSI_DIR}/Resources/CMake/LibTiffConfiguration.cmake) diff -r bc3ca410b765 -r 62adabb8c122 Applications/DicomToTiff.cpp --- a/Applications/DicomToTiff.cpp Wed Oct 26 15:42:52 2016 +0200 +++ b/Applications/DicomToTiff.cpp Wed Oct 26 16:53:54 2016 +0200 @@ -40,6 +40,7 @@ boost::program_options::options_description generic("Generic options"); generic.add_options() ("help", "Display this help and exit") + ("version", "Output version information and exit") ("verbose", "Be verbose in logs") ; @@ -90,7 +91,8 @@ } if (!error && - options.count("help") == 0) + options.count("help") == 0 && + options.count("version") == 0) { if (options.count("input") != 1) { @@ -125,6 +127,12 @@ return false; } + if (options.count("version")) + { + OrthancWSI::ApplicationToolbox::PrintVersion(argv[0]); + return false; + } + if (options.count("verbose")) { Orthanc::Logging::EnableInfoLevel(true); diff -r bc3ca410b765 -r 62adabb8c122 Applications/Dicomizer.cpp --- a/Applications/Dicomizer.cpp Wed Oct 26 15:42:52 2016 +0200 +++ b/Applications/Dicomizer.cpp Wed Oct 26 16:53:54 2016 +0200 @@ -453,6 +453,7 @@ boost::program_options::options_description generic("Generic options"); generic.add_options() ("help", "Display this help and exit") + ("version", "Output version information and exit") ("verbose", "Be verbose in logs") ("threads", boost::program_options::value()->default_value(parameters.GetThreadsCount()), "Number of processing threads to be used") @@ -562,6 +563,7 @@ if (!error && options.count("help") == 0 && + options.count("version") == 0 && options.count("input") != 1) { LOG(ERROR) << "No input file was specified"; @@ -588,6 +590,12 @@ return false; } + if (options.count("version")) + { + OrthancWSI::ApplicationToolbox::PrintVersion(argv[0]); + return false; + } + if (options.count("verbose")) { Orthanc::Logging::EnableInfoLevel(true); diff -r bc3ca410b765 -r 62adabb8c122 NEWS --- a/NEWS Wed Oct 26 15:42:52 2016 +0200 +++ b/NEWS Wed Oct 26 16:53:54 2016 +0200 @@ -1,6 +1,8 @@ Pending changes in the mainline =============================== +* Docker images are available +* Provide "--version" in command-line tools * Fix freeze if the target Orthanc is not accepting images diff -r bc3ca410b765 -r 62adabb8c122 Resources/CMake/Version.cmake --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Resources/CMake/Version.cmake Wed Oct 26 16:53:54 2016 +0200 @@ -0,0 +1,5 @@ +set(ORTHANC_WSI_VERSION "mainline") + +add_definitions( + -DORTHANC_WSI_VERSION="${ORTHANC_WSI_VERSION}" + ) diff -r bc3ca410b765 -r 62adabb8c122 TODO --- a/TODO Wed Oct 26 15:42:52 2016 +0200 +++ b/TODO Wed Oct 26 16:53:54 2016 +0200 @@ -7,7 +7,6 @@ ------- * Support sparse tiling (both in encoder and decoder) -* Add version in command-line tools ------------- @@ -25,9 +24,8 @@ * Provide precompiled Windows binaries * Build under Apple OS X -* Build under Microsoft Visual Studio +* Build using Microsoft Visual Studio * DebianMed -* Docker ----------- diff -r bc3ca410b765 -r 62adabb8c122 ViewerPlugin/CMakeLists.txt --- a/ViewerPlugin/CMakeLists.txt Wed Oct 26 15:42:52 2016 +0200 +++ b/ViewerPlugin/CMakeLists.txt Wed Oct 26 16:53:54 2016 +0200 @@ -1,8 +1,6 @@ cmake_minimum_required(VERSION 2.8) project(OrthancWSIPlugin) -set(ORTHANC_WSI_VERSION "mainline") - ##################################################################### ## Parameters of the build @@ -53,6 +51,8 @@ include(${ORTHANC_ROOT}/Resources/CMake/LibPngConfiguration.cmake) include(${ORTHANC_ROOT}/Resources/CMake/ZlibConfiguration.cmake) +# Include components specific to WSI +include(${ORTHANC_WSI_DIR}/Resources/CMake/Version.cmake) include(${ORTHANC_WSI_DIR}/Resources/CMake/OpenJpegConfiguration.cmake) add_definitions( @@ -191,8 +191,6 @@ ) message("Setting the version of the library to ${ORTHANC_WSI_VERSION}") -add_definitions(-DORTHANC_WSI_VERSION="${ORTHANC_WSI_VERSION}") - set_target_properties(OrthancWSI PROPERTIES VERSION ${ORTHANC_WSI_VERSION} SOVERSION ${ORTHANC_WSI_VERSION}) diff -r bc3ca410b765 -r 62adabb8c122 ViewerPlugin/Plugin.cpp --- a/ViewerPlugin/Plugin.cpp Wed Oct 26 15:42:52 2016 +0200 +++ b/ViewerPlugin/Plugin.cpp Wed Oct 26 16:53:54 2016 +0200 @@ -352,7 +352,7 @@ sprintf(info, "The whole-slide imaging plugin will use at most %d threads to transcode the tiles", threads); OrthancPluginLogWarning(context_, info); - OrthancPluginSetDescription(context, "Plugin to serve whole-slide microscopic images from Orthanc."); + OrthancPluginSetDescription(context, "Provides a Web viewer of whole-slide microscopic images within Orthanc."); orthanc_.reset(new OrthancWSI::PluginOrthancConnection(context)); cache_.reset(new OrthancWSI::DicomPyramidCache(*orthanc_));