Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkAbstractUltrasoundTrackerDevice.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 #ifndef mitkAbstractUltrasoundTrackerDevice_h
14 #define mitkAbstractUltrasoundTrackerDevice_h
15 
16 #include <MitkUSNavigationExports.h>
17 #include "mitkUSDevice.h"
18 #include "mitkImageSource.h"
20 
21 // Microservices
22 #include <mitkServiceInterface.h>
23 #include <usServiceRegistration.h>
24 #include <usGetModuleContext.h>
25 #include <usModule.h>
26 #include <usServiceProperties.h>
27 #include <usModuleContext.h>
28 
29 namespace itk {
30  template<class T> class SmartPointer;
31 }
32 
33 namespace mitk {
34  class NavigationDataSmoothingFilter;
35  class NavigationDataDelayFilter;
36  class NavigationDataDisplacementFilter;
37 
50  class MITKUSNAVIGATION_EXPORT AbstractUltrasoundTrackerDevice : public mitk::ImageSource
51  {
52  public:
53 
54  static const std::string DeviceClassIdentifier;
55  static const char* DefaultProbeIdentifier;
56  static const char* ProbeAndDepthSeperator;
57  static const std::string US_INTERFACE_NAME;
58  static const std::string US_PROPKEY_DEVICENAME;
59  static const std::string US_PROPKEY_CLASS;
60  static const std::string US_PROPKEY_ID;
61 
62 
65 
66  itkGetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
67  itkSetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
68  itkGetMacro(TrackingDeviceDataSource, itk::SmartPointer<NavigationDataSource>);
69  itkSetMacro(TrackingDeviceDataSource, itk::SmartPointer<NavigationDataSource>);
70 
71  itkGetMacro(IsTrackedUltrasoundActive, bool);
72 
78  AffineTransform3D::Pointer GetCalibration();
79 
86  AffineTransform3D::Pointer GetCalibration(std::string depth);
87 
95  AffineTransform3D::Pointer GetCalibration(std::string depth, std::string probe);
96 
98  virtual AffineTransform3D::Pointer GetUSPlaneTransform();
99 
105  void SetCalibration(AffineTransform3D::Pointer calibration);
106 
111  bool RemoveCalibration();
112 
119  bool RemoveCalibration(std::string depth);
120 
128  bool RemoveCalibration(std::string depth, std::string probe);
129 
133  std::string GetDeviceClass();
134 
138  USImageSource::Pointer GetUSImageSource();
139 
140  itk::SmartPointer<mitk::NavigationDataSource> GetNavigationDataSource();
141 
145  bool GetIsCalibratedForCurrentStatus();
146 
150  bool GetContainsAtLeastOneCalibration();
151 
158  std::string SerializeCalibration();
159 
168  void DeserializeCalibration(const std::string &xmlString, bool clearPreviousCalibrations = true);
169 
170  void SetNumberOfSmoothingValues(unsigned int numberOfSmoothingValues);
171 
172  void SetDelayCount(unsigned int delayCount);
173 
180  void UnregisterOnService();
181 
182  virtual void RegisterAsMicroservice();
183 
187  virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom();
188 
192  virtual itk::SmartPointer<USControlInterfaceBMode> GetControlInterfaceBMode();
193 
197  virtual itk::SmartPointer<USControlInterfaceProbes> GetControlInterfaceProbes();
198 
202  virtual itk::SmartPointer<USControlInterfaceDoppler> GetControlInterfaceDoppler();
203 
209  virtual void SetIsFreezed(bool freeze);
210 
214  virtual bool GetIsFreezed();
215 
221  virtual void OnFreeze(bool) { }
222 
223  protected:
226  bool trackedUltrasoundActive );
228 
229 
235  void GenerateData() override;
236 
237  std::string GetIdentifierForCurrentCalibration();
238  std::string GetIdentifierForCurrentProbe();
239  std::string GetCurrentDepthValue();
240 
241  void RebuildFilterPipeline();
242 
245  std::map<std::string, AffineTransform3D::Pointer> m_Calibrations;
246 
251 
253  unsigned int m_DelayCount;
254 
259 
264 
265  private:
266 
267  bool m_IsFreezed;
268  bool m_IsTrackedUltrasoundActive;
269  };
270 
271 } // namespace mitk
272 
273 MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractUltrasoundTrackerDevice, "org.mitk.services.AbstractUltrasoundTrackerDevice")
274 
275 #endif
mitk::AbstractUltrasoundTrackerDevice::m_Calibrations
std::map< std::string, AffineTransform3D::Pointer > m_Calibrations
Definition: mitkAbstractUltrasoundTrackerDevice.h:245
usModule.h
us::ServiceProperties
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
Definition: usServiceProperties.h:42
mitk::AbstractUltrasoundTrackerDevice::m_NumberOfSmoothingValues
unsigned int m_NumberOfSmoothingValues
Definition: mitkAbstractUltrasoundTrackerDevice.h:252
usServiceProperties.h
mitk::ImageSource
Superclass of all classes generating Images (instances of class Image) as output.
Definition: mitkImageSource.h:36
mitk::AbstractUltrasoundTrackerDevice
Abstract class for an easy handling of a combination of an USDevice and a NavigationDataSource....
Definition: mitkAbstractUltrasoundTrackerDevice.h:50
mitkNavigationDataSource.h
mitk::AbstractUltrasoundTrackerDevice::m_ServiceRegistration
us::ServiceRegistration< Self > m_ServiceRegistration
The device's ServiceRegistration object that allows to modify it's Microservice registraton details.
Definition: mitkAbstractUltrasoundTrackerDevice.h:258
mitkServiceInterface.h
mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_CLASS
static const std::string US_PROPKEY_CLASS
Definition: mitkAbstractUltrasoundTrackerDevice.h:59
mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_DEVICENAME
static const std::string US_PROPKEY_DEVICENAME
Definition: mitkAbstractUltrasoundTrackerDevice.h:58
mitk::AbstractUltrasoundTrackerDevice::m_ServiceProperties
us::ServiceProperties m_ServiceProperties
Properties of the device's Microservice.
Definition: mitkAbstractUltrasoundTrackerDevice.h:263
mitk::AbstractUltrasoundTrackerDevice::US_PROPKEY_ID
static const std::string US_PROPKEY_ID
Definition: mitkAbstractUltrasoundTrackerDevice.h:60
mitk::AbstractUltrasoundTrackerDevice::m_DelayFilter
itk::SmartPointer< mitk::NavigationDataDelayFilter > m_DelayFilter
Definition: mitkAbstractUltrasoundTrackerDevice.h:248
itk::SmartPointer< Self >
mitk::AbstractUltrasoundTrackerDevice::ProbeAndDepthSeperator
static const char * ProbeAndDepthSeperator
Definition: mitkAbstractUltrasoundTrackerDevice.h:56
mitk::AbstractUltrasoundTrackerDevice::m_TrackingDeviceDataSource
itk::SmartPointer< NavigationDataSource > m_TrackingDeviceDataSource
Definition: mitkAbstractUltrasoundTrackerDevice.h:244
mitk::AbstractUltrasoundTrackerDevice::DefaultProbeIdentifier
static const char * DefaultProbeIdentifier
Definition: mitkAbstractUltrasoundTrackerDevice.h:55
mitkNewMacro3Param
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:94
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::AbstractUltrasoundTrackerDevice::m_DelayCount
unsigned int m_DelayCount
Definition: mitkAbstractUltrasoundTrackerDevice.h:253
mitkUSDevice.h
usServiceRegistration.h
mitk::AbstractUltrasoundTrackerDevice::US_INTERFACE_NAME
static const std::string US_INTERFACE_NAME
Definition: mitkAbstractUltrasoundTrackerDevice.h:57
mitk::AbstractUltrasoundTrackerDevice::DeviceClassIdentifier
static const std::string DeviceClassIdentifier
Definition: mitkAbstractUltrasoundTrackerDevice.h:54
itk
SET FUNCTIONS.
Definition: itkIntelligentBinaryClosingFilter.h:30
usModuleContext.h
mitk::AbstractUltrasoundTrackerDevice::m_SmoothingFilter
itk::SmartPointer< mitk::NavigationDataSmoothingFilter > m_SmoothingFilter
Definition: mitkAbstractUltrasoundTrackerDevice.h:247
mitk::AbstractUltrasoundTrackerDevice::m_DisplacementFilter
itk::SmartPointer< mitk::NavigationDataDisplacementFilter > m_DisplacementFilter
Definition: mitkAbstractUltrasoundTrackerDevice.h:249
mitk::AbstractUltrasoundTrackerDevice::m_UltrasoundDevice
USDevice::Pointer m_UltrasoundDevice
Definition: mitkAbstractUltrasoundTrackerDevice.h:243
usGetModuleContext.h
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::AbstractUltrasoundTrackerDevice::m_LastFilterOfIGTPipeline
itk::SmartPointer< mitk::NavigationDataSource > m_LastFilterOfIGTPipeline
Definition: mitkAbstractUltrasoundTrackerDevice.h:250
us::ServiceRegistration< Self >
MITK_DECLARE_SERVICE_INTERFACE
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
Definition: mitkServiceInterface.h:26
mitk::AbstractUltrasoundTrackerDevice::OnFreeze
virtual void OnFreeze(bool)
Called when mitk::AbstractUltrasoundTrackerDevice::SetIsFreezed() is called. Subclasses can overwrite...
Definition: mitkAbstractUltrasoundTrackerDevice.h:221
mitkImageSource.h