Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkUSCombinedModality.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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKUSCombinedModality_H_HEADER_INCLUDED_
18 #define MITKUSCombinedModality_H_HEADER_INCLUDED_
19 
20 #include <MitkUSNavigationExports.h>
21 #include "mitkUSDevice.h"
23 
24 // Microservices
25 #include <mitkServiceInterface.h>
26 #include <usServiceRegistration.h>
27 
28 namespace itk {
29  template<class T> class SmartPointer;
30 }
31 
32 namespace mitk {
33  class NavigationDataSmoothingFilter;
34  class NavigationDataDelayFilter;
35  class USControlInterfaceBMode;
36  class USControlInterfaceProbes;
37  class USControlInterfaceDoppler;
38 
49  class MITKUSNAVIGATION_EXPORT USCombinedModality : public USDevice
50  {
51  public:
52  static const std::string DeviceClassIdentifier;
53  static const char* DefaultProbeIdentifier;
54  static const char* ProbeAndDepthSeperator;
55 
58 
59  itkGetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
60  itkSetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
63 
69  AffineTransform3D::Pointer GetCalibration();
70 
77  AffineTransform3D::Pointer GetCalibration(std::string depth);
78 
86  AffineTransform3D::Pointer GetCalibration(std::string depth, std::string probe);
87 
93  void SetCalibration(AffineTransform3D::Pointer calibration);
94 
99  bool RemoveCalibration();
100 
107  bool RemoveCalibration(std::string depth);
108 
116  bool RemoveCalibration(std::string depth, std::string probe);
117 
121  virtual std::string GetDeviceClass() override;
122 
126  virtual USImageSource::Pointer GetUSImageSource() override;
127 
131  virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom() override;
132 
136  virtual itk::SmartPointer<USControlInterfaceBMode> GetControlInterfaceBMode() override;
137 
141  virtual itk::SmartPointer<USControlInterfaceProbes> GetControlInterfaceProbes() override;
142 
146  virtual itk::SmartPointer<USControlInterfaceDoppler> GetControlInterfaceDoppler() override;
147 
148  virtual itk::SmartPointer<mitk::NavigationDataSource> GetNavigationDataSource();
149 
153  bool GetIsCalibratedForCurrentStatus();
154 
158  bool GetContainsAtLeastOneCalibration();
159 
166  void UnregisterOnService();
167 
174  std::string SerializeCalibration();
175 
184  void DeserializeCalibration(const std::string &xmlString, bool clearPreviousCalibrations = true);
185 
186  void SetNumberOfSmoothingValues(unsigned int numberOfSmoothingValues);
187 
188  void SetDelayCount(unsigned int delayCount);
189 
190  void RegisterAsMicroservice();
191 
195  static const std::string US_INTERFACE_NAME;
196  static const std::string US_PROPKEY_DEVICENAME;
197  static const std::string US_PROPKEY_CLASS;
198  static const std::string US_PROPKEY_ID;
199  protected:
200  USCombinedModality(USDevice::Pointer usDevice, itk::SmartPointer<NavigationDataSource> trackingDevice, std::string manufacturer = "", std::string model = "");
201  virtual ~USCombinedModality();
202 
206  virtual bool OnInitialization() override;
207 
211  virtual bool OnConnection() override;
212 
216  virtual bool OnDisconnection() override;
217 
221  virtual bool OnActivation() override;
222 
226  virtual bool OnDeactivation() override;
227 
231  virtual void OnFreeze(bool) override;
232 
237  void GenerateData() override;
238 
239  std::string GetIdentifierForCurrentCalibration();
240  std::string GetIdentifierForCurrentProbe();
241  std::string GetCurrentDepthValue();
242 
243  void RebuildFilterPipeline();
244 
247  std::map<std::string, AffineTransform3D::Pointer> m_Calibrations;
248 
252 
254  unsigned int m_DelayCount;
255 
256  private:
260  us::ServiceRegistration<Self> m_ServiceRegistration;
261 
265  us::ServiceProperties m_ServiceProperties;
266  };
267 } // namespace mitk
268 
269 MITK_DECLARE_SERVICE_INTERFACE(mitk::USCombinedModality, "org.mitk.services.USCombinedModality")
270 #endif // MITKUSCombinedModality_H_HEADER_INCLUDED_
A device holds information about it's model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:77
static const std::string US_PROPKEY_DEVICENAME
itk::SmartPointer< Self > Pointer
itk::SmartPointer< mitk::NavigationDataSource > m_LastFilter
itk::SmartPointer< mitk::NavigationDataDelayFilter > m_DelayFilter
DataCollection - Class to facilitate loading/accessing structured data.
itk::SmartPointer< NavigationDataSource > m_TrackingDevice
static const std::string US_PROPKEY_ID
static const std::string US_PROPKEY_CLASS
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed)
Definition: mitkCommon.h:115
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
static const char * DefaultProbeIdentifier
Interface for all Tracking Devices.
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
static const char * ProbeAndDepthSeperator
USDevice::Pointer m_UltrasoundDevice
itk::SmartPointer< mitk::NavigationDataSmoothingFilter > m_SmoothingFilter
MITK_DECLARE_SERVICE_INTERFACE(mitk::ISimulationService,"org.mitk.ISimulationService")
Combination of USDevice and NavigationDataSource. This class can be used as any USDevice subclass...
static const std::string US_INTERFACE_NAME
These Constants are used in conjunction with Microservices.
static const std::string DeviceClassIdentifier
std::map< std::string, AffineTransform3D::Pointer > m_Calibrations