13 #ifndef MITKUSDevice_H_HEADER_INCLUDED_ 14 #define MITKUSDevice_H_HEADER_INCLUDED_ 17 #include <condition_variable> 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);
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;
532 #endif // MITKUSDevice_H_HEADER_INCLUDED_
Superclass of all classes generating Images (instances of class Image) as output. ...
#define MITK_DECLARE_SERVICE_INTERFACE(IFace, IId)
A device holds information about it's model, make and the connected probes. It is the common super cl...
std::condition_variable m_FreezeBarrier
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider
virtual void SetCurrentProbe(std::string)
Sets the probe with the given name as current probe if the named probe exists.
virtual void RemoveProbeByName(std::string)
Removes the Probe with the given name.
USImageCropArea m_CropArea
const std::string US_PROPKEY_LABEL
const std::string US_INTERFACE_NAME
const std::string US_PROPKEY_BMODE_FREQUENCY
DataCollection - Class to facilitate loading/accessing structured data.
const std::string US_PROPKEY_ISCONNECTED
virtual void DeleteAllProbes()
Cleans the std::vector containing all configured probes.
mitk::IGTLServer::Pointer m_IGTLServer
const std::string US_PROPKEY_BMODE_POWER
const std::string US_PROPKEY_BMODE_REJECTION
virtual void SetDefaultProbeAsCurrentProbe()
Sets the first existing probe or the default probe of the ultrasound device as the current probe of i...
const std::string US_PROPKEY_BMODE_GAIN
const std::string US_PROPKEY_CLASS
mitk::ImageToIGTLMessageFilter::Pointer m_ImageToIGTLMsgFilter
const std::string US_PROPKEY_BMODE_DEPTH
These constants are used in conjunction with Microservices. The constants aren't defined as static me...
#define mitkClassMacro(className, SuperClassName)
const std::string US_PROPKEY_PROBES_SELECTED
us::ServiceRegistration< Self > m_ServiceRegistration
The device's ServiceRegistration object that allows to modify it's Microservice registraton details...
us::ServiceProperties m_ServiceProperties
Properties of the device's Microservice.
virtual void SetImageVector(std::vector< mitk::Image::Pointer > vec)
const std::string US_PROPKEY_MANUFACTURER
US_UNORDERED_MAP_TYPE< std::string, Any > ServiceProperties
unsigned int m_NumberOfOutputs
std::vector< mitk::Image::Pointer > m_ImageVector
std::mutex m_ImageMutex
mutex for images provided by the image source
DeviceStates m_DeviceState
virtual void OnFreeze(bool)
Called when mitk::USDevice::SetIsFreezed() is called. Subclasses can overwrite this method to do addi...
const std::string US_PROPKEY_ISACTIVE
const std::string US_PROPKEY_NAME
#define mitkNewMessage2Macro(msgHandleObject, type1, type2)
const std::string US_PROPKEY_BMODE_DYNAMIC_RANGE
const std::string US_PROPKEY_COMMENT
virtual void AddNewProbe(mitk::USProbe::Pointer)
adds a new probe to the device