comparison Framework/Radiography/RadiographyScene.cpp @ 427:3f9017db1738 am-vsol-upgrade-radiography-export

wip
author am@osimis.io
date Fri, 23 Nov 2018 16:06:23 +0100
parents 660fe6f6bf4a
children b85f635f1eb5
comparison
equal deleted inserted replaced
426:660fe6f6bf4a 427:3f9017db1738
163 163
164 SetSize(image->GetWidth(), image->GetHeight()); 164 SetSize(image->GetWidth(), image->GetHeight());
165 alpha_ = raii; 165 alpha_ = raii;
166 } 166 }
167 167
168
169 void LoadText(const Orthanc::Font& font,
170 const std::string& utf8)
171 {
172 SetAlpha(font.RenderAlpha(utf8));
173 }
174
175
176 virtual bool GetDefaultWindowing(float& center, 168 virtual bool GetDefaultWindowing(float& center,
177 float& width) const 169 float& width) const
178 { 170 {
179 return false; 171 return false;
180 } 172 }
263 return true; 255 return true;
264 } 256 }
265 } 257 }
266 }; 258 };
267 259
260
261 class RadiographyScene::TextLayer : public AlphaLayer
262 {
263 private:
264 std::string text_;
265
266 public:
267 TextLayer(const RadiographyScene& scene) :
268 AlphaLayer(scene)
269 {
270 }
271
272 void LoadText(const Orthanc::Font& font,
273 const std::string& utf8)
274 {
275 SetAlpha(font.RenderAlpha(utf8));
276 }
277
278 };
268 279
269 280
270 class RadiographyScene::DicomLayer : public RadiographyLayer 281 class RadiographyScene::DicomLayer : public RadiographyLayer
271 { 282 {
272 private: 283 private:
752 maxValue = 0; 763 maxValue = 0;
753 } 764 }
754 } 765 }
755 766
756 767
768 void RadiographyScene::ExportToJson(Json::Value &output)
769 {
770 for (Layers::iterator it = layers_.begin(); it != layers_.end(); it++)
771 {
772 Json::Value jsonLayer;
773 it->
774
775 }
776 }
777
757 void RadiographyScene::ExportDicom(OrthancApiClient& orthanc, 778 void RadiographyScene::ExportDicom(OrthancApiClient& orthanc,
758 const Orthanc::DicomMap& dicom, 779 const Orthanc::DicomMap& dicom,
759 const std::string& parentOrthancId, 780 const std::string& parentOrthancId,
760 double pixelSpacingX, 781 double pixelSpacingX,
761 double pixelSpacingY, 782 double pixelSpacingY,
763 ImageInterpolation interpolation, 784 ImageInterpolation interpolation,
764 bool usePam) 785 bool usePam)
765 { 786 {
766 Json::Value createDicomRequestContent; 787 Json::Value createDicomRequestContent;
767 788
768 Export(createDicomRequestContent, dicom, pixelSpacingX, pixelSpacingY, invert, interpolation, usePam); 789 ExportToCreateDicomRequest(createDicomRequestContent, dicom, pixelSpacingX, pixelSpacingY, invert, interpolation, usePam);
769 790
770 if (!parentOrthancId.empty()) 791 if (!parentOrthancId.empty())
771 { 792 {
772 createDicomRequestContent["Parent"] = parentOrthancId; 793 createDicomRequestContent["Parent"] = parentOrthancId;
773 } 794 }
779 NULL, NULL); 800 NULL, NULL);
780 } 801 }
781 802
782 // Export using PAM is faster than using PNG, but requires Orthanc 803 // Export using PAM is faster than using PNG, but requires Orthanc
783 // core >= 1.4.3 804 // core >= 1.4.3
784 void RadiographyScene::Export(Json::Value& createDicomRequestContent, 805 void RadiographyScene::ExportToCreateDicomRequest(Json::Value& createDicomRequestContent,
785 const Orthanc::DicomMap& dicom, 806 const Orthanc::DicomMap& dicom,
786 double pixelSpacingX, 807 double pixelSpacingX,
787 double pixelSpacingY, 808 double pixelSpacingY,
788 bool invert, 809 bool invert,
789 ImageInterpolation interpolation, 810 ImageInterpolation interpolation,