Mercurial > hg > orthanc-stone
comparison Framework/Radiography/RadiographyScene.cpp @ 541:b336dfa71f12 dev
logs
author | Alain Mazy <alain@mazy.be> |
---|---|
date | Wed, 20 Mar 2019 10:11:53 +0100 |
parents | ce49eae4c887 |
children | 92305ee35b1c |
comparison
equal
deleted
inserted
replaced
537:d785ee57bd95 | 541:b336dfa71f12 |
---|---|
556 pixelSpacingY <= 0) | 556 pixelSpacingY <= 0) |
557 { | 557 { |
558 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); | 558 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
559 } | 559 } |
560 | 560 |
561 LOG(INFO) << "Exporting DICOM"; | |
562 | |
563 Extent2D extent = GetSceneExtent(); | 561 Extent2D extent = GetSceneExtent(); |
564 | 562 |
565 int w = static_cast<int>(std::ceil(extent.GetWidth() / pixelSpacingX)); | 563 int w = static_cast<int>(std::ceil(extent.GetWidth() / pixelSpacingX)); |
566 int h = static_cast<int>(std::ceil(extent.GetHeight() / pixelSpacingY)); | 564 int h = static_cast<int>(std::ceil(extent.GetHeight() / pixelSpacingY)); |
567 | 565 |
601 double pixelSpacingY, | 599 double pixelSpacingY, |
602 bool invert, | 600 bool invert, |
603 ImageInterpolation interpolation, | 601 ImageInterpolation interpolation, |
604 bool usePam) | 602 bool usePam) |
605 { | 603 { |
604 LOG(INFO) << "Exporting RadiographyScene to DICOM"; | |
605 VLOG(1) << "Exporting RadiographyScene to: export to image"; | |
606 | |
606 std::auto_ptr<Orthanc::Image> 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 | 607 std::auto_ptr<Orthanc::Image> 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 |
607 | 608 |
608 std::string base64; | 609 std::string base64; |
609 | 610 |
610 { | 611 { |
611 std::string content; | 612 std::string content; |
612 | 613 |
613 if (usePam) | 614 if (usePam) |
614 { | 615 { |
616 VLOG(1) << "Exporting RadiographyScene: convert to PAM"; | |
615 Orthanc::PamWriter writer; | 617 Orthanc::PamWriter writer; |
616 writer.WriteToMemory(content, *rendered); | 618 writer.WriteToMemory(content, *rendered); |
617 } | 619 } |
618 else | 620 else |
619 { | 621 { |
620 Orthanc::PngWriter writer; | 622 Orthanc::PngWriter writer; |
621 writer.WriteToMemory(content, *rendered); | 623 writer.WriteToMemory(content, *rendered); |
622 } | 624 } |
623 | 625 |
626 VLOG(1) << "Exporting RadiographyScene: encoding to base64"; | |
624 Orthanc::Toolbox::EncodeBase64(base64, content); | 627 Orthanc::Toolbox::EncodeBase64(base64, content); |
625 } | 628 } |
626 | 629 |
627 createDicomRequestContent["Tags"] = dicomTags; | 630 createDicomRequestContent["Tags"] = dicomTags; |
628 | 631 |
665 if (!parentOrthancId.empty()) | 668 if (!parentOrthancId.empty()) |
666 { | 669 { |
667 createDicomRequestContent["Parent"] = parentOrthancId; | 670 createDicomRequestContent["Parent"] = parentOrthancId; |
668 } | 671 } |
669 | 672 |
673 VLOG(1) << "Exporting RadiographyScene: create-dicom request is ready"; | |
670 } | 674 } |
671 | 675 |
672 | 676 |
673 void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, | 677 void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, |
674 const Json::Value& dicomTags, | 678 const Json::Value& dicomTags, |