comparison Framework/Toolbox/VolumeImageGeometry.h @ 684:7719eb852dd5

new class: VolumeImageGeometry
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 16 May 2019 16:47:46 +0200
parents
children 93a8949a1ef7
comparison
equal deleted inserted replaced
683:dbc1d8bfc68a 684:7719eb852dd5
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2019 Osimis S.A., Belgium
6 *
7 * This program is free software: you can redistribute it and/or
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.
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
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
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **/
20
21
22 #pragma once
23
24 #include "../StoneEnumerations.h"
25 #include "CoordinateSystem3D.h"
26
27 namespace OrthancStone
28 {
29 class VolumeImageGeometry
30 {
31 private:
32 unsigned int width_;
33 unsigned int height_;
34 unsigned int depth_;
35 CoordinateSystem3D axialGeometry_;
36 CoordinateSystem3D coronalGeometry_;
37 CoordinateSystem3D sagittalGeometry_;
38 Vector voxelDimensions_;
39 Matrix transform_;
40 Matrix transformInverse_;
41
42 void Invalidate();
43
44 public:
45 VolumeImageGeometry();
46
47 unsigned int GetWidth() const
48 {
49 return width_;
50 }
51
52 unsigned int GetHeight() const
53 {
54 return height_;
55 }
56
57 unsigned int GetDepth() const
58 {
59 return depth_;
60 }
61
62 const CoordinateSystem3D& GetAxialGeometry() const
63 {
64 return axialGeometry_;
65 }
66
67 const CoordinateSystem3D& GetCoronalGeometry() const
68 {
69 return coronalGeometry_;
70 }
71
72 const CoordinateSystem3D& GetSagittalGeometry() const
73 {
74 return sagittalGeometry_;
75 }
76
77 void SetSize(unsigned int width,
78 unsigned int height,
79 unsigned int depth);
80
81 // Set the geometry of the first axial slice (i.e. the one whose
82 // depth == 0)
83 void SetAxialGeometry(const CoordinateSystem3D& geometry);
84
85 void SetVoxelDimensions(double x,
86 double y,
87 double z);
88
89 Vector GetVoxelDimensions(VolumeProjection projection) const;
90
91 void GetSliceSize(unsigned int& width,
92 unsigned int& height,
93 VolumeProjection projection);
94
95 // Get the 3D position of a point in the volume, where x, y and z
96 // lie in the [0;1] range
97 Vector GetCoordinates(float x,
98 float y,
99 float z) const;
100
101 bool DetectProjection(VolumeProjection& projection,
102 const CoordinateSystem3D& plane) const;
103 };
104 }