Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/ShearWarpProjectiveTransform.h @ 191:46cb2eedc2e0 wasm
ShearWarpProjectiveTransform
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 16 Mar 2018 15:01:52 +0100 |
parents | |
children | 4abddd083374 |
comparison
equal
deleted
inserted
replaced
190:465b294a55f0 | 191:46cb2eedc2e0 |
---|---|
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-2018 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 "FiniteProjectiveCamera.h" | |
25 | |
26 namespace OrthancStone | |
27 { | |
28 class ShearWarpProjectiveTransform : public boost::noncopyable | |
29 { | |
30 private: | |
31 Matrix k_; | |
32 Matrix M_shear; | |
33 Matrix M_warp; | |
34 Vector eye_o; | |
35 unsigned int intermediateWidth_; | |
36 unsigned int intermediateHeight_; | |
37 | |
38 public: | |
39 ShearWarpProjectiveTransform(const Matrix& M_view, | |
40 //const Matrix& P, // Permutation applied to the volume | |
41 unsigned int volumeWidth, | |
42 unsigned int volumeHeight, | |
43 unsigned int volumeDepth, | |
44 double pixelSpacingX, | |
45 double pixelSpacingY, | |
46 unsigned int imageWidth, | |
47 unsigned int imageHeight); | |
48 | |
49 const Matrix& GetIntrinsicParameters() const | |
50 { | |
51 return k_; | |
52 } | |
53 | |
54 const Matrix& GetShear() const | |
55 { | |
56 return M_shear; | |
57 } | |
58 | |
59 const Matrix& GetWarp() const | |
60 { | |
61 return M_warp; | |
62 } | |
63 | |
64 const Vector& GetCameraCenter() const | |
65 { | |
66 return eye_o; | |
67 } | |
68 | |
69 unsigned int GetIntermediateWidth() const | |
70 { | |
71 return intermediateWidth_; | |
72 } | |
73 | |
74 unsigned int GetIntermediateHeight() const | |
75 { | |
76 return intermediateHeight_; | |
77 } | |
78 | |
79 FiniteProjectiveCamera *CreateCamera() const; | |
80 | |
81 void ComputeShearOnSlice(double& a11, | |
82 double& b1, | |
83 double& a22, | |
84 double& b2, | |
85 double& shearedZ, | |
86 const double sourceZ); | |
87 | |
88 static Matrix CalibrateView(const Vector& camera, | |
89 const Vector& principalPoint, | |
90 double angle); | |
91 }; | |
92 } |