13 #ifndef mitkUSDevice_h
14 #define mitkUSDevice_h
17 #include <condition_variable>
24 #include <MitkUSExports.h>
39 #include <itkObjectFactory.h>
50 template<
class T>
class SmartPointer;
54 class USAbstractControlInterface;
55 class USControlInterfaceBMode;
56 class USControlInterfaceProbes;
57 class USControlInterfaceDoppler;
81 itkSetMacro(SpawnAcquireThread,
bool);
82 itkGetMacro(SpawnAcquireThread,
bool);
120 : US_INTERFACE_NAME(
"org.mitk.services.UltrasoundDevice"),
121 US_PROPKEY_MANUFACTURER(US_INTERFACE_NAME +
".manufacturer"),
122 US_PROPKEY_NAME(US_INTERFACE_NAME +
".name"),
123 US_PROPKEY_COMMENT(US_INTERFACE_NAME +
".comment"),
124 US_PROPKEY_LABEL(US_INTERFACE_NAME +
".label"),
125 US_PROPKEY_ISCONNECTED(US_INTERFACE_NAME +
".isConnected"),
126 US_PROPKEY_ISACTIVE(US_INTERFACE_NAME +
".isActive"),
127 US_PROPKEY_CLASS(US_INTERFACE_NAME +
".class"),
128 US_PROPKEY_PROBES_SELECTED(US_INTERFACE_NAME +
".probes.selected"),
129 US_PROPKEY_BMODE_FREQUENCY(US_INTERFACE_NAME +
".bmode.frequency"),
130 US_PROPKEY_BMODE_POWER(US_INTERFACE_NAME +
".bmode.power"),
131 US_PROPKEY_BMODE_DEPTH(US_INTERFACE_NAME +
".bmode.depth"),
132 US_PROPKEY_BMODE_GAIN(US_INTERFACE_NAME +
".bmode.gain"),
133 US_PROPKEY_BMODE_REJECTION(US_INTERFACE_NAME +
".bmode.rejection"),
134 US_PROPKEY_BMODE_DYNAMIC_RANGE(US_INTERFACE_NAME +
".bmode.dynamicRange")
207 void ConnectAsynchron();
233 virtual void SetIsFreezed(
bool freeze);
238 virtual bool GetIsFreezed();
240 void PushFilter(AbstractOpenCVImageFilter::Pointer filter);
241 void PushFilterIfNotPushedBefore(AbstractOpenCVImageFilter::Pointer filter);
242 bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter);
248 void ProbeChanged(std::string probename);
254 void DepthChanged(
double depth);
262 void UpdateServiceProperty(std::string key, std::string value);
263 void UpdateServiceProperty(std::string key,
double value);
264 void UpdateServiceProperty(std::string key,
bool value);
271 virtual std::string GetDeviceClass() = 0;
276 bool GetIsInitialized();
287 bool GetIsConnected();
293 unsigned int GetSizeOfImageVector();
296 virtual USImageSource::Pointer GetUSImageSource() = 0;
299 DEPRECATED(std::string GetDeviceManufacturer());
305 itkGetMacro(Manufacturer, std::string);
306 itkGetMacro(Name, std::string);
307 itkGetMacro(Comment, std::string);
309 void SetManufacturer(std::string manufacturer);
310 void SetName(std::string name);
311 void SetComment(std::string comment);
313 itkGetMacro(DeviceState, DeviceStates);
324 virtual std::vector<mitk::USProbe::Pointer> GetAllProbes() = 0;
336 virtual mitk::USProbe::Pointer GetCurrentProbe() = 0;
347 virtual mitk::USProbe::Pointer GetProbeByName(std::string name) = 0;
365 virtual void SetSpacing(
double xSpacing,
double ySpacing);
377 if (this->m_ImageVector != vec)
379 this->m_ImageVector = vec;
385 void ConnectThread();
396 void ProvideViaOIGTL();
424 void UnregisterOnService();
434 virtual bool OnInitialization() = 0;
444 virtual bool OnConnection() = 0;
454 virtual bool OnDisconnection() = 0;
464 virtual bool OnActivation() = 0;
474 virtual bool OnDeactivation() = 0;
486 USDevice(std::string manufacturer, std::string model);
492 USDevice(mitk::USImageMetadata::Pointer metadata);
500 void GenerateData()
override;
502 std::string GetServicePropertyLabel();
519 std::string m_Manufacturer;
521 std::string m_Comment;
523 bool m_SpawnAcquireThread;
525 bool m_UnregisteringStarted;