Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
QmitkRegistrationManipulationWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef QmitkRegistrationManipulationWidget_h
15 #define QmitkRegistrationManipulationWidget_h
16 
17 
18 #include <itkEuler3DTransform.h>
19 #include <mapRegistration.h>
20 #include <mapContinuous.h>
21 
22 #include <mitkPoint.h>
23 #include <mitkVector.h>
24 
25 #include <QWidget>
26 
28 #include <memory>
29 
30 namespace Ui
31 {
33 }
34 
57 {
58  Q_OBJECT
59 
60 public:
65  QmitkRegistrationManipulationWidget(QWidget *parent = nullptr);
66 
69 
71  typedef map::core::Registration<3, 3> MAPRegistrationType;
72 
79  void Initialize();
80 
91  void Initialize(MAPRegistrationType* precedingRegistration);
92 
102  void Initialize(const mitk::Point3D& movingReference, const mitk::Point3D& targetReference);
103 
113  map::core::RegistrationBase* GetInterimRegistration() const;
114 
124  map::core::RegistrationBase::Pointer GenerateRegistration()const ;
125 
135 
148  void ApplyRotationDelta(const mitk::Vector3D& axis, double angleDeg);
149 
150 public Q_SLOTS:
159  void SetCenterOfRotation(const mitk::Point3D& center);
160 
170  void SetCenterOfRotationIsRelativeToTarget(bool targetRelative);
171 
172 signals:
181  void RegistrationChanged(map::core::RegistrationBase *registration);
182 
183 protected slots:
184 
185  void OnRotXChanged(double);
186  void OnRotYChanged(double);
187  void OnRotZChanged(double);
188 
189  void OnTransXChanged(double);
190  void OnTransYChanged(double);
191  void OnTransZChanged(double);
192 
196 
200 
201 private:
202 
204  void ResetTransforms();
206  void InitControls();
207 
210  void UpdateTransformWidgets();
211 
214  void UpdateTransform(bool updateRotation = false);
215 
216  void ConfigureTransformCenter();
217 
218  std::unique_ptr<Ui::QmitkRegistrationManipulationWidget> m_Controls;
219 
220  MAPRegistrationType::Pointer m_PreRegistration;
221 
222  using TransformType = itk::Euler3DTransform<::map::core::continuous::ScalarType>;
223  TransformType::Pointer m_InverseCurrentTransform;
224  TransformType::Pointer m_DirectCurrentTransform;
225 
226  MAPRegistrationType::Pointer m_CurrentRegistration;
227  mitk::Point3D m_CenterOfRotation;
231  bool m_CenterOfRotationIsRelativeToTarget;
232 
233  bool m_internalUpdate;
234 };
235 
236 #endif
#define MITKMATCHPOINTREGISTRATIONUI_EXPORT
Widget for interactively manipulating a 3D rigid registration (rotation and translation).
~QmitkRegistrationManipulationWidget() override
Destructor.
void Initialize(MAPRegistrationType *precedingRegistration)
Initializes the widget with a preceding (baseline) registration.
void Initialize()
Initializes the widget with an identity transform.
map::core::RegistrationBase * GetInterimRegistration() const
Returns the current interim registration reflecting the widget's transform state.
map::core::Registration< 3, 3 > MAPRegistrationType
Type alias for a 3D-to-3D MatchPoint registration.
void ApplyRotationDelta(const mitk::Vector3D &axis, double angleDeg)
Applies an incremental rotation around the given world-space axis.
map::core::RegistrationBase::Pointer GenerateRegistration() const
Generates a new independent registration representing the current manipulation state.
void ApplyTranslationDelta(const mitk::Vector3D &delta)
Applies an incremental translation in world coordinates to the current transform.
void Initialize(const mitk::Point3D &movingReference, const mitk::Point3D &targetReference)
Initializes the widget with a translation derived from two reference points.
void SetCenterOfRotation(const mitk::Point3D &center)
Sets the center of rotation for the Euler transform.
QmitkRegistrationManipulationWidget(QWidget *parent=nullptr)
Constructs the registration manipulation widget.
void SetCenterOfRotationIsRelativeToTarget(bool targetRelative)
Controls whether the center of rotation is specified relative to the target space.
void RegistrationChanged(map::core::RegistrationBase *registration)
Emitted whenever the registration transform is updated.