Mercurial > hg > orthanc-stone
annotate Framework/Toolbox/CoordinateSystem3D.h @ 110:53025eecbc95 wasm
renamed SliceGeometry as CoordinateSystem3D
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 14 Jun 2017 15:50:38 +0200 |
parents | Framework/Toolbox/SliceGeometry.h@f244018a4e4b |
children | 2eca030792aa |
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 | |
40
7207a407bcd8
shared copyright with osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
32
diff
changeset
|
5 * Copyright (C) 2017 Osimis, 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 | |
32 | 24 #include "GeometryToolbox.h" |
25 #include "../../Resources/Orthanc/Plugins/Samples/Common/IDicomDataset.h" | |
0 | 26 |
27 namespace OrthancStone | |
28 { | |
53
c2dc924f1a63
removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
47
diff
changeset
|
29 // Geometry of a 3D plane |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
30 class CoordinateSystem3D |
0 | 31 { |
32 private: | |
33 Vector origin_; | |
34 Vector normal_; | |
35 Vector axisX_; | |
36 Vector axisY_; | |
37 | |
38 void CheckAndComputeNormal(); | |
39 | |
40 void Setup(const std::string& imagePositionPatient, | |
41 const std::string& imageOrientationPatient); | |
42 | |
43 void SetupCanonical(); | |
44 | |
45 public: | |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
46 CoordinateSystem3D() |
0 | 47 { |
48 SetupCanonical(); | |
49 } | |
50 | |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
51 CoordinateSystem3D(const Vector& origin, |
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
52 const Vector& axisX, |
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
53 const Vector& axisY); |
0 | 54 |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
55 CoordinateSystem3D(const OrthancPlugins::IDicomDataset& dicom); |
0 | 56 |
110
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
57 CoordinateSystem3D(const std::string& imagePositionPatient, |
53025eecbc95
renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
89
diff
changeset
|
58 const std::string& imageOrientationPatient) |
0 | 59 { |
60 Setup(imagePositionPatient, imageOrientationPatient); | |
61 } | |
62 | |
63 const Vector& GetNormal() const | |
64 { | |
65 return normal_; | |
66 } | |
67 | |
68 const Vector& GetOrigin() const | |
69 { | |
70 return origin_; | |
71 } | |
72 | |
73 const Vector& GetAxisX() const | |
74 { | |
75 return axisX_; | |
76 } | |
77 | |
78 const Vector& GetAxisY() const | |
79 { | |
80 return axisY_; | |
81 } | |
82 | |
83 Vector MapSliceToWorldCoordinates(double x, | |
84 double y) const; | |
85 | |
86 double ProjectAlongNormal(const Vector& point) const; | |
87 | |
88 void ProjectPoint(double& offsetX, | |
89 double& offsetY, | |
90 const Vector& point) const; | |
91 }; | |
92 } |