# HG changeset patch # User Alain Mazy # Date 1550225324 -3600 # Node ID 7bf001b9d2448b8bf16e9fa5154e379392ff7589 # Parent 29fc066b6f65e7be3980ded0170f98888b7fbf17 re-added ExportToCreateDicomRequest diff -r 29fc066b6f65 -r 7bf001b9d244 Framework/Radiography/RadiographyScene.cpp --- a/Framework/Radiography/RadiographyScene.cpp Fri Feb 15 10:39:23 2019 +0100 +++ b/Framework/Radiography/RadiographyScene.cpp Fri Feb 15 11:08:44 2019 +0100 @@ -587,17 +587,15 @@ } - void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, - const Json::Value& dicomTags, - const std::string& parentOrthancId, - double pixelSpacingX, - double pixelSpacingY, - bool invert, - ImageInterpolation interpolation, - bool usePam) + void RadiographyScene::ExportToCreateDicomRequest(Json::Value& createDicomRequestContent, + const Json::Value& dicomTags, + const std::string& parentOrthancId, + double pixelSpacingX, + double pixelSpacingY, + bool invert, + ImageInterpolation interpolation, + bool usePam) { - Json::Value createDicomRequestContent; - std::auto_ptr rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags std::string base64; @@ -662,6 +660,22 @@ createDicomRequestContent["Parent"] = parentOrthancId; } + } + + + void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, + const Json::Value& dicomTags, + const std::string& parentOrthancId, + double pixelSpacingX, + double pixelSpacingY, + bool invert, + ImageInterpolation interpolation, + bool usePam) + { + Json::Value createDicomRequestContent; + + ExportToCreateDicomRequest(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation, usePam); + orthanc.PostJsonAsyncExpectJson( "/tools/create-dicom", createDicomRequestContent, new Callable diff -r 29fc066b6f65 -r 7bf001b9d244 Framework/Radiography/RadiographyScene.h --- a/Framework/Radiography/RadiographyScene.h Fri Feb 15 10:39:23 2019 +0100 +++ b/Framework/Radiography/RadiographyScene.h Fri Feb 15 11:08:44 2019 +0100 @@ -213,11 +213,20 @@ ImageInterpolation interpolation, bool usePam); + void ExportToCreateDicomRequest(Json::Value& createDicomRequestContent, + const Json::Value& dicomTags, + const std::string& parentOrthancId, + double pixelSpacingX, + double pixelSpacingY, + bool invert, + ImageInterpolation interpolation, + bool usePam); + Orthanc::Image* ExportToImage(double pixelSpacingX, double pixelSpacingY, ImageInterpolation interpolation) { - ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false, 0); + return ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false, 0); } Orthanc::Image* ExportToImage(double pixelSpacingX,