changeset 239:bab966288abe

sync
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 12 Jun 2021 09:20:44 +0200
parents 476d5204d08b
children 24e5f64263a0
files Applications/CMakeLists.txt Framework/Inputs/DicomPyramidInstance.cpp Resources/CMake/Version.cmake Resources/Orthanc/Stone/DicomDatasetReader.cpp Resources/Orthanc/Stone/DicomDatasetReader.h Resources/Orthanc/Stone/DicomPath.cpp Resources/Orthanc/Stone/DicomPath.h Resources/Orthanc/Stone/FullOrthancDataset.cpp Resources/Orthanc/Stone/FullOrthancDataset.h Resources/Orthanc/Stone/IDicomDataset.h Resources/Orthanc/Stone/IOrthancConnection.h Resources/SyncOrthancFolder.py ViewerPlugin/CMakeLists.txt
diffstat 13 files changed, 70 insertions(+), 277 deletions(-) [+]
line wrap: on
line diff
--- a/Applications/CMakeLists.txt	Fri May 14 07:37:08 2021 +0200
+++ b/Applications/CMakeLists.txt	Sat Jun 12 09:20:44 2021 +0200
@@ -26,16 +26,25 @@
 SET(ORTHANC_WSI_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
 SET(USE_OPENJPEG_JP2 ON)
 
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)  
+
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
-  set(ENABLE_DCMTK ON)
-  set(ORTHANC_BOOST_COMPONENTS program_options)
-  include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)  
+  if (ORTHANC_FRAMEWORK_USE_SHARED)    
+    include(FindBoost)
+    find_package(Boost COMPONENTS filesystem program_options regex system thread)
+    
+    if (NOT Boost_FOUND)
+      message(FATAL_ERROR "Unable to locate Boost on this system")
+    endif()
 
+    include(FindDCMTK)
+    link_libraries(${Boost_LIBRARIES} ${DCMTK_LIBRARIES} jsoncpp)
+  endif()
+  
   link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
   include_directories(${ORTHANC_FRAMEWORK_ROOT})
   
 else()
-  include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
   include_directories(${ORTHANC_FRAMEWORK_ROOT})
 
   UNSET(STANDALONE_BUILD CACHE)
@@ -159,7 +168,6 @@
   ${BOOST_EXTENDED_SOURCES}
 
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/DicomDatasetReader.cpp
-  ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/DicomPath.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/FullOrthancDataset.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/IOrthancConnection.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/OrthancHttpConnection.cpp
--- a/Framework/Inputs/DicomPyramidInstance.cpp	Fri May 14 07:37:08 2021 +0200
+++ b/Framework/Inputs/DicomPyramidInstance.cpp	Sat Jun 12 09:20:44 2021 +0200
@@ -59,7 +59,7 @@
     DicomDatasetReader header(dataset);
 
     std::string s = Orthanc::Toolbox::StripSpaces
-      (header.GetMandatoryStringValue(OrthancStone::DicomPath(Orthanc::DICOM_TAG_TRANSFER_SYNTAX_UID)));
+      (header.GetMandatoryStringValue(Orthanc::DicomPath(Orthanc::DICOM_TAG_TRANSFER_SYNTAX_UID)));
 
     if (s == "1.2.840.10008.1.2" ||
         s == "1.2.840.10008.1.2.1")
@@ -90,7 +90,7 @@
     using namespace OrthancStone;
 
     std::string p = Orthanc::Toolbox::StripSpaces
-      (reader.GetMandatoryStringValue(OrthancStone::DicomPath(Orthanc::DICOM_TAG_PHOTOMETRIC_INTERPRETATION)));
+      (reader.GetMandatoryStringValue(Orthanc::DicomPath(Orthanc::DICOM_TAG_PHOTOMETRIC_INTERPRETATION)));
 
     photometric = Orthanc::StringToPhotometricInterpretation(p.c_str());
 
@@ -102,9 +102,9 @@
 
     unsigned int bitsStored, samplesPerPixel, tmp;
 
-    if (!reader.GetUnsignedIntegerValue(bitsStored, OrthancStone::DicomPath(Orthanc::DICOM_TAG_BITS_STORED)) ||
-        !reader.GetUnsignedIntegerValue(samplesPerPixel, OrthancStone::DicomPath(Orthanc::DICOM_TAG_SAMPLES_PER_PIXEL)) ||
-        !reader.GetUnsignedIntegerValue(tmp, OrthancStone::DicomPath(Orthanc::DICOM_TAG_PIXEL_REPRESENTATION)))
+    if (!reader.GetUnsignedIntegerValue(bitsStored, Orthanc::DicomPath(Orthanc::DICOM_TAG_BITS_STORED)) ||
+        !reader.GetUnsignedIntegerValue(samplesPerPixel, Orthanc::DicomPath(Orthanc::DICOM_TAG_SAMPLES_PER_PIXEL)) ||
+        !reader.GetUnsignedIntegerValue(tmp, Orthanc::DicomPath(Orthanc::DICOM_TAG_PIXEL_REPRESENTATION)))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentTag);
     }
@@ -159,8 +159,8 @@
     FullOrthancDataset dataset(orthanc, "/instances/" + instanceId + "/tags");
     DicomDatasetReader reader(dataset);
 
-    if (reader.GetMandatoryStringValue(OrthancStone::DicomPath(Orthanc::DICOM_TAG_SOP_CLASS_UID)) != "1.2.840.10008.5.1.4.1.1.77.1.6" ||
-        reader.GetMandatoryStringValue(OrthancStone::DicomPath(Orthanc::DICOM_TAG_MODALITY)) != "SM")
+    if (reader.GetMandatoryStringValue(Orthanc::DicomPath(Orthanc::DICOM_TAG_SOP_CLASS_UID)) != "1.2.840.10008.5.1.4.1.1.77.1.6" ||
+        reader.GetMandatoryStringValue(Orthanc::DicomPath(Orthanc::DICOM_TAG_MODALITY)) != "SM")
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
     }
@@ -169,19 +169,19 @@
     DetectPixelFormat(format_, photometric_, reader);
 
     unsigned int tmp;
-    if (!reader.GetUnsignedIntegerValue(tileWidth_, OrthancStone::DicomPath(Orthanc::DICOM_TAG_COLUMNS)) ||
-        !reader.GetUnsignedIntegerValue(tileHeight_, OrthancStone::DicomPath(Orthanc::DICOM_TAG_ROWS)) ||
-        !reader.GetUnsignedIntegerValue(totalWidth_, OrthancStone::DicomPath(DICOM_TAG_TOTAL_PIXEL_MATRIX_COLUMNS)) ||
-        !reader.GetUnsignedIntegerValue(totalHeight_, OrthancStone::DicomPath(DICOM_TAG_TOTAL_PIXEL_MATRIX_ROWS)) ||
-        !reader.GetUnsignedIntegerValue(tmp, OrthancStone::DicomPath(Orthanc::DICOM_TAG_NUMBER_OF_FRAMES)))
+    if (!reader.GetUnsignedIntegerValue(tileWidth_, Orthanc::DicomPath(Orthanc::DICOM_TAG_COLUMNS)) ||
+        !reader.GetUnsignedIntegerValue(tileHeight_, Orthanc::DicomPath(Orthanc::DICOM_TAG_ROWS)) ||
+        !reader.GetUnsignedIntegerValue(totalWidth_, Orthanc::DicomPath(DICOM_TAG_TOTAL_PIXEL_MATRIX_COLUMNS)) ||
+        !reader.GetUnsignedIntegerValue(totalHeight_, Orthanc::DicomPath(DICOM_TAG_TOTAL_PIXEL_MATRIX_ROWS)) ||
+        !reader.GetUnsignedIntegerValue(tmp, Orthanc::DicomPath(Orthanc::DICOM_TAG_NUMBER_OF_FRAMES)))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
     }
 
-    imageType_ = reader.GetStringValue(OrthancStone::DicomPath(DICOM_TAG_IMAGE_TYPE), "");
+    imageType_ = reader.GetStringValue(Orthanc::DicomPath(DICOM_TAG_IMAGE_TYPE), "");
 
     size_t countFrames;
-    if (reader.GetDataset().GetSequenceSize(countFrames, OrthancStone::DicomPath(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE)))
+    if (reader.GetDataset().GetSequenceSize(countFrames, Orthanc::DicomPath(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE)))
     {
       if (countFrames != tmp)
       {
@@ -193,13 +193,13 @@
 
       for (size_t i = 0; i < countFrames; i++)
       {
-        DicomPath pathX(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
-                        DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
-                        DICOM_TAG_COLUMN_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
+        Orthanc::DicomPath pathX(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
+                                 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
+                                 DICOM_TAG_COLUMN_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
 
-        DicomPath pathY(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
-                        DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
-                        DICOM_TAG_ROW_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
+        Orthanc::DicomPath pathY(DICOM_TAG_PER_FRAME_FUNCTIONAL_GROUPS_SEQUENCE, i,
+                                 DICOM_TAG_PLANE_POSITION_SLIDE_SEQUENCE, 0,
+                                 DICOM_TAG_ROW_POSITION_IN_TOTAL_IMAGE_PIXEL_MATRIX);
 
         int xx, yy;
         if (!reader.GetIntegerValue(xx, pathX) ||
--- a/Resources/CMake/Version.cmake	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/CMake/Version.cmake	Sat Jun 12 09:20:44 2021 +0200
@@ -4,7 +4,7 @@
   set(ORTHANC_FRAMEWORK_VERSION "mainline")
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg")
 else()
-  set(ORTHANC_FRAMEWORK_VERSION "1.8.2")
+  set(ORTHANC_FRAMEWORK_VERSION "1.9.3")
   set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web")
 endif()
 
--- a/Resources/Orthanc/Stone/DicomDatasetReader.cpp	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/DicomDatasetReader.cpp	Sat Jun 12 09:20:44 2021 +0200
@@ -35,7 +35,7 @@
   }
   
 
-  std::string DicomDatasetReader::GetStringValue(const DicomPath& path,
+  std::string DicomDatasetReader::GetStringValue(const Orthanc::DicomPath& path,
                                                  const std::string& defaultValue) const
   {
     std::string s;
@@ -50,7 +50,7 @@
   }
 
 
-  std::string DicomDatasetReader::GetMandatoryStringValue(const DicomPath& path) const
+  std::string DicomDatasetReader::GetMandatoryStringValue(const Orthanc::DicomPath& path) const
   {
     std::string s;
     if (dataset_.GetStringValue(s, path))
@@ -67,7 +67,7 @@
   template <typename T>
   static bool GetValueInternal(T& target,
                                const IDicomDataset& dataset,
-                               const DicomPath& path)
+                               const Orthanc::DicomPath& path)
   {
     try
     {
@@ -91,14 +91,14 @@
 
 
   bool DicomDatasetReader::GetIntegerValue(int& target,
-                                           const DicomPath& path) const
+                                           const Orthanc::DicomPath& path) const
   {
     return GetValueInternal<int>(target, dataset_, path);
   }
 
 
   bool DicomDatasetReader::GetUnsignedIntegerValue(unsigned int& target,
-                                                   const DicomPath& path) const
+                                                   const Orthanc::DicomPath& path) const
   {
     int value;
 
@@ -119,14 +119,14 @@
 
 
   bool DicomDatasetReader::GetFloatValue(float& target,
-                                         const DicomPath& path) const
+                                         const Orthanc::DicomPath& path) const
   {
     return GetValueInternal<float>(target, dataset_, path);
   }
 
 
   bool DicomDatasetReader::GetDoubleValue(double& target,
-                                          const DicomPath& path) const
+                                          const Orthanc::DicomPath& path) const
   {
     return GetValueInternal<double>(target, dataset_, path);
   }
--- a/Resources/Orthanc/Stone/DicomDatasetReader.h	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/DicomDatasetReader.h	Sat Jun 12 09:20:44 2021 +0200
@@ -42,21 +42,21 @@
       return dataset_;
     }
 
-    std::string GetStringValue(const DicomPath& path,
+    std::string GetStringValue(const Orthanc::DicomPath& path,
                                const std::string& defaultValue) const;
 
-    std::string GetMandatoryStringValue(const DicomPath& path) const;
+    std::string GetMandatoryStringValue(const Orthanc::DicomPath& path) const;
 
     bool GetIntegerValue(int& target,
-                         const DicomPath& path) const;
+                         const Orthanc::DicomPath& path) const;
 
     bool GetUnsignedIntegerValue(unsigned int& target,
-                                 const DicomPath& path) const;
+                                 const Orthanc::DicomPath& path) const;
 
     bool GetFloatValue(float& target,
-                       const DicomPath& path) const;
+                       const Orthanc::DicomPath& path) const;
 
     bool GetDoubleValue(double& target,
-                        const DicomPath& path) const;
+                        const Orthanc::DicomPath& path) const;
   };
 }
--- a/Resources/Orthanc/Stone/DicomPath.cpp	Fri May 14 07:37:08 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,113 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2021 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/>.
- **/
-
-
-#include "DicomPath.h"
-
-#include <OrthancException.h>
-
-#include <boost/lexical_cast.hpp>
-
-namespace OrthancStone
-{
-  const DicomPath::Prefix& DicomPath::GetPrefixItem(size_t depth) const
-  {
-    if (depth >= prefix_.size())
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
-    }
-    else
-    {
-      return prefix_[depth];
-    }
-  }
-
-
-  DicomPath::Prefix& DicomPath::GetPrefixItem(size_t depth)
-  {
-    if (depth >= prefix_.size())
-    {
-      throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
-    }
-    else
-    {
-      return prefix_[depth];
-    }
-  }
-
-
-  DicomPath::DicomPath(const Orthanc::DicomTag& sequence,
-                       size_t index,
-                       const Orthanc::DicomTag& tag) :
-    finalTag_(tag)
-  {
-    AddToPrefix(sequence, index);
-  }
-
-
-  DicomPath::DicomPath(const Orthanc::DicomTag& sequence1,
-                       size_t index1,
-                       const Orthanc::DicomTag& sequence2,
-                       size_t index2,
-                       const Orthanc::DicomTag& tag) :
-    finalTag_(tag)
-  {
-    AddToPrefix(sequence1, index1);
-    AddToPrefix(sequence2, index2);
-  }
-
-
-  DicomPath::DicomPath(const Orthanc::DicomTag& sequence1,
-                       size_t index1,
-                       const Orthanc::DicomTag& sequence2,
-                       size_t index2,
-                       const Orthanc::DicomTag& sequence3,
-                       size_t index3,
-                       const Orthanc::DicomTag& tag) :
-    finalTag_(tag)
-  {
-    AddToPrefix(sequence1, index1);
-    AddToPrefix(sequence2, index2);
-    AddToPrefix(sequence3, index3);
-  }
-
-
-  static std::string FormatHexadecimal(const Orthanc::DicomTag& tag)
-  {
-    char buf[16];
-    sprintf(buf, "(%04x,%04x)", tag.GetGroup(), tag.GetElement());
-    return buf;
-  }
-  
-
-  std::string DicomPath::Format() const
-  {
-    std::string s;
-      
-    for (size_t i = 0; i < GetPrefixLength(); i++)
-    {
-      s += (FormatHexadecimal(GetPrefixTag(i)) + " / " +
-            boost::lexical_cast<std::string>(i) + " / ");
-    }
-
-    return s + FormatHexadecimal(GetFinalTag());
-  }
-}
--- a/Resources/Orthanc/Stone/DicomPath.h	Fri May 14 07:37:08 2021 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-/**
- * Stone of Orthanc
- * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
- * Department, University Hospital of Liege, Belgium
- * Copyright (C) 2017-2021 Osimis S.A., Belgium
- *
- * This program is free software: you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation, either version 3 of
- * the License, or (at your option) any later version.
- *
- * 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this program. If not, see
- * <http://www.gnu.org/licenses/>.
- **/
-
-
-#pragma once
-
-#include <DicomFormat/DicomTag.h>
-
-#include <vector>
-#include <stddef.h>
-
-namespace OrthancStone
-{
-  class DicomPath
-  {
-  private:
-    typedef std::pair<Orthanc::DicomTag, size_t>  Prefix;
-
-    std::vector<Prefix>  prefix_;
-    Orthanc::DicomTag    finalTag_;
-
-    const Prefix& GetPrefixItem(size_t depth) const;
-
-    Prefix& GetPrefixItem(size_t depth);
-
-  public:
-    explicit DicomPath(const Orthanc::DicomTag& finalTag) :
-      finalTag_(finalTag)
-    {
-    }
-
-    DicomPath(const Orthanc::DicomTag& sequence,
-              size_t index,
-              const Orthanc::DicomTag& tag);
-
-    DicomPath(const Orthanc::DicomTag& sequence1,
-              size_t index1,
-              const Orthanc::DicomTag& sequence2,
-              size_t index2,
-              const Orthanc::DicomTag& tag);
-
-    DicomPath(const Orthanc::DicomTag& sequence1,
-              size_t index1,
-              const Orthanc::DicomTag& sequence2,
-              size_t index2,
-              const Orthanc::DicomTag& sequence3,
-              size_t index3,
-              const Orthanc::DicomTag& tag);
-
-    void AddToPrefix(const Orthanc::DicomTag& tag,
-                     size_t position)
-    {
-      prefix_.push_back(std::make_pair(tag, position));
-    }
-
-    size_t GetPrefixLength() const
-    {
-      return prefix_.size();
-    }
-    
-    Orthanc::DicomTag GetPrefixTag(size_t depth) const
-    {
-      return GetPrefixItem(depth).first;
-    }
-
-    size_t GetPrefixIndex(size_t depth) const
-    {
-      return GetPrefixItem(depth).second;
-    }
-
-    void SetPrefixIndex(size_t depth,
-                        size_t value)
-    {
-      GetPrefixItem(depth).second = value;
-    }
-    
-    const Orthanc::DicomTag& GetFinalTag() const
-    {
-      return finalTag_;
-    }
-
-    void SetFinalTag(const Orthanc::DicomTag& tag)
-    {
-      finalTag_ = tag;
-    }
-
-    std::string Format() const;
-  };
-}
--- a/Resources/Orthanc/Stone/FullOrthancDataset.cpp	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/FullOrthancDataset.cpp	Sat Jun 12 09:20:44 2021 +0200
@@ -102,7 +102,7 @@
   }
 
 
-  const Json::Value* FullOrthancDataset::LookupPath(const DicomPath& path) const
+  const Json::Value* FullOrthancDataset::LookupPath(const Orthanc::DicomPath& path) const
   {
     const Json::Value* content = &root_;
                                   
@@ -171,7 +171,7 @@
 
 
   bool FullOrthancDataset::GetStringValue(std::string& result,
-                                          const DicomPath& path) const
+                                          const Orthanc::DicomPath& path) const
   {
     const Json::Value* value = LookupPath(path);
 
@@ -187,7 +187,7 @@
 
 
   bool FullOrthancDataset::GetSequenceSize(size_t& size,
-                                           const DicomPath& path) const
+                                           const Orthanc::DicomPath& path) const
   {
     const Json::Value* sequence = LookupPath(path);
 
--- a/Resources/Orthanc/Stone/FullOrthancDataset.h	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/FullOrthancDataset.h	Sat Jun 12 09:20:44 2021 +0200
@@ -36,7 +36,7 @@
   private:
     Json::Value   root_;
 
-    const Json::Value* LookupPath(const DicomPath& path) const;
+    const Json::Value* LookupPath(const Orthanc::DicomPath& path) const;
 
     void CheckRoot() const;
 
@@ -52,10 +52,10 @@
     explicit FullOrthancDataset(const Json::Value& root);
 
     virtual bool GetStringValue(std::string& result,
-                                const DicomPath& path) const ORTHANC_OVERRIDE;
+                                const Orthanc::DicomPath& path) const ORTHANC_OVERRIDE;
 
     virtual bool GetSequenceSize(size_t& size,
-                                 const DicomPath& path) const ORTHANC_OVERRIDE;
+                                 const Orthanc::DicomPath& path) const ORTHANC_OVERRIDE;
 
     FullOrthancDataset* Clone() const
     {
--- a/Resources/Orthanc/Stone/IDicomDataset.h	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/IDicomDataset.h	Sat Jun 12 09:20:44 2021 +0200
@@ -22,7 +22,7 @@
 
 #pragma once
 
-#include "DicomPath.h"
+#include <DicomFormat/DicomPath.h>  // From Orthanc framework
 
 #include <boost/noncopyable.hpp>
 #include <string>
@@ -37,9 +37,9 @@
     }
 
     virtual bool GetStringValue(std::string& result,
-                                const DicomPath& path) const = 0;
+                                const Orthanc::DicomPath& path) const = 0;
 
     virtual bool GetSequenceSize(size_t& size,
-                                 const DicomPath& path) const = 0;
+                                 const Orthanc::DicomPath& path) const = 0;
   };
 }
--- a/Resources/Orthanc/Stone/IOrthancConnection.h	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/Orthanc/Stone/IOrthancConnection.h	Sat Jun 12 09:20:44 2021 +0200
@@ -22,8 +22,6 @@
 
 #pragma once
 
-#include "DicomPath.h"
-
 #include <boost/noncopyable.hpp>
 #include <string>
 #include <json/value.h>
--- a/Resources/SyncOrthancFolder.py	Fri May 14 07:37:08 2021 +0200
+++ b/Resources/SyncOrthancFolder.py	Sat Jun 12 09:20:44 2021 +0200
@@ -35,8 +35,6 @@
 
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomDatasetReader.cpp', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomDatasetReader.h', 'Stone'),
-    ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomPath.cpp', 'Stone'),
-    ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/DicomPath.h', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/FullOrthancDataset.cpp', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/FullOrthancDataset.h', 'Stone'),
     ('orthanc-stone', 'OrthancStone/Sources/Toolbox/OrthancDatasets/IDicomDataset.h', 'Stone'),
--- a/ViewerPlugin/CMakeLists.txt	Fri May 14 07:37:08 2021 +0200
+++ b/ViewerPlugin/CMakeLists.txt	Sat Jun 12 09:20:44 2021 +0200
@@ -29,15 +29,25 @@
 SET(ORTHANC_WSI_DIR ${CMAKE_CURRENT_LIST_DIR}/..)
 SET(USE_OPENJPEG_JP2 ON)
 
+include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
+
 if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system")
-  set(ENABLE_DCMTK ON)
-  include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
-
+  if (ORTHANC_FRAMEWORK_USE_SHARED)
+    include(FindBoost)
+    find_package(Boost COMPONENTS system)
+    
+    if (NOT Boost_FOUND)
+      message(FATAL_ERROR "Unable to locate Boost on this system")
+    endif()
+    
+    include(FindDCMTK)
+    link_libraries(${Boost_LIBRARIES} ${DCMTK_LIBRARIES} jsoncpp)
+  endif()
+  
   include_directories(${ORTHANC_FRAMEWORK_ROOT})
   link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES})
   
 else()
-  include(${CMAKE_SOURCE_DIR}/../Resources/Orthanc/CMake/DownloadOrthancFramework.cmake)
   include(${ORTHANC_FRAMEWORK_ROOT}/../Resources/CMake/OrthancFrameworkParameters.cmake)
 
   set(ENABLE_LOCALE OFF)         # Disable support for locales (notably in Boost)
@@ -169,7 +179,6 @@
 
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/DicomDatasetReader.cpp
-  ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/DicomPath.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/FullOrthancDataset.cpp
   ${ORTHANC_WSI_DIR}/Resources/Orthanc/Stone/IOrthancConnection.cpp
   )