Mercurial > hg > orthanc-stone
annotate UnitTestsSources/Graveyard/TestStructureSet_BGO.cpp @ 1689:fad38c4525f9
nicer modal for user preferences
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 25 Nov 2020 17:07:32 +0100 |
parents | 4fb8fdf03314 |
children | 9ac2a65d4172 |
rev | line source |
---|---|
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
1 /** |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
2 * Stone of Orthanc |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
6 * |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
7 * This program is free software: you can redistribute it and/or |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
8 * modify it under the terms of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
9 * as published by the Free Software Foundation, either version 3 of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
10 * the License, or (at your option) any later version. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
11 * |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
12 * This program is distributed in the hope that it will be useful, but |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
13 * WITHOUT ANY WARRANTY; without even the implied warranty of |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
15 * Affero General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1589
diff
changeset
|
16 * |
1589
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
17 * You should have received a copy of the GNU Affero General Public License |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
19 **/ |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
20 |
8c5f9864545f
adding missing headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1587
diff
changeset
|
21 |
1541
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 /* |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 these tests are single-threaded... no worries for old buggy compilers |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 (I'm talking to YOU, cl.exe v100! And to your ancestors!) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 */ |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 static std::string& GetTestJson() |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 static const char* resultRaw = NULL; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 static std::string result; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 if (resultRaw == NULL) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 std::stringstream sst; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 sst << k_rtStruct_json00 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 << k_rtStruct_json01 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 << k_rtStruct_json02 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 << k_rtStruct_json03 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 << k_rtStruct_json04 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 << k_rtStruct_json05 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 << k_rtStruct_json06 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 << k_rtStruct_json07 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 << k_rtStruct_json08; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 std::string wholeBody = sst.str(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 result.swap(wholeBody); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 resultRaw = result.c_str(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 return result; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 namespace |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 void Initialize(const char* orthancApiUrl, OrthancStone::ILoadersContext& loadersContext) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 Orthanc::WebServiceParameters p; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 OrthancStone::GenericLoadersContext& typedLoadersContext = |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 dynamic_cast<OrthancStone::GenericLoadersContext&>(loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 // Default is http://localhost:8042 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 // Here's how you may change it |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 p.SetUrl(orthancApiUrl); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 p.SetCredentials("orthanc", "orthanc"); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 typedLoadersContext.SetOrthancParameters(p); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 typedLoadersContext.StartOracle(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 void Exitialize(OrthancStone::ILoadersContext& loadersContext) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 OrthancStone::GenericLoadersContext& typedLoadersContext = |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 dynamic_cast<OrthancStone::GenericLoadersContext&>(loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 typedLoadersContext.StopOracle(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 #if 0 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 class TestObserver : public ObserverBase<TestObserver> |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 public: |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 TestObserver() {}; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 virtual void Handle |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 }; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 #endif |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 TEST(StructureSet, DISABLED_StructureSetLoader_injection_feature_2020_05_10) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 namespace pt = boost::posix_time; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 std::unique_ptr<OrthancStone::ILoadersContext> loadersContext(new OrthancStone::GenericLoadersContext(1,4,1)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 Initialize("http://localhost:8042/", *loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 boost::shared_ptr<DicomStructureSetLoader> loader = DicomStructureSetLoader::Create(*loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 // replace with Orthanc ID of an uploaded RTSTRUCT instance! |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 loader->LoadInstanceFullVisibility("72c773ac-5059f2c4-2e6a9120-4fd4bca1-45701661"); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
102 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
103 bool bContinue(true); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
104 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
105 pt::ptime initialTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
106 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
107 while (bContinue) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
108 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
109 bContinue = !loader->AreStructuresReady(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
110 boost::this_thread::sleep_for(boost::chrono::milliseconds(1000)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
111 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
112 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
113 pt::ptime nowTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
114 pt::time_duration diff = nowTime - initialTime; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
115 double seconds = static_cast<double>(diff.total_milliseconds()) * 0.001; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
116 std::cout << seconds << " seconds elapsed...\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
117 if (seconds > 30) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
118 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
119 std::cout << "More than 30 seconds elapsed... Aborting test :(\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
120 //GTEST_FATAL_FAILURE_("More than 30 seconds elapsed... Aborting test :("); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
121 //bContinue = false; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
122 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
123 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
124 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
125 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
126 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
127 class SliceProcessor : |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
128 public OrthancStone::OrthancSeriesVolumeProgressiveLoader::ISlicePostProcessor, |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
129 public OrthancStone::DicomStructureSetLoader::IInstanceLookupHandler |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
130 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
131 public: |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
132 SliceProcessor(OrthancStone::DicomStructureSetLoader& structLoader) : structLoader_(structLoader) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
133 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
134 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
135 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
136 virtual void ProcessCTDicomSlice(const Orthanc::DicomMap& instance) ORTHANC_OVERRIDE |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
137 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
138 std::string sopInstanceUid; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
139 if (!instance.LookupStringValue(sopInstanceUid, Orthanc::DICOM_TAG_SOP_INSTANCE_UID, false)) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
140 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
141 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, "Missing SOPInstanceUID in a DICOM instance"); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
142 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
143 slicesDicom_[sopInstanceUid] = boost::shared_ptr<DicomMap>(instance.Clone()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
144 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
145 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
146 virtual void RetrieveReferencedSlices(const std::set<std::string>& nonEmptyInstances) ORTHANC_OVERRIDE |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
147 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
148 for (std::set<std::string>::const_iterator it = nonEmptyInstances.begin(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
149 it != nonEmptyInstances.end(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
150 ++it) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
151 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
152 const std::string nonEmptyInstance = *it; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
153 if (slicesDicom_.find(nonEmptyInstance) == slicesDicom_.end()) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
154 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
155 throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat, "Referenced SOPInstanceUID not found in CT"); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
156 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
157 boost::shared_ptr<Orthanc::DicomMap> instance = slicesDicom_[nonEmptyInstance]; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
158 structLoader_.AddReferencedSlice(*instance); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
159 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
160 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
161 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
162 OrthancStone::DicomStructureSetLoader& structLoader_; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
163 std::map<std::string, boost::shared_ptr<Orthanc::DicomMap> > slicesDicom_; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
164 }; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
165 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
166 void LoadCtSeriesBlocking(boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> ctLoader, std::string seriesId) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
167 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
168 namespace pt = boost::posix_time; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
169 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
170 // Load the CT |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
171 ctLoader->LoadSeries(seriesId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
172 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
173 // Wait for CT to be loaded |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
174 pt::ptime initialTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
175 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
176 bool bContinue(true); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
177 while (bContinue) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
178 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
179 bContinue = !ctLoader->IsVolumeImageReadyInHighQuality(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
180 boost::this_thread::sleep_for(boost::chrono::milliseconds(1000)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
181 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
182 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
183 pt::ptime nowTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
184 pt::time_duration diff = nowTime - initialTime; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
185 double seconds = static_cast<double>(diff.total_milliseconds()) * 0.001; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
186 std::cout << seconds << " seconds elapsed...\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
187 if (seconds > 30) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
188 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
189 const char* msg = "More than 30 seconds elapsed when waiting for CT... Aborting test :(\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
190 GTEST_FATAL_FAILURE_(msg); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
191 bContinue = false; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
192 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
193 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
194 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
195 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
196 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
197 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
198 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
199 /** |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
200 Will fill planes |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
201 */ |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
202 void GetCTPlanes(std::vector<OrthancStone::CoordinateSystem3D>& planes, |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
203 OrthancStone::VolumeProjection projection, |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
204 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> ctLoader) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
205 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
206 planes.clear(); // inefficient : we don't care |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
207 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
208 const VolumeImageGeometry& geometry = ctLoader->GetImageGeometry(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
209 const unsigned int depth = geometry.GetProjectionDepth(projection); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
210 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
211 planes.resize(depth); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
212 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
213 for (unsigned int z = 0; z < depth; z++) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
214 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
215 planes[z] = geometry.GetProjectionSlice(projection, z); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
216 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
217 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
218 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
219 void LoadRtStructBlocking(boost::shared_ptr<OrthancStone::DicomStructureSetLoader> structLoader, std::string instanceId) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
220 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
221 namespace pt = boost::posix_time; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
222 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
223 // Load RTSTRUCT |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
224 structLoader->LoadInstanceFullVisibility(instanceId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
225 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
226 pt::ptime initialTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
227 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
228 // Wait for the loading process to complete |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
230 bool bContinue(true); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
231 while (bContinue) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
232 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
233 bContinue = !structLoader->AreStructuresReady(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
234 boost::this_thread::sleep_for(boost::chrono::milliseconds(1000)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
235 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
236 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
237 pt::ptime nowTime = pt::second_clock::local_time(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
238 pt::time_duration diff = nowTime - initialTime; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
239 double seconds = static_cast<double>(diff.total_milliseconds()) * 0.001; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
240 std::cout << seconds << " seconds elapsed...\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
241 if (seconds > 30) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
242 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
243 const char* msg = "More than 30 seconds elapsed when waiting for RTSTRUCT... Aborting test :(\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
244 GTEST_FATAL_FAILURE_(msg); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
245 bContinue = false; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
246 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
247 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
248 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
249 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
250 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
251 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
252 TEST(StructureSet, DISABLED_Integration_Compound_CT_Struct_Loading) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
253 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
254 const double TOLERANCE = 0.0000001; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
255 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
256 // create loaders context |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
257 std::unique_ptr<OrthancStone::ILoadersContext> loadersContext(new OrthancStone::GenericLoadersContext(1,4,1)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
258 Initialize("http://localhost:8042/", *loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
259 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
260 const char* ctSeriesId = "a04ecf01-79b2fc33-58239f7e-ad9db983-28e81afa"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
261 const char* rtStructInstanceId = "54460695-ba3885ee-ddf61ac0-f028e31d-a6e474d9"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
262 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
263 // we'll compare normal loading and optimized loading with SliceProcessor to store the dicom |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
264 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
265 boost::shared_ptr<OrthancStone::DicomStructureSetLoader> normalStructLoader; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
266 boost::shared_ptr<OrthancStone::DicomStructureSetLoader> optimizedStructLoader; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
267 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
268 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
269 // Create the CT volume |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
270 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume = boost::make_shared<OrthancStone::DicomVolumeImage>(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
271 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
272 // Create CT loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
273 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> ctLoader = |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
274 OrthancStone::OrthancSeriesVolumeProgressiveLoader::Create(*loadersContext, volume); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
275 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
276 // Create struct loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
277 normalStructLoader = OrthancStone::DicomStructureSetLoader::Create(*loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
278 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
279 // Load the CT |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
280 LoadCtSeriesBlocking(ctLoader, ctSeriesId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
281 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
282 const OrthancStone::VolumeImageGeometry& imageGeometry = ctLoader->GetImageGeometry(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
283 unsigned int width = imageGeometry.GetWidth(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
284 EXPECT_EQ(512u, width); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
285 unsigned int height = imageGeometry.GetHeight(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
286 EXPECT_EQ(512u, height); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
287 unsigned int depth = imageGeometry.GetDepth(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
288 EXPECT_EQ(109u, depth); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
289 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
290 // Load the RTStruct |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
291 LoadRtStructBlocking(normalStructLoader, rtStructInstanceId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
292 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
293 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
294 std::vector<OrthancStone::CoordinateSystem3D> axialPlanes; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
295 std::vector<OrthancStone::CoordinateSystem3D> coronalPlanes; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
296 std::vector<OrthancStone::CoordinateSystem3D> sagittalPlanes; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
297 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
298 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
299 // Create the CT volume |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
300 boost::shared_ptr<OrthancStone::DicomVolumeImage> volume = boost::make_shared<OrthancStone::DicomVolumeImage>(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
301 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
302 // Create CT loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
303 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> ctLoader = |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
304 OrthancStone::OrthancSeriesVolumeProgressiveLoader::Create(*loadersContext, volume); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
305 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
306 // Create struct loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
307 optimizedStructLoader = OrthancStone::DicomStructureSetLoader::Create(*loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
308 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
309 // create the slice processor / instance lookup |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
310 boost::shared_ptr<SliceProcessor> sliceProcessor(new SliceProcessor(*optimizedStructLoader)); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
311 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
312 // Inject it into CT loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
313 ctLoader->SetDicomSlicePostProcessor(sliceProcessor); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
314 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
315 // Inject it into RTSTRUCT loader |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
316 optimizedStructLoader->SetInstanceLookupHandler(sliceProcessor); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
317 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
318 // Load the CT |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
319 LoadCtSeriesBlocking(ctLoader, ctSeriesId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
320 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
321 // now, the slices are collected. let's do some checks |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
322 EXPECT_EQ(109u, sliceProcessor->slicesDicom_.size()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
323 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
324 // Load the RTStruct |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
325 LoadRtStructBlocking(optimizedStructLoader, rtStructInstanceId); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
326 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
327 GetCTPlanes(axialPlanes, VolumeProjection_Axial, ctLoader); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
328 GetCTPlanes(coronalPlanes, VolumeProjection_Coronal, ctLoader); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
329 GetCTPlanes(sagittalPlanes, VolumeProjection_Sagittal, ctLoader); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
330 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
331 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
332 // DO NOT DELETE THOSE! |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
333 OrthancStone::DicomStructureSet* normalContent = normalStructLoader->GetContent(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
334 OrthancStone::DicomStructureSet* optimizedContent = optimizedStructLoader->GetContent(); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
335 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
336 EXPECT_EQ(normalContent->GetStructuresCount(), optimizedContent->GetStructuresCount()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
337 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
338 /*void GetCTPlanes(std::vector<OrthancStone::CoordinateSystem3D>& planes, |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
339 OrthancStone::VolumeProjection projection, |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
340 boost::shared_ptr<OrthancStone::OrthancSeriesVolumeProgressiveLoader> ctLoader)*/ |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
341 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
342 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
343 std::vector<OrthancStone::CoordinateSystem3D> allPlanes; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
344 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
345 // let's gather all the possible cutting planes in a single struct |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
346 for (size_t i = 0; i < axialPlanes.size(); ++i) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
347 allPlanes.push_back(axialPlanes[i]); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
348 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
349 for (size_t i = 0; i < coronalPlanes.size(); ++i) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
350 allPlanes.push_back(coronalPlanes[i]); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
351 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
352 for (size_t i = 0; i < sagittalPlanes.size(); ++i) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
353 allPlanes.push_back(sagittalPlanes[i]); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
354 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
355 for (size_t i = 0; i < normalContent->GetStructuresCount(); ++i) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
356 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
357 std::cout << "Testing structure (" << i << "/" << normalContent->GetStructuresCount() << ")\n"; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
358 Vector structureCenter1 = normalContent->GetStructureCenter(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
359 const std::string& structureName1 = normalContent->GetStructureName(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
360 const std::string& structureInterpretation1 = normalContent->GetStructureInterpretation(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
361 Color structureColor1 = normalContent->GetStructureColor(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
362 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
363 Vector structureCenter2 = optimizedContent->GetStructureCenter(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
364 const std::string& structureName2 = optimizedContent->GetStructureName(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
365 const std::string& structureInterpretation2 = optimizedContent->GetStructureInterpretation(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
366 Color structureColor2 = optimizedContent->GetStructureColor(i); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
367 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
368 EXPECT_NEAR(structureCenter1[0], structureCenter2[0], TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
369 EXPECT_NEAR(structureCenter1[1], structureCenter2[1], TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
370 EXPECT_NEAR(structureCenter1[2], structureCenter2[2], TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
371 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
372 EXPECT_EQ(structureName1, structureName2); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
373 EXPECT_EQ(structureInterpretation1, structureInterpretation2); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
374 EXPECT_EQ(structureColor1.GetRed(), structureColor2.GetRed()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
375 EXPECT_EQ(structureColor1.GetGreen(), structureColor2.GetGreen()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
376 EXPECT_EQ(structureColor1.GetBlue(), structureColor2.GetBlue()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
377 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
378 // "random" walk through the planes. Processing them all takes too long (~ 1 min) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
379 for (size_t j = 0; j < allPlanes.size(); j += 37) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
380 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
381 const OrthancStone::CoordinateSystem3D& plane = allPlanes[j]; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
382 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
383 std::vector< std::pair<Point2D, Point2D> > segments1; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
384 std::vector< std::pair<Point2D, Point2D> > segments2; |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
385 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
386 bool ok1 = normalContent->ProjectStructure(segments1, i, plane); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
387 bool ok2 = optimizedContent->ProjectStructure(segments2, i, plane); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
388 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
389 // checks here |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
390 EXPECT_EQ(ok1, ok2); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
391 EXPECT_EQ(segments1.size(), segments2.size()); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
392 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
393 for (size_t k = 0; k < segments1.size(); ++k) |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
394 { |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
395 EXPECT_NEAR(segments1[k].first.x, segments2[k].first.x, TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
396 EXPECT_NEAR(segments1[k].first.y, segments2[k].first.y, TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
397 EXPECT_NEAR(segments1[k].second.x, segments2[k].second.x, TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
398 EXPECT_NEAR(segments1[k].second.y, segments2[k].second.y, TOLERANCE); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
399 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
400 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
401 } |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
402 |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
403 Exitialize(*loadersContext); |
ae17c8c8838f
standalone compilation of unit tests
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
404 } |