Computer Assisted Medical Intervention Tool Kit  version 5.2
ArbitrarySingleImageComponent.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2024 Univ. Grenoble Alpes, CNRS, Grenoble INP - UGA, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef ARBITRARYSINGLEIMAGEVOLUMECOMPONENT_H
27 #define ARBITRARYSINGLEIMAGEVOLUMECOMPONENT_H
28 
29 // -- Core stuff
30 #include "SingleImageComponent.h"
31 
32 // -- QT stuff classes
33 #include <QVector3D>
34 
35 namespace camitk {
66  Q_OBJECT
67 
68 public:
70  ArbitrarySingleImageComponent(Component* parentComponent, const QString& name, vtkSmartPointer<vtkWindowLevelLookupTable> lut);
71 
73  ~ArbitrarySingleImageComponent() override = default;
74 
79  virtual void setTransform(vtkSmartPointer<vtkTransform>) override;
80 
83  virtual void resetTransform() override final;
84 
86  virtual void setTransformTranslation(double, double, double) override final;
87 
89  virtual void setTransformRotation(double, double, double) override final;
90 
92  CAMITK_API_UNIMPLEMENTED virtual void translate(double, double, double) override;
93 
95  CAMITK_API_UNIMPLEMENTED virtual void rotate(double, double, double) override;
96 
98  CAMITK_API_UNIMPLEMENTED virtual void rotateVTK(double, double, double) override;
99 
101  CAMITK_API_UNIMPLEMENTED virtual void setTransformTranslationVTK(double, double, double) override;
102 
104  CAMITK_API_UNIMPLEMENTED virtual void setTransformRotationVTK(double, double, double) override;
105 
108  virtual void setSlice(int) override;
109 
111  virtual void setSlice(double, double, double) override;
112 
115  virtual int getSlice() const override;
116 
119  virtual int getNumberOfSlices() const override;
120 
125  virtual void pixelPicked(double, double, double) override;
126 
128 
132 
139  virtual double getTranslationInVolume();
140 
143  void getImageCenterAndTranslationVectorInParent(double C_P[4], double Z_P[4]);
144 
147  void getImageCenterInParent(double[4]);
149 
150 private:
152  bool checkCenter(vtkSmartPointer<vtkMatrix4x4>);
153 
155  bool pointInsideVolume(QVector3D);
156 
158  void updateTranslationExtremity();
159 
161  int* dimensions;
162 
164  double* spacing;
165 
171  QVector3D cPlus_P;
172 
178  QVector3D cMinus_P;
179 
201  template<typename T> static vtkSmartPointer<vtkMatrix4x4> Multiply4x4(T, T);
202  template<typename T, typename... Args> static vtkSmartPointer<vtkMatrix4x4> Multiply4x4(T a, T b, Args... args);
203 
212  static bool linePlaneIntersectionPoint(QVector3D, QVector3D, QVector3D, QVector3D, QVector3D&);
213 
216  static float roundTo4Decimals(float);
219  static QVector3D roundTo4Decimals(QVector3D);
221 };
222 
223 }
224 
225 #endif // ARBITRARYSINGLEIMAGEVOLUMECOMPONENT_H
#define CAMITK_API
Definition: CamiTKAPI.h:49
#define a
This Component manages the specific case of arbitrary orientation of a sub-component of the image com...
Definition: ArbitrarySingleImageComponent.h:65
~ArbitrarySingleImageComponent() override=default
Destructor.
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition: sdk/libraries/core/component/Component.h:303
This Component manages sub-component of the image component seen as a single orientation only (axial ...
Definition: SingleImageComponent.h:61
Definition: Action.cpp:36