# HG changeset patch # User Benjamin Golinvaux # Date 1570450169 -7200 # Node ID 7b89e88bb66ebd3cd89d414d1010310c7d4cfbac # Parent 7014c2397b457802771d1b5b8048472fa900d8a8# Parent 0f100d0b9caff89460382138d7cc542f82be2746 Merge diff -r 7014c2397b45 -r 7b89e88bb66e Framework/Radiography/RadiographySceneReader.cpp --- a/Framework/Radiography/RadiographySceneReader.cpp Mon Oct 07 14:05:01 2019 +0200 +++ b/Framework/Radiography/RadiographySceneReader.cpp Mon Oct 07 14:09:29 2019 +0200 @@ -140,7 +140,6 @@ } } - void RadiographySceneReader::Read(const Json::Value& input) { unsigned int version = input["version"].asUInt(); @@ -228,6 +227,19 @@ } } + void RadiographySceneBuilder::ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input) + { + for(size_t layerIndex = 0; layerIndex < input["layers"].size(); layerIndex++) + { + const Json::Value& jsonLayer = input["layers"][(int)layerIndex]; + if (jsonLayer["type"].asString() == "dicom") + { + ReadLayerGeometry(geometry, jsonLayer); + return; + } + } + } + void RadiographySceneBuilder::ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& jsonLayer) { {// crop diff -r 7014c2397b45 -r 7b89e88bb66e Framework/Radiography/RadiographySceneReader.h --- a/Framework/Radiography/RadiographySceneReader.h Mon Oct 07 14:05:01 2019 +0200 +++ b/Framework/Radiography/RadiographySceneReader.h Mon Oct 07 14:09:29 2019 +0200 @@ -64,9 +64,12 @@ fontRegistry_ = &fontRegistry; } + static void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input); + static void ReadDicomLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input); + protected: - void ReadLayerGeometry(RadiographyLayer::Geometry& geometry, const Json::Value& input); virtual RadiographyDicomLayer* LoadDicom(const std::string& instanceId, unsigned int frame, RadiographyLayer::Geometry* geometry); + }; diff -r 7014c2397b45 -r 7b89e88bb66e Framework/Toolbox/AffineTransform2D.cpp --- a/Framework/Toolbox/AffineTransform2D.cpp Mon Oct 07 14:05:01 2019 +0200 +++ b/Framework/Toolbox/AffineTransform2D.cpp Mon Oct 07 14:09:29 2019 +0200 @@ -197,6 +197,18 @@ d.GetHomogeneousMatrix())); } + AffineTransform2D AffineTransform2D::Combine(const AffineTransform2D& a, + const AffineTransform2D& b, + const AffineTransform2D& c, + const AffineTransform2D& d, + const AffineTransform2D& e) + { + return AffineTransform2D(LinearAlgebra::Product(a.GetHomogeneousMatrix(), + b.GetHomogeneousMatrix(), + c.GetHomogeneousMatrix(), + d.GetHomogeneousMatrix(), + e.GetHomogeneousMatrix())); + } AffineTransform2D AffineTransform2D::CreateOffset(double dx, double dy) diff -r 7014c2397b45 -r 7b89e88bb66e Framework/Toolbox/AffineTransform2D.h --- a/Framework/Toolbox/AffineTransform2D.h Mon Oct 07 14:05:01 2019 +0200 +++ b/Framework/Toolbox/AffineTransform2D.h Mon Oct 07 14:09:29 2019 +0200 @@ -77,6 +77,12 @@ const AffineTransform2D& c, const AffineTransform2D& d); + static AffineTransform2D Combine(const AffineTransform2D& a, + const AffineTransform2D& b, + const AffineTransform2D& c, + const AffineTransform2D& d, + const AffineTransform2D& e); + static AffineTransform2D CreateOffset(double dx, double dy); diff -r 7014c2397b45 -r 7b89e88bb66e Framework/Toolbox/DicomInstanceParameters.cpp --- a/Framework/Toolbox/DicomInstanceParameters.cpp Mon Oct 07 14:05:01 2019 +0200 +++ b/Framework/Toolbox/DicomInstanceParameters.cpp Mon Oct 07 14:09:29 2019 +0200 @@ -339,11 +339,11 @@ Orthanc::ImageProcessing::Convert(*converted, pixelData); // Correct rescale slope/intercept if need be - data_.ApplyRescale(*converted, (pixelData.GetFormat() == Orthanc::PixelFormat_Grayscale32)); + //data_.ApplyRescale(*converted, (pixelData.GetFormat() == Orthanc::PixelFormat_Grayscale32)); + data_.ApplyRescale(*converted, false); return converted.release(); } - TextureBaseSceneLayer* DicomInstanceParameters::CreateTexture diff -r 7014c2397b45 -r 7b89e88bb66e Resources/CMake/OrthancStoneConfiguration.cmake --- a/Resources/CMake/OrthancStoneConfiguration.cmake Mon Oct 07 14:05:01 2019 +0200 +++ b/Resources/CMake/OrthancStoneConfiguration.cmake Mon Oct 07 14:09:29 2019 +0200 @@ -106,7 +106,7 @@ if (ENABLE_SDL AND ENABLE_QT) - message("SDL and QT may not be defined together") + message("SDL and QT cannot not be enabled together") elseif(ENABLE_SDL) message("SDL is enabled") include(${CMAKE_CURRENT_LIST_DIR}/SdlConfiguration.cmake) @@ -267,10 +267,13 @@ endif() if (ENABLE_SDL OR ENABLE_QT) - list(APPEND APPLICATIONS_SOURCES - ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationRunner.cpp - ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationContext.cpp - ) + if (ENABLE_STONE_DEPRECATED) + list(APPEND APPLICATIONS_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationRunner.cpp + ${ORTHANC_STONE_ROOT}/Applications/Generic/NativeStoneApplicationContext.cpp + ) + endif() + if (ENABLE_SDL) list(APPEND APPLICATIONS_SOURCES ${ORTHANC_STONE_ROOT}/Applications/Sdl/SdlCairoSurface.cpp diff -r 7014c2397b45 -r 7b89e88bb66e Resources/CMake/QtConfiguration.cmake --- a/Resources/CMake/QtConfiguration.cmake Mon Oct 07 14:05:01 2019 +0200 +++ b/Resources/CMake/QtConfiguration.cmake Mon Oct 07 14:09:29 2019 +0200 @@ -58,17 +58,26 @@ endif() + list(APPEND QT_SOURCES ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.cpp - ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp - ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp ) ORTHANC_QT_WRAP_CPP(QT_SOURCES ${ORTHANC_STONE_ROOT}/Applications/Qt/QCairoWidget.h - ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.h ) +if (ENABLE_STONE_DEPRECATED) + list(APPEND QT_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Qt/QtStoneApplicationRunner.cpp + ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.cpp + ) + + ORTHANC_QT_WRAP_CPP(QT_SOURCES + ${ORTHANC_STONE_ROOT}/Applications/Qt/QStoneMainWindow.h + ) +endif() + # NB: Including CMAKE_CURRENT_BINARY_DIR is mandatory, as the CMake # macros for Qt will put their result in that directory, which cannot