13 #ifndef MITKUSDevice_H_HEADER_INCLUDED_ 14 #define MITKUSDevice_H_HEADER_INCLUDED_ 36 #include <itkObjectFactory.h> 37 #include <itkConditionVariable.h> 48 template<
class T>
class SmartPointer;
52 class USAbstractControlInterface;
53 class USControlInterfaceBMode;
54 class USControlInterfaceProbes;
55 class USControlInterfaceDoppler;
79 itkSetMacro(SpawnAcquireThread,
bool);
80 itkGetMacro(SpawnAcquireThread,
bool);
118 : US_INTERFACE_NAME(
"org.mitk.services.UltrasoundDevice"),
119 US_PROPKEY_MANUFACTURER(US_INTERFACE_NAME +
".manufacturer"),
120 US_PROPKEY_NAME(US_INTERFACE_NAME +
".name"),
121 US_PROPKEY_COMMENT(US_INTERFACE_NAME +
".comment"),
122 US_PROPKEY_LABEL(US_INTERFACE_NAME +
".label"),
123 US_PROPKEY_ISCONNECTED(US_INTERFACE_NAME +
".isConnected"),
124 US_PROPKEY_ISACTIVE(US_INTERFACE_NAME +
".isActive"),
125 US_PROPKEY_CLASS(US_INTERFACE_NAME +
".class"),
126 US_PROPKEY_PROBES_SELECTED(US_INTERFACE_NAME +
".probes.selected"),
127 US_PROPKEY_BMODE_FREQUENCY(US_INTERFACE_NAME +
".bmode.frequency"),
128 US_PROPKEY_BMODE_POWER(US_INTERFACE_NAME +
".bmode.power"),
129 US_PROPKEY_BMODE_DEPTH(US_INTERFACE_NAME +
".bmode.depth"),
130 US_PROPKEY_BMODE_GAIN(US_INTERFACE_NAME +
".bmode.gain"),
131 US_PROPKEY_BMODE_REJECTION(US_INTERFACE_NAME +
".bmode.rejection"),
132 US_PROPKEY_BMODE_DYNAMIC_RANGE(US_INTERFACE_NAME +
".bmode.dynamicRange")
205 void ConnectAsynchron();
231 virtual void SetIsFreezed(
bool freeze);
236 virtual bool GetIsFreezed();
238 void PushFilter(AbstractOpenCVImageFilter::Pointer filter);
239 void PushFilterIfNotPushedBefore(AbstractOpenCVImageFilter::Pointer filter);
240 bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter);
246 void ProbeChanged(std::string probename);
252 void DepthChanged(
double depth);
260 void UpdateServiceProperty(std::string key, std::string value);
261 void UpdateServiceProperty(std::string key,
double value);
262 void UpdateServiceProperty(std::string key,
bool value);
269 virtual std::string GetDeviceClass() = 0;
274 bool GetIsInitialized();
285 bool GetIsConnected();
291 unsigned int GetSizeOfImageVector();
294 virtual USImageSource::Pointer GetUSImageSource() = 0;
297 DEPRECATED(std::string GetDeviceManufacturer());
303 itkGetMacro(Manufacturer, std::string);
304 itkGetMacro(Name, std::string);
305 itkGetMacro(Comment, std::string);
307 void SetManufacturer(std::string manufacturer);
308 void SetName(std::string name);
309 void SetComment(std::string comment);
322 virtual std::vector<mitk::USProbe::Pointer> GetAllProbes() = 0;
334 virtual mitk::USProbe::Pointer GetCurrentProbe() = 0;
345 virtual mitk::USProbe::Pointer GetProbeByName(std::string name) = 0;
363 virtual void SetSpacing(
double xSpacing,
double ySpacing);
376 if (this->m_ImageVector != vec)
378 this->m_ImageVector = vec;
383 static ITK_THREAD_RETURN_TYPE Acquire(
void* pInfoStruct);
384 static ITK_THREAD_RETURN_TYPE ConnectThread(
void* pInfoStruct);
395 void ProvideViaOIGTL();
423 void UnregisterOnService();
433 virtual bool OnInitialization() = 0;
443 virtual bool OnConnection() = 0;
453 virtual bool OnDisconnection() = 0;
463 virtual bool OnActivation() = 0;
473 virtual bool OnDeactivation() = 0;
485 USDevice(std::string manufacturer, std::string model);
491 USDevice(mitk::USImageMetadata::Pointer metadata);
499 void GenerateData()
override;
501 std::string GetServicePropertyLabel();
518 std::string m_Manufacturer;
520 std::string m_Comment;
522 bool m_SpawnAcquireThread;
524 bool m_UnregisteringStarted;
531 #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...
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.
itk::ConditionVariable::Pointer m_FreezeBarrier
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...
int m_ThreadID
ID of the started thread.
#define mitkClassMacro(className, SuperClassName)
itk::MultiThreader::Pointer m_MultiThreader
itk::MultiThreader used for thread handling
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
DeviceStates m_DeviceState
itk::SimpleMutexLock m_FreezeMutex
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
itk::FastMutexLock::Pointer m_ImageMutex
mutex for images provided by the image source
#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