Computer Assited Medical Intervention Tool Kit  version 5.0
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-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, 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 {
65 class CAMITK_API ArbitrarySingleImageComponent : public camitk::SingleImageComponent {
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
CAMITK_WARNING
#define CAMITK_WARNING(MSG)
Log for warning verbosity (the most common one) Will appear by default.
Definition: Log.h:266
SingleImageComponent.h
a
#define a
camitk::ImageComponent
The manager of the Image Volume data. An image volume data has no concrete 3D representation,...
Definition: ImageComponent.h:77
Log.h
camitk::SingleImageComponent
This Component manages sub-component of the image component seen as a single orientation only (axial ...
Definition: SingleImageComponent.h:61
ArbitrarySingleImageComponent.h
dotProduct
double dotProduct(double vec1[3], double vec2[3])
compute dot product
Definition: Tools.h:68
Frame.h
camitk::transform
vtkSmartPointer< vtkTransform > transform
Definition: RendererWidget.cpp:372
Component
A component is something that composed something and could also be a part of something.
Definition: modeling/libraries/pml/Component.h:48
camitk::ArbitrarySingleImageComponent::ArbitrarySingleImageComponent
ArbitrarySingleImageComponent(Component *parentComponent, const QString &name, vtkSmartPointer< vtkWindowLevelLookupTable > lut)
Constructor.
Definition: ArbitrarySingleImageComponent.cpp:107
ImageComponent.h
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:35