# HG changeset patch # User Sebastien Jodogne # Date 1572976264 -3600 # Node ID d7e06542304cc2b7fcfd33c684c585f5b30817a2 # Parent a8bf817568392d8104f507d83bd0b1a952e99753# Parent 45df56448b2ac681ee865593395d8d398b0cc5fb integration mainline->broker diff -r a8bf81756839 -r d7e06542304c Framework/Radiography/RadiographyDicomLayer.cpp --- a/Framework/Radiography/RadiographyDicomLayer.cpp Tue Nov 05 18:49:06 2019 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.cpp Tue Nov 05 18:51:04 2019 +0100 @@ -112,6 +112,25 @@ BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); } + void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY) // Takes ownership + { + std::auto_ptr raii(image); + + if (image == NULL) + { + throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer); + } + + SetSize(image->GetWidth(), image->GetHeight()); + + source_ = raii; + ApplyConverter(); + + SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false); + + BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); + } + void RadiographyDicomLayer::SetDicomFrameConverter(Deprecated::DicomFrameConverter* converter) { diff -r a8bf81756839 -r d7e06542304c Framework/Radiography/RadiographyDicomLayer.h --- a/Framework/Radiography/RadiographyDicomLayer.h Tue Nov 05 18:49:06 2019 +0100 +++ b/Framework/Radiography/RadiographyDicomLayer.h Tue Nov 05 18:51:04 2019 +0100 @@ -80,6 +80,8 @@ void SetSourceImage(Orthanc::ImageAccessor* image); // Takes ownership + void SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY); // Takes ownership + const Orthanc::ImageAccessor* GetSourceImage() const {return source_.get();} // currently need this access to serialize scene in plain old data to send to a WASM worker const Deprecated::DicomFrameConverter& GetDicomFrameConverter() const {return *converter_;} // currently need this access to serialize scene in plain old data to send to a WASM worker diff -r a8bf81756839 -r d7e06542304c Framework/Radiography/RadiographyLayer.cpp --- a/Framework/Radiography/RadiographyLayer.cpp Tue Nov 05 18:49:06 2019 +0100 +++ b/Framework/Radiography/RadiographyLayer.cpp Tue Nov 05 18:51:04 2019 +0100 @@ -312,11 +312,15 @@ void RadiographyLayer::SetPixelSpacing(double x, - double y) + double y, + bool emitLayerEditedEvent) { geometry_.SetPixelSpacing(x, y); UpdateTransform(); - BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); + if (emitLayerEditedEvent) + { + BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this)); + } } diff -r a8bf81756839 -r d7e06542304c Framework/Radiography/RadiographyLayer.h --- a/Framework/Radiography/RadiographyLayer.h Tue Nov 05 18:49:06 2019 +0100 +++ b/Framework/Radiography/RadiographyLayer.h Tue Nov 05 18:51:04 2019 +0100 @@ -323,7 +323,8 @@ double sceneY) const; void SetPixelSpacing(double x, - double y); + double y, + bool emitLayerEditedEvent = true); void GetCenter(double& centerX, double& centerY) const; diff -r a8bf81756839 -r d7e06542304c Framework/Radiography/RadiographyScene.h --- a/Framework/Radiography/RadiographyScene.h Tue Nov 05 18:49:06 2019 +0100 +++ b/Framework/Radiography/RadiographyScene.h Tue Nov 05 18:51:04 2019 +0100 @@ -150,7 +150,7 @@ protected: RadiographyLayer& RegisterLayer(RadiographyLayer* layer); - void OnTagsReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message); + virtual void OnTagsReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message); virtual void OnFrameReceived(const Deprecated::OrthancApiClient::BinaryResponseReadyMessage& message); diff -r a8bf81756839 -r d7e06542304c UnitTestsSources/TestStructureSet.cpp --- a/UnitTestsSources/TestStructureSet.cpp Tue Nov 05 18:49:06 2019 +0100 +++ b/UnitTestsSources/TestStructureSet.cpp Tue Nov 05 18:51:04 2019 +0100 @@ -18,6 +18,16 @@ * along with this program. If not, see . **/ +// working around a bug where the Visual C++ compiler would get +// stuck trying to compile this cpp file in release mode +// (versions: https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B) +#ifdef _MSC_VER +# pragma optimize("", off) +// warning C4748: /GS can not protect parameters and local variables from +// local buffer overrun because optimizations are disabled in function +# pragma warning(disable: 4748) +#endif + #include "Framework/Toolbox/DicomStructureSetUtils.h" #include "Framework/Toolbox/DicomStructureSet2.h" #include "Framework/Toolbox/DisjointDataSet.h" @@ -5401,3 +5411,4 @@ // BGO_ENABLE_DICOMSTRUCTURESETLOADER2 +