comparison OrthancStone/Sources/Toolbox/ShearWarpProjectiveTransform.h @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Framework/Toolbox/ShearWarpProjectiveTransform.h@2d8ab34c8c91
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1511:9dfeee74c1e6 1512:244ad1e4e76a
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-2020 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 static Orthanc::ImageAccessor* ApplyAxial(float& maxValue,
93 const Matrix& M_view, // cf. "CalibrateView()"
94 const ImageBuffer3D& source,
95 const VolumeImageGeometry& geometry,
96 Orthanc::PixelFormat targetFormat,
97 unsigned int targetWidth,
98 unsigned int targetHeight,
99 bool mip,
100 double pixelSpacing,
101 unsigned int countSlices,
102 ImageInterpolation shearInterpolation,
103 ImageInterpolation warpInterpolation);
104 };
105 }