Medical Imaging Interaction Toolkit  2018.4.99-1640525a
Medical Imaging Interaction Toolkit
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 
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 
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:
224  AbstractUltrasoundTrackerDevice( USDevice::Pointer usDevice,
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 
243  USDevice::Pointer m_UltrasoundDevice;
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
Superclass of all classes generating Images (instances of class Image) as output. ...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< mitk::NavigationDataDelayFilter > m_DelayFilter
itk::SmartPointer< mitk::NavigationDataSmoothingFilter > m_SmoothingFilter
itk::SmartPointer< mitk::NavigationDataDisplacementFilter > m_DisplacementFilter
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
std::map< std::string, AffineTransform3D::Pointer > m_Calibrations
virtual void OnFreeze(bool)
Called when mitk::AbstractUltrasoundTrackerDevice::SetIsFreezed() is called. Subclasses can overwrite...
Abstract class for an easy handling of a combination of an USDevice and a NavigationDataSource. This class can be used as an ImageSource subclass. Additionally tracking data be retrieved from the NavigationDataSource returned by GetTrackingDevice().
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
itk::SmartPointer< mitk::NavigationDataSource > m_LastFilterOfIGTPipeline
us::ServiceRegistration< Self > m_ServiceRegistration
The device&#39;s ServiceRegistration object that allows to modify it&#39;s Microservice registraton details...
#define mitkNewMacro3Param(classname, typea, typeb, typec)
Definition: mitkCommon.h:98
itk::SmartPointer< NavigationDataSource > m_TrackingDeviceDataSource
#define MITKUSNAVIGATION_EXPORT
us::ServiceProperties m_ServiceProperties
Properties of the device&#39;s Microservice.