diff Framework/Radiography/RadiographyDicomLayer.cpp @ 1279:7ec8fea061b9 broker

integration mainline->broker
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 04 Feb 2020 15:20:08 +0100
parents b519c1c878f1 a989c7d46b9a
children 68579a31eeb4
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyDicomLayer.cpp	Fri Jan 31 17:34:57 2020 +0100
+++ b/Framework/Radiography/RadiographyDicomLayer.cpp	Tue Feb 04 15:20:08 2020 +0100
@@ -113,7 +113,7 @@
     BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
   }
 
-  void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY)   // Takes ownership
+  void RadiographyDicomLayer::SetSourceImage(Orthanc::ImageAccessor* image, double newPixelSpacingX, double newPixelSpacingY, bool emitLayerEditedEvent)   // Takes ownership
   {
     std::auto_ptr<Orthanc::ImageAccessor> raii(image);
 
@@ -122,14 +122,17 @@
       throw Orthanc::OrthancException(Orthanc::ErrorCode_NullPointer);
     }
 
-    SetSize(image->GetWidth(), image->GetHeight());
+    SetSize(image->GetWidth(), image->GetHeight(), false);
 
     source_ = raii;
     ApplyConverter();
 
     SetPixelSpacing(newPixelSpacingX, newPixelSpacingY, false);
 
-    BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
+    if (emitLayerEditedEvent)
+    {
+      BroadcastMessage(RadiographyLayer::LayerEditedMessage(*this));
+    }
   }