# HG changeset patch # User Sebastien Jodogne # Date 1650891478 -7200 # Node ID ef6ddcfed855a05d1cd8f7f33ae28b62100283f3 # Parent 206b763f9bcea3cbce4e9d177c2e5cecccc7a1a5 fix linking against system-wide Orthanc framework diff -r 206b763f9bce -r ef6ddcfed855 CMakeLists.txt --- a/CMakeLists.txt Mon Apr 25 11:12:00 2022 +0200 +++ b/CMakeLists.txt Mon Apr 25 14:57:58 2022 +0200 @@ -59,7 +59,8 @@ message(FATAL_ERROR "Unable to locate Boost on this system") endif() - link_libraries(${Boost_LIBRARIES} jsoncpp) + include(FindDCMTK) + link_libraries(${Boost_LIBRARIES} ${DCMTK_LIBRARIES} jsoncpp) endif() link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) @@ -158,7 +159,7 @@ Sources/Plugin/PluginFrameDecoder.cpp ${NEURO_SOURCES} - ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp + ${CMAKE_SOURCE_DIR}/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp ) add_dependencies(OrthancNeuro AutogeneratedTarget) @@ -168,7 +169,6 @@ Sources/UnitTestsSources/UnitTestsMain.cpp ${NEURO_SOURCES} - ${ORTHANC_FRAMEWORK_ROOT}/../../OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp ${GOOGLE_TEST_SOURCES} ) diff -r 206b763f9bce -r ef6ddcfed855 Sources/Framework/InputDicomInstance.cpp --- a/Sources/Framework/InputDicomInstance.cpp Mon Apr 25 11:12:00 2022 +0200 +++ b/Sources/Framework/InputDicomInstance.cpp Mon Apr 25 14:57:58 2022 +0200 @@ -611,7 +611,8 @@ !GetCSAHeader().ParseUnsignedInteger32(numberOfImagesInMosaic, CSA_NUMBER_OF_IMAGES_IN_MOSAIC) || numberOfImagesInMosaic == 0) { - throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat); + ExtractGenericSlices(slices, instanceIndexInCollection); + return; } const unsigned int countPerAxis = static_cast(std::ceil(sqrtf(numberOfImagesInMosaic))); diff -r 206b763f9bce -r ef6ddcfed855 Sources/Framework/InputDicomInstance.h --- a/Sources/Framework/InputDicomInstance.h Mon Apr 25 11:12:00 2022 +0200 +++ b/Sources/Framework/InputDicomInstance.h Mon Apr 25 14:57:58 2022 +0200 @@ -19,10 +19,6 @@ #pragma once -#if !defined(ORTHANC_ENABLE_DCMTK) -# error The macro ORTHANC_ENABLE_DCMTK must be defined -#endif - #include "CSAHeader.h" #include "NeuroEnumerations.h" #include "Slice.h" @@ -30,6 +26,10 @@ #include #include +#if !defined(ORTHANC_ENABLE_DCMTK) +# error The macro ORTHANC_ENABLE_DCMTK must be defined +#endif + #if ORTHANC_ENABLE_DCMTK == 1 # include #endif