Computer Assisted Medical Intervention Tool Kit version 6.0
 
Loading...
Searching...
No Matches
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-2025 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
31#include "ImageComponent.h" // for friend fromVariant method
32
33// -- QT stuff classes
34#include <QVector3D>
35
36namespace camitk {
37
90 Q_OBJECT
91
92public:
94 ArbitrarySingleImageComponent(Component* parentComponent, const QString& name, vtkSmartPointer<vtkWindowLevelLookupTable> lut);
95
97 virtual ~ArbitrarySingleImageComponent() override;
98
102
104 virtual void propertyValueChanged(QString name) override;
105
109 virtual void updatePropertyFromTransformation();
110
113 virtual void resetTransform();
114
117 virtual void setSlice(int) override;
118
120 virtual void setSlice(double, double, double) override;
121
124 virtual int getSlice() const override;
125
128 virtual int getNumberOfSlices() const override;
130
134
138 void getArbitraryCenter(double center[4]) const;
139
143 void getArbitraryPlaneNormal(double normalVector[4]) const;
145
147 vtkSmartPointer<vtkActor> get3DCursor() override;
148
151 return arbitraryTransformation.get();
152 }
153
156 return arbitraryFrame.get();
157 }
158
161 void setArbitraryFrame(const std::shared_ptr<FrameOfReference>& fr) {
162 arbitraryFrame = fr;
163 }
164
167 void setFrame(const std::shared_ptr<FrameOfReference>& fr) override;
168
172 virtual QMultiMap<const FrameOfReference*, Component*> getAllFrames(bool includeChildrenFrames) override;
173
177 virtual QMultiMap<const Transformation*, Component*> getAllTransformations(bool includeChildrenTransformations) override;
178
179
180private:
183 friend void ImageComponent::fromVariant(const QVariant&);
184
189 void initArbitraryTransformation(const std::shared_ptr<FrameOfReference>& arbitraryFrame, const std::shared_ptr<FrameOfReference>& dataFrame, const std::shared_ptr<Transformation>& tr = nullptr);
190
192 void resetArbitraryTransformationMatrix();
193
198 virtual void updateTranslation();
199
203 virtual void updateRotation();
204
210 double computeTranslationRatio() const;
211
222 void computeIntersectionsWithImageBorders(QVector3D& Cz_min, QVector3D& Cz_max) const;
223
238 void computeIntersectionsWithImageBorders(const QVector3D& origin, const QVector3D& upVector, QVector3D& intersectionMin, QVector3D& intersectionMax) const;
239
241 bool checkCenter(vtkSmartPointer<vtkMatrix4x4>) const;
242
244 bool pointInsideVolume(QVector3D) const;
245
247 int* dimensions;
248
250 double* spacing;
251
253 std::shared_ptr<FrameOfReference> arbitraryFrame;
254
256 std::shared_ptr<Transformation> arbitraryTransformation;
257
279 template<typename T> static vtkSmartPointer<vtkMatrix4x4> Multiply4x4(T, T);
280 template<typename T, typename... Args> static vtkSmartPointer<vtkMatrix4x4> Multiply4x4(T a, T b, Args... args);
281
290 static bool linePlaneIntersectionPoint(QVector3D, QVector3D, QVector3D, QVector3D, QVector3D&);
291
294 static float roundTo4Decimals(float);
295
298 static QVector3D roundTo4Decimals(QVector3D);
299
303 static void cleanMatrix(vtkSmartPointer<vtkMatrix4x4> matrixToClean, double epsilon = 1e-5);
305};
306
307}
308
309#endif // ARBITRARYSINGLEIMAGEVOLUMECOMPONENT_H
#define CAMITK_API
Definition CamiTKAPI.h:66
This Component manages the specific case of arbitrary orientation of a sub-component of the image com...
Definition ArbitrarySingleImageComponent.h:89
const Transformation * getArbitraryTransformation() const
Returns the arbitrary transformation (from arbitraryFrame to main frame of this component,...
Definition ArbitrarySingleImageComponent.h:150
void setArbitraryFrame(const std::shared_ptr< FrameOfReference > &fr)
Set the ArbitraryFrame.
Definition ArbitrarySingleImageComponent.h:161
const FrameOfReference * getArbitraryFrame() const
Get the arbitrary frame that is located in the chosen arbitrary position.
Definition ArbitrarySingleImageComponent.h:155
A Component represents something that could be included in the explorer view, the interactive 3D view...
Definition sdk/libraries/core/component/Component.h:304
FrameOfReference is only a label for an abstract coordinate system.
Definition FrameOfReference.h:71
This Component manages sub-component of the image component seen as a single orientation only (axial ...
Definition SingleImageComponent.h:62
Transformation represents a geometrical transformation between two FrameOfReferences.
Definition Transformation.h:83
Definition Action.cpp:40