Mercurial > hg > orthanc-stone
diff Framework/Radiography/RadiographyDicomLayer.cpp @ 1125:d7e06542304c broker
integration mainline->broker
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 05 Nov 2019 18:51:04 +0100 |
parents | b537002f83a9 35e798b16b65 |
children | 54cbffabdc45 |
line wrap: on
line diff
--- 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<Orthanc::ImageAccessor> 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) {