comparison UnitTestsSources/UnitTestsMain.cpp @ 732:c35e98d22764

move Deprecated classes to a separate folder
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 21 May 2019 14:27:35 +0200
parents 93a8949a1ef7
children 4fe4b221a31f
comparison
equal deleted inserted replaced
729:529189f399ec 732:c35e98d22764
17 * You should have received a copy of the GNU Affero General Public License 17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/ 19 **/
20 20
21 21
22 #include "../Framework/dev.h"
23 #include "gtest/gtest.h" 22 #include "gtest/gtest.h"
24 23
25 #include "../Framework/Layers/FrameRenderer.h" 24 #include "../Framework/Deprecated/Layers/FrameRenderer.h"
26 #include "../Framework/Toolbox/DownloadStack.h" 25 #include "../Framework/Deprecated/Toolbox/DownloadStack.h"
26 #include "../Framework/Deprecated/Toolbox/OrthancSlicesLoader.h"
27 #include "../Framework/Toolbox/FiniteProjectiveCamera.h" 27 #include "../Framework/Toolbox/FiniteProjectiveCamera.h"
28 #include "../Framework/Toolbox/GeometryToolbox.h"
28 #include "../Framework/Toolbox/MessagingToolbox.h" 29 #include "../Framework/Toolbox/MessagingToolbox.h"
29 #include "../Framework/Toolbox/OrthancSlicesLoader.h"
30 #include "../Framework/Volumes/ImageBuffer3D.h" 30 #include "../Framework/Volumes/ImageBuffer3D.h"
31 #include "../Platforms/Generic/OracleWebService.h" 31 #include "../Platforms/Generic/OracleWebService.h"
32 32
33 #include <Core/HttpClient.h> 33 #include <Core/HttpClient.h>
34 #include <Core/Images/ImageProcessing.h> 34 #include <Core/Images/ImageProcessing.h>
38 38
39 #include <boost/lexical_cast.hpp> 39 #include <boost/lexical_cast.hpp>
40 #include <boost/date_time/posix_time/posix_time.hpp> 40 #include <boost/date_time/posix_time/posix_time.hpp>
41 #include <boost/thread/thread.hpp> 41 #include <boost/thread/thread.hpp>
42 #include <boost/math/special_functions/round.hpp> 42 #include <boost/math/special_functions/round.hpp>
43
44
45 #if 0
46 namespace OrthancStone
47 {
48 class Tata : public OrthancSlicesLoader::ICallback
49 {
50 public:
51 virtual void NotifyGeometryReady(const OrthancSlicesLoader& loader)
52 {
53 printf(">> %d\n", (int) loader.GetSliceCount());
54
55 for (size_t i = 0; i < loader.GetSliceCount(); i++)
56 {
57 const_cast<OrthancSlicesLoader&>(loader).ScheduleLoadSliceImage(i, SliceImageQuality_FullPng);
58 }
59 }
60
61 virtual void NotifyGeometryError(const OrthancSlicesLoader& loader)
62 {
63 printf("Error\n");
64 }
65
66 virtual void NotifySliceImageReady(const OrthancSlicesLoader& loader,
67 unsigned int sliceIndex,
68 const Slice& slice,
69 std::auto_ptr<Orthanc::ImageAccessor>& image,
70 SliceImageQuality quality)
71 {
72 std::auto_ptr<Orthanc::ImageAccessor> tmp(image);
73 printf("Slice OK %dx%d\n", tmp->GetWidth(), tmp->GetHeight());
74 }
75
76 virtual void NotifySliceImageError(const OrthancSlicesLoader& loader,
77 unsigned int sliceIndex,
78 const Slice& slice,
79 SliceImageQuality quality)
80 {
81 printf("ERROR 2\n");
82 }
83 };
84 }
85
86
87 TEST(Toto, DISABLED_Tutu)
88 {
89 OrthancStone::Oracle oracle(4);
90 oracle.Start();
91
92 Orthanc::WebServiceParameters web;
93 //OrthancStone::OrthancAsynchronousWebService orthanc(web, 4);
94 OrthancStone::OracleWebService orthanc(oracle, web);
95 //orthanc.Start();
96
97 OrthancStone::Tata tata;
98 OrthancStone::OrthancSlicesLoader loader(tata, orthanc);
99 loader.ScheduleLoadSeries("c1c4cb95-05e3bd11-8da9f5bb-87278f71-0b2b43f5");
100 //loader.ScheduleLoadSeries("67f1b334-02c16752-45026e40-a5b60b6b-030ecab5");
101
102 //loader.ScheduleLoadInstance("19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5", 0);
103
104 /*printf(">> %d\n", loader.GetSliceCount());
105 loader.ScheduleLoadSliceImage(31);*/
106
107 boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
108
109 //orthanc.Stop();
110 oracle.Stop();
111 }
112
113
114 TEST(Toto, Tata)
115 {
116 OrthancStone::Oracle oracle(4);
117 oracle.Start();
118
119 Orthanc::WebServiceParameters web;
120 OrthancStone::OracleWebService orthanc(oracle, web);
121 OrthancStone::OrthancVolumeImage volume(orthanc, true);
122
123 //volume.ScheduleLoadInstance("19816330-cb02e1cf-df3a8fe8-bf510623-ccefe9f5", 0);
124 //volume.ScheduleLoadSeries("318603c5-03e8cffc-a82b6ee1-3ccd3c1e-18d7e3bb"); // COMUNIX PET
125 //volume.ScheduleLoadSeries("7124dba7-09803f33-98b73826-33f14632-ea842d29"); // COMUNIX CT
126 //volume.ScheduleLoadSeries("5990e39c-51e5f201-fe87a54c-31a55943-e59ef80e"); // Delphine sagital
127 volume.ScheduleLoadSeries("6f1b492a-e181e200-44e51840-ef8db55e-af529ab6"); // Delphine ax 2.5
128
129 boost::this_thread::sleep(boost::posix_time::milliseconds(1000));
130
131 oracle.Stop();
132 }
133 #endif
134 43
135 44
136 TEST(GeometryToolbox, Interpolation) 45 TEST(GeometryToolbox, Interpolation)
137 { 46 {
138 using namespace OrthancStone::GeometryToolbox; 47 using namespace OrthancStone::GeometryToolbox;