annotate OrthancStone/Sources/Toolbox/CoordinateSystem3D.h @ 2069:5956d7357098 deep-learning

macro ORTHANC_HAS_WASM_SIMD has to be manually defined
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 19 May 2023 17:00:17 +0200
parents cbf54cd28d59
children 07964689cb0b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1871
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
7053b8a0aaec upgrade to year 2022
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1870
diff changeset
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
11 * the License, or (at your option) any later version.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
16 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
17 *
1598
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
19 * License along with this program. If not, see
8563ea5d8ae4 relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1596
diff changeset
20 * <http://www.gnu.org/licenses/>.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 #pragma once
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
1504
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1490
diff changeset
26 #include "../Scene2D/ScenePoint2D.h"
159
0a73d76333db populating LinearAlgebra
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 157
diff changeset
27 #include "LinearAlgebra.h"
1504
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1490
diff changeset
28 #include "OrthancDatasets/IDicomDataset.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
949
32eaf4929b08 OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
Benjamin Golinvaux <bgo@osimis.io>
parents: 760
diff changeset
30 #include <iosfwd>
32eaf4929b08 OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
Benjamin Golinvaux <bgo@osimis.io>
parents: 760
diff changeset
31
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 namespace OrthancStone
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 {
53
c2dc924f1a63 removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 47
diff changeset
34 // Geometry of a 3D plane
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
35 class CoordinateSystem3D
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 private:
1630
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
38 bool valid_;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 Vector origin_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40 Vector normal_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 Vector axisX_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 Vector axisY_;
157
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
43 double d_;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 void CheckAndComputeNormal();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 void Setup(const std::string& imagePositionPatient,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 const std::string& imageOrientationPatient);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 void SetupCanonical();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
157
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
52 double GetOffset() const;
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
53
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 public:
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
55 CoordinateSystem3D()
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 SetupCanonical();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59
949
32eaf4929b08 OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
Benjamin Golinvaux <bgo@osimis.io>
parents: 760
diff changeset
60 friend std::ostream& operator<< (std::ostream& s, const CoordinateSystem3D& that);
32eaf4929b08 OrthancMultiframeVolumeLoader and OrthancSeriesVolumeProgressiveLoader now implement IGeometryProvider so that the geometry reference can be switched (CT or DOSE, for instance) + VolumeImageGeometry::SetSize renamed to VolumeImageGeometry::SetSizeInVoxels + prevent text layer update if text or properties do not change + a few stream operator<< for debug (Vector, Matrix,...) + fixed memory access aligment issues in ImageBuffer3D::ExtractSagittalSlice + fix for wrong screen Y offset of mpr slices in DicomVolumeImageMPRSlicer.
Benjamin Golinvaux <bgo@osimis.io>
parents: 760
diff changeset
61
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
62 CoordinateSystem3D(const Vector& origin,
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
63 const Vector& axisX,
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
64 const Vector& axisY);
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65
110
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
66 CoordinateSystem3D(const std::string& imagePositionPatient,
53025eecbc95 renamed SliceGeometry as CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 89
diff changeset
67 const std::string& imageOrientationPatient)
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 Setup(imagePositionPatient, imageOrientationPatient);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
72 explicit CoordinateSystem3D(const IDicomDataset& dicom);
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
73
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
74 explicit CoordinateSystem3D(const Orthanc::DicomMap& dicom);
122
e3433dabfb8d refactoring DicomStructureSet
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
75
1630
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
76 bool IsValid() const
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
77 {
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
78 return valid_;
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
79 }
78509230f0d7 SortedFrames sharing code with CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1598
diff changeset
80
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 const Vector& GetNormal() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 return normal_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85
1490
5d892f5dd9c4 SortedFrames::IsFrameMonochrome1()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1455
diff changeset
86 const Vector& GetOrigin() const // This is the "Image Position Patient" tag
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 return origin_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 const Vector& GetAxisX() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 return axisX_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 const Vector& GetAxisY() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 return axisY_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100
760
1181e1ad98ec progressive loading working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 757
diff changeset
101 void SetOrigin(const Vector& origin);
1181e1ad98ec progressive loading working
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 757
diff changeset
102
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 Vector MapSliceToWorldCoordinates(double x,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 double y) const;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
1161
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
106 Vector MapSliceToWorldCoordinates(const ScenePoint2D& p) const
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
107 {
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
108 return MapSliceToWorldCoordinates(p.GetX(), p.GetY());
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
109 }
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
110
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
111 double ProjectAlongNormal(const Vector& point) const;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
112
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113 void ProjectPoint(double& offsetX,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 double& offsetY,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 const Vector& point) const;
151
c5044bbfc303 CoordinateSystem3D::IntersectSegment()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
116
1161
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
117 ScenePoint2D ProjectPoint(const Vector& point) const
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
118 {
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
119 double x, y;
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
120 ProjectPoint(x, y, point);
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
121 return ScenePoint2D(x, y);
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
122 }
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
123
1013
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
124 /*
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
125 Alternated faster implementation (untested yet)
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
126 */
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
127 void ProjectPoint2(double& offsetX,
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
128 double& offsetY,
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
129 const Vector& point) const;
53cc787bd7bc - Added an optimized ProjectPoint2 to CoordinateSystem3D. It has *not* replaced
Benjamin Golinvaux <bgo@osimis.io>
parents: 949
diff changeset
130
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 151
diff changeset
131 bool IntersectSegment(Vector& p,
151
c5044bbfc303 CoordinateSystem3D::IntersectSegment()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
132 const Vector& edgeFrom,
c5044bbfc303 CoordinateSystem3D::IntersectSegment()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
133 const Vector& edgeTo) const;
157
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
134
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
135 bool IntersectLine(Vector& p,
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
136 const Vector& origin,
2309e8d86efe IntersectPlaneAndLine
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
137 const Vector& direction) const;
647
6af3099ed8da uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
138
1648
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
139 // Point-to-plane distance
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
140 double ComputeDistance(const Vector& p) const;
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
141
647
6af3099ed8da uncoupling OrthancStone::SlicesSorter from OrthancStone::Slice
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
142 // Returns "false" is the two planes are not parallel
757
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
143 static bool ComputeDistance(double& distance,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
144 const CoordinateSystem3D& a,
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 647
diff changeset
145 const CoordinateSystem3D& b);
1161
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
146
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
147 // Normalize a cutting plane so that the origin (0,0,0) of the 3D
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
148 // world is mapped to the origin of its (x,y) coordinate system
19b1c8caade4 fix sagittal geometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1013
diff changeset
149 static CoordinateSystem3D NormalizeCuttingPlane(const CoordinateSystem3D& plane);
1648
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
150
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
151 // Construct one possible coordinate system from the general form
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
152 // of the equation of a plane "a*x+b*y+c*z+d=0". Note that the
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
153 // axes are not determined in this case, and so they are chosen
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
154 // arbitrarily.
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
155 static CoordinateSystem3D CreateFromPlaneGeneralForm(double a,
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
156 double b,
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
157 double c,
4a43106bc122 cross-hair starts to work
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1630
diff changeset
158 double d);
1650
af312e145980 more tests for CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1648
diff changeset
159
af312e145980 more tests for CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1648
diff changeset
160 static CoordinateSystem3D CreateFromThreePoints(const Vector& a,
af312e145980 more tests for CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1648
diff changeset
161 const Vector& b,
af312e145980 more tests for CoordinateSystem3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1648
diff changeset
162 const Vector& c);
1961
cbf54cd28d59 added CoordinateSystem3D::GetOrientationMarkers()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
163
cbf54cd28d59 added CoordinateSystem3D::GetOrientationMarkers()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
164 void GetOrientationMarkers(std::string& top /* out */,
cbf54cd28d59 added CoordinateSystem3D::GetOrientationMarkers()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
165 std::string& bottom /* out */,
cbf54cd28d59 added CoordinateSystem3D::GetOrientationMarkers()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
166 std::string& left /* out */,
cbf54cd28d59 added CoordinateSystem3D::GetOrientationMarkers()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1871
diff changeset
167 std::string& right /* out */) const;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 };
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 }