Mercurial > hg > orthanc-stone
diff Framework/Radiography/RadiographyScene.cpp @ 1308:adf234ecaa00 broker
Merge
author | Benjamin Golinvaux <bgo@osimis.io> |
---|---|
date | Wed, 04 Mar 2020 10:21:54 +0100 |
parents | 257f2c9a02ac |
children | 1f877e0846fe |
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyScene.cpp Wed Mar 04 10:07:37 2020 +0100 +++ b/Framework/Radiography/RadiographyScene.cpp Wed Mar 04 10:21:54 2020 +0100 @@ -127,7 +127,7 @@ void RadiographyScene::_RegisterLayer(RadiographyLayer* layer) { - std::auto_ptr<RadiographyLayer> raii(layer); + std::unique_ptr<RadiographyLayer> raii(layer); // LOG(INFO) << "Registering layer: " << countLayers_; @@ -324,7 +324,7 @@ RadiographyLayer::Geometry* centerGeometry, bool isCenterGeometry) { - std::auto_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(*this)); + std::unique_ptr<RadiographyTextLayer> alpha(new RadiographyTextLayer(*this)); alpha->SetText(utf8, font, fontSize, foreground); if (centerGeometry != NULL) { @@ -352,7 +352,7 @@ unsigned int height, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); + std::unique_ptr<Orthanc::Image> block(new Orthanc::Image(Orthanc::PixelFormat_Grayscale8, width, height, false)); for (unsigned int padding = 0; (width > 2 * padding) && (height > 2 * padding); @@ -381,7 +381,7 @@ float foreground, RadiographyLayer::Geometry* geometry) { - std::auto_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(*this, dicomLayer, foreground)); + std::unique_ptr<RadiographyMaskLayer> mask(new RadiographyMaskLayer(*this, dicomLayer, foreground)); mask->SetCorners(corners); if (geometry != NULL) { @@ -394,7 +394,7 @@ RadiographyLayer& RadiographyScene::LoadAlphaBitmap(Orthanc::ImageAccessor* bitmap, RadiographyLayer::Geometry *geometry) { - std::auto_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(*this)); + std::unique_ptr<RadiographyAlphaLayer> alpha(new RadiographyAlphaLayer(*this)); alpha->SetAlpha(bitmap); if (geometry != NULL) { @@ -490,8 +490,8 @@ size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&> (message.GetPayload()).GetValue(); - LOG(INFO) << "JSON received: " << message.GetUri().c_str() - << " (" << message.GetAnswerSize() << " bytes) for layer " << index; + VLOG(1) << "JSON received: " << message.GetUri().c_str() + << " (" << message.GetAnswerSize() << " bytes) for layer " << index; Layers::iterator layer = layers_.find(index); if (layer != layers_.end()) @@ -519,8 +519,8 @@ { size_t index = dynamic_cast<const Orthanc::SingleValueObject<size_t>&>(message.GetPayload()).GetValue(); - LOG(INFO) << "DICOM frame received: " << message.GetUri().c_str() - << " (" << message.GetAnswerSize() << " bytes) for layer " << index; + VLOG(1) << "DICOM frame received: " << message.GetUri().c_str() + << " (" << message.GetAnswerSize() << " bytes) for layer " << index; Layers::iterator layer = layers_.find(index); if (layer != layers_.end()) @@ -533,7 +533,7 @@ content.assign(reinterpret_cast<const char*>(message.GetAnswer()), message.GetAnswerSize()); } - std::auto_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); + std::unique_ptr<Orthanc::PamReader> reader(new Orthanc::PamReader); reader->ReadFromMemory(content); dynamic_cast<RadiographyDicomLayer*>(layer->second)->SetSourceImage(reader.release()); @@ -724,7 +724,7 @@ Render(layers, view, interpolation, applyWindowing); - std::auto_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, + std::unique_ptr<Orthanc::Image> rendered(new Orthanc::Image(Orthanc::PixelFormat_Grayscale16, layers.GetWidth(), layers.GetHeight(), false)); Orthanc::ImageProcessing::Convert(*rendered, layers); @@ -745,7 +745,7 @@ { LOG(INFO) << "Exporting RadiographyScene to DICOM"; - std::auto_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags + std::unique_ptr<Orthanc::Image> rendered(ExportToImage(pixelSpacingX, pixelSpacingY, interpolation, false)); // note: we don't invert the image in the pixels data because we'll set the PhotometricDisplayMode correctly in the DICOM tags createDicomRequestContent["Tags"] = dicomTags; @@ -800,7 +800,7 @@ LOG(INFO) << "Exporting RadiographyScene to DICOM"; VLOG(1) << "Exporting RadiographyScene to: export to image"; - std::auto_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); + std::unique_ptr<Orthanc::Image> rendered(ExportToCreateDicomRequestAndImage(createDicomRequestContent, dicomTags, parentOrthancId, pixelSpacingX, pixelSpacingY, invert, interpolation)); // convert the image into base64 for inclusing in the createDicomRequest std::string base64;