Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/DicomStructureSet.h @ 1546:94750ef63ad5
support of Orthanc framework shared library
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 11 Aug 2020 17:09:59 +0200 |
parents | 244ad1e4e76a |
children | 85e117739eca |
rev | line source |
---|---|
0 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
1270
2d8ab34c8c91
upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1006
diff
changeset
|
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium |
0 | 6 * |
7 * This program is free software: you can redistribute it and/or | |
47 | 8 * modify it under the terms of the GNU Affero General Public License |
9 * as published by the Free Software Foundation, either version 3 of | |
10 * the License, or (at your option) any later version. | |
0 | 11 * |
12 * This program is distributed in the hope that it will be useful, but | |
13 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
47 | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Affero General Public License for more details. | |
16 * | |
17 * You should have received a copy of the GNU Affero General Public License | |
0 | 18 * along with this program. If not, see <http://www.gnu.org/licenses/>. |
19 **/ | |
20 | |
21 | |
22 #pragma once | |
23 | |
1471
28c64c246312
working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1455
diff
changeset
|
24 #include "../OrthancStone.h" |
28c64c246312
working on a shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1455
diff
changeset
|
25 |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
26 #if !defined(ORTHANC_ENABLE_DCMTK) |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
27 # error The macro ORTHANC_ENABLE_DCMTK must be defined |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
28 #endif |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
29 |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
30 #include "DicomStructureSetUtils.h" |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
31 #include "CoordinateSystem3D.h" |
131 | 32 #include "Extent2D.h" |
1504 | 33 #include "OrthancDatasets/FullOrthancDataset.h" |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
794
diff
changeset
|
34 #include "../Scene2D/Color.h" |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
35 #include "../Scene2D/PolylineSceneLayer.h" |
0 | 36 |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
37 #if ORTHANC_ENABLE_DCMTK == 1 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1279
diff
changeset
|
38 # include <DicomParsing/ParsedDicomFile.h> |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
39 #endif |
0 | 40 |
1006
4f28d9459e31
Fixed unit tests and deprecated classes according to last API changes. UT all run ok.
Benjamin Golinvaux <bgo@osimis.io>
parents:
1000
diff
changeset
|
41 //#define USE_BOOST_UNION_FOR_POLYGONS 1 |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
42 |
201
e9c7a78a3e77
removed absolute paths
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
196
diff
changeset
|
43 |
0 | 44 #include <list> |
45 | |
46 namespace OrthancStone | |
47 { | |
48 class DicomStructureSet : public boost::noncopyable | |
49 { | |
50 private: | |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
51 struct ReferencedSlice |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
52 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
53 std::string seriesInstanceUid_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
54 CoordinateSystem3D geometry_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
55 double thickness_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
56 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
57 ReferencedSlice() |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
58 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
59 } |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
60 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
61 ReferencedSlice(const std::string& seriesInstanceUid, |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
62 const CoordinateSystem3D& geometry, |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
63 double thickness) : |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
64 seriesInstanceUid_(seriesInstanceUid), |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
65 geometry_(geometry), |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
66 thickness_(thickness) |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
67 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
68 } |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
69 }; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
70 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
71 typedef std::map<std::string, ReferencedSlice> ReferencedSlices; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
72 |
132
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
73 typedef std::vector<Vector> Points; |
0 | 74 |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
75 class Polygon |
0 | 76 { |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
77 private: |
131 | 78 std::string sopInstanceUid_; |
79 bool hasSlice_; | |
80 CoordinateSystem3D geometry_; | |
81 double projectionAlongNormal_; | |
82 double sliceThickness_; // In millimeters | |
83 Points points_; | |
84 Extent2D extent_; | |
0 | 85 |
981
c20dbaab360c
Ability to cope with empty "Referenced SOP Instance UID" (dicom path (3006,0039)[i] / (0x3006, 0x0040)[0] / (0x3006, 0x0016)[0] / (0x0008, 0x1155)) + better logs + code formating
Benjamin Golinvaux <bgo@osimis.io>
parents:
804
diff
changeset
|
86 void CheckPointIsOnSlice(const Vector& v) const; |
988
4c9b4c4de814
Fixed bug in DicomStructureSet that prevented points from being added to polygons
Benjamin Golinvaux <bgo@osimis.io>
parents:
981
diff
changeset
|
87 bool IsPointOnSliceIfAny(const Vector& v) const; |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
88 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
89 public: |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
90 Polygon(const std::string& sopInstanceUid) : |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
91 sopInstanceUid_(sopInstanceUid), |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
92 hasSlice_(false) |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
93 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
94 } |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
95 |
132
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
96 void Reserve(size_t n) |
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
97 { |
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
98 points_.reserve(n); |
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
99 } |
35c2b85836ce
fix rtstruct projections
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
131
diff
changeset
|
100 |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
101 void AddPoint(const Vector& v); |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
102 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
103 bool UpdateReferencedSlice(const ReferencedSlices& slices); |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
104 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
105 bool IsOnSlice(const CoordinateSystem3D& geometry) const; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
106 |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
107 const Vector& GetGeometryOrigin() const |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
108 { |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
109 return geometry_.GetOrigin(); |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
110 } |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
111 |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
112 const std::string& GetSopInstanceUid() const |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
113 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
114 return sopInstanceUid_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
115 } |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
116 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
117 const Points& GetPoints() const |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
118 { |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
119 return points_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
120 } |
126
c9e88e7935a4
rt-struct projection
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
125
diff
changeset
|
121 |
c9e88e7935a4
rt-struct projection
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
125
diff
changeset
|
122 double GetSliceThickness() const |
c9e88e7935a4
rt-struct projection
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
125
diff
changeset
|
123 { |
c9e88e7935a4
rt-struct projection
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
125
diff
changeset
|
124 return sliceThickness_; |
c9e88e7935a4
rt-struct projection
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
125
diff
changeset
|
125 } |
131 | 126 |
127 bool Project(double& x1, | |
128 double& y1, | |
129 double& x2, | |
130 double& y2, | |
131 const CoordinateSystem3D& slice) const; | |
0 | 132 }; |
133 | |
134 typedef std::list<Polygon> Polygons; | |
135 | |
136 struct Structure | |
137 { | |
138 std::string name_; | |
139 std::string interpretation_; | |
140 Polygons polygons_; | |
141 uint8_t red_; | |
142 uint8_t green_; | |
143 uint8_t blue_; | |
144 }; | |
145 | |
146 typedef std::vector<Structure> Structures; | |
147 | |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
148 Structures structures_; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
149 ReferencedSlices referencedSlices_; |
0 | 150 |
1504 | 151 void Setup(const IDicomDataset& dataset); |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
152 |
0 | 153 const Structure& GetStructure(size_t index) const; |
154 | |
125 | 155 Structure& GetStructure(size_t index); |
156 | |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
157 bool ProjectStructure( |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
158 #if USE_BOOST_UNION_FOR_POLYGONS == 1 |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
159 std::vector< std::vector<Point2D> >& polygons, |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
160 #else |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
161 std::vector< std::pair<Point2D, Point2D> >& segments, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
162 #endif |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
163 const Structure& structure, |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
164 const CoordinateSystem3D& slice) const; |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
165 |
0 | 166 public: |
1546
94750ef63ad5
support of Orthanc framework shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
167 explicit DicomStructureSet(const FullOrthancDataset& instance) |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
168 { |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
169 Setup(instance); |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
170 } |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
171 |
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
172 #if ORTHANC_ENABLE_DCMTK == 1 |
1546
94750ef63ad5
support of Orthanc framework shared library
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
173 explicit DicomStructureSet(Orthanc::ParsedDicomFile& instance); |
1180
9c8f557ea799
ParsedDicomDataset to speed up loading RT-STRUCT from parsed DICOM files
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1178
diff
changeset
|
174 #endif |
0 | 175 |
794 | 176 size_t GetStructuresCount() const |
0 | 177 { |
178 return structures_.size(); | |
179 } | |
180 | |
181 Vector GetStructureCenter(size_t index) const; | |
182 | |
183 const std::string& GetStructureName(size_t index) const; | |
184 | |
185 const std::string& GetStructureInterpretation(size_t index) const; | |
186 | |
804
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
794
diff
changeset
|
187 Color GetStructureColor(size_t index) const; |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
794
diff
changeset
|
188 |
61ba4b504e9a
PolylineSceneLayer now has one color per chain
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
794
diff
changeset
|
189 // TODO - remove |
0 | 190 void GetStructureColor(uint8_t& red, |
191 uint8_t& green, | |
192 uint8_t& blue, | |
193 size_t index) const; | |
194 | |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
195 void GetReferencedInstances(std::set<std::string>& instances); |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
196 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
197 void AddReferencedSlice(const std::string& sopInstanceUid, |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
198 const std::string& seriesInstanceUid, |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
199 const CoordinateSystem3D& geometry, |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
200 double thickness); |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
201 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
202 void AddReferencedSlice(const Orthanc::DicomMap& dataset); |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
203 |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
204 void CheckReferencedSlices(); |
0 | 205 |
122
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
206 Vector GetNormal() const; |
e3433dabfb8d
refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
113
diff
changeset
|
207 |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
208 #if USE_BOOST_UNION_FOR_POLYGONS == 1 |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
209 bool ProjectStructure(std::vector< std::vector<Point2D> >& polygons, |
1165 | 210 size_t index, |
211 const CoordinateSystem3D& slice) const | |
0 | 212 { |
125 | 213 return ProjectStructure(polygons, GetStructure(index), slice); |
0 | 214 } |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
215 #else |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
216 bool ProjectStructure(std::vector< std::pair<Point2D, Point2D> >& segments, |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
217 size_t index, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
218 const CoordinateSystem3D& slice) const |
1000
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
219 { |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
220 return ProjectStructure(segments, GetStructure(index), slice); |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
221 } |
50e5acf5553b
changed RTSTRUCT rendering from polygons to segments
Benjamin Golinvaux <bgo@osimis.io>
parents:
988
diff
changeset
|
222 #endif |
1178
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
223 |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
224 void ProjectOntoLayer(PolylineSceneLayer& layer, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
225 const CoordinateSystem3D& plane, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
226 size_t structureIndex, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
227 const Color& color) const; |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
228 |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
229 void ProjectOntoLayer(PolylineSceneLayer& layer, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
230 const CoordinateSystem3D& plane, |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
231 size_t structureIndex) const |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
232 { |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
233 ProjectOntoLayer(layer, plane, structureIndex, GetStructureColor(structureIndex)); |
3c7cdbf32e2a
DicomStructureSet::ProjectOntoLayer()
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1170
diff
changeset
|
234 } |
0 | 235 }; |
236 } |