Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/DicomStructureSet.h @ 1178:3c7cdbf32e2a broker
DicomStructureSet::ProjectOntoLayer()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 20 Nov 2019 14:12:11 +0100 |
parents | 1644de437a7b |
children | 9c8f557ea799 |
comparison
equal
deleted
inserted
replaced
1177:c3d219b6266b | 1178:3c7cdbf32e2a |
---|---|
23 | 23 |
24 #include "DicomStructureSetUtils.h" | 24 #include "DicomStructureSetUtils.h" |
25 #include "CoordinateSystem3D.h" | 25 #include "CoordinateSystem3D.h" |
26 #include "Extent2D.h" | 26 #include "Extent2D.h" |
27 #include "../Scene2D/Color.h" | 27 #include "../Scene2D/Color.h" |
28 #include "../Scene2D/PolylineSceneLayer.h" | |
28 | 29 |
29 //#define USE_BOOST_UNION_FOR_POLYGONS 1 | 30 //#define USE_BOOST_UNION_FOR_POLYGONS 1 |
30 | 31 |
31 #include <Plugins/Samples/Common/FullOrthancDataset.h> | 32 #include <Plugins/Samples/Common/FullOrthancDataset.h> |
32 | 33 |
139 | 140 |
140 const Structure& GetStructure(size_t index) const; | 141 const Structure& GetStructure(size_t index) const; |
141 | 142 |
142 Structure& GetStructure(size_t index); | 143 Structure& GetStructure(size_t index); |
143 | 144 |
144 #ifdef USE_BOOST_UNION_FOR_POLYGONS | 145 bool ProjectStructure( |
145 bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, | 146 #if USE_BOOST_UNION_FOR_POLYGONS == 1 |
146 const Structure& structure, | 147 std::vector< std::vector<Point2D> >& polygons, |
147 const CoordinateSystem3D& slice) const; | |
148 #else | 148 #else |
149 bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, | 149 std::vector< std::pair<Point2D, Point2D> >& segments, |
150 #endif | |
150 const Structure& structure, | 151 const Structure& structure, |
151 const CoordinateSystem3D& slice) const; | 152 const CoordinateSystem3D& slice) const; |
152 #endif | 153 |
153 public: | 154 public: |
154 DicomStructureSet(const OrthancPlugins::FullOrthancDataset& instance); | 155 DicomStructureSet(const OrthancPlugins::FullOrthancDataset& instance); |
155 | 156 |
156 size_t GetStructuresCount() const | 157 size_t GetStructuresCount() const |
157 { | 158 { |
183 | 184 |
184 void CheckReferencedSlices(); | 185 void CheckReferencedSlices(); |
185 | 186 |
186 Vector GetNormal() const; | 187 Vector GetNormal() const; |
187 | 188 |
188 #ifdef USE_BOOST_UNION_FOR_POLYGONS | 189 #if USE_BOOST_UNION_FOR_POLYGONS == 1 |
189 bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, | 190 bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, |
190 size_t index, | 191 size_t index, |
191 const CoordinateSystem3D& slice) const | 192 const CoordinateSystem3D& slice) const |
192 { | 193 { |
193 return ProjectStructure(polygons, GetStructure(index), slice); | 194 return ProjectStructure(polygons, GetStructure(index), slice); |
194 } | 195 } |
195 #else | 196 #else |
196 bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, | 197 bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, |
197 size_t index, | 198 size_t index, |
198 const CoordinateSystem3D& slice) const | 199 const CoordinateSystem3D& slice) const |
199 { | 200 { |
200 return ProjectStructure(segments, GetStructure(index), slice); | 201 return ProjectStructure(segments, GetStructure(index), slice); |
201 } | 202 } |
202 #endif | 203 #endif |
204 | |
205 void ProjectOntoLayer(PolylineSceneLayer& layer, | |
206 const CoordinateSystem3D& plane, | |
207 size_t structureIndex, | |
208 const Color& color) const; | |
209 | |
210 void ProjectOntoLayer(PolylineSceneLayer& layer, | |
211 const CoordinateSystem3D& plane, | |
212 size_t structureIndex) const | |
213 { | |
214 ProjectOntoLayer(layer, plane, structureIndex, GetStructureColor(structureIndex)); | |
215 } | |
203 }; | 216 }; |
204 } | 217 } |