MITK-IGT
IGT Extension of MITK
|
Implementation of mitk::USDevice for Telemed API devices. Connects to a Telemed API device through its COM library interface. More...
#include <mitkUSTelemedDevice.h>
Public Member Functions | |
mitkClassMacro (USTelemedDevice, mitk::USDevice) | |
mitkNewMacro2Param (Self, std::string, std::string) | |
virtual std::string | GetDeviceClass () |
Returns the class of the device. | |
virtual USControlInterfaceBMode::Pointer | GetControlInterfaceBMode () |
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode control interface is available. Default implementation returns null. | |
virtual USControlInterfaceProbes::Pointer | GetControlInterfaceProbes () |
Default getter for the probes control interface. Has to be implemented in a subclass if a probes control interface is available. Default implementation returns null. | |
virtual USControlInterfaceDoppler::Pointer | GetControlInterfaceDoppler () |
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler control interface is available. Default implementation returns null. | |
virtual bool | OnInitialization () |
Is called during the initialization process. There is nothing done on the initialization of a mik::USTelemedDevive object. | |
virtual bool | OnConnection () |
Is called during the connection process. Connect to the Telemed API and try to get available probes from the device. | |
virtual bool | OnDisconnection () |
Is called during the disconnection process. Deactivate and remove all Telemed API controls. A disconnect from the Telemed API is not possible for which reason the hardware stays in connected state even after calling this method. | |
virtual bool | OnActivation () |
Is called during the activation process. After this method is finished, the device is generating images in b mode. Changing scanning mode is possible afterwards by using the appropriate control interfaces. | |
virtual bool | OnDeactivation () |
Is called during the deactivation process. After a call to this method the device is connected, but not producing images anymore. | |
virtual void | OnFreeze (bool freeze) |
Changes scan state of the device if freeze is toggeled in mitk::USDevice. | |
USImageSource::Pointer | GetUSImageSource () |
std::vector< mitk::USProbe::Pointer > | GetAllProbes () |
Returns all probes for this device or an empty vector it no probes were set Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice. Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it! | |
mitk::USProbe::Pointer | GetCurrentProbe () |
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice. Returns null otherwise. | |
mitk::USProbe::Pointer | GetProbeByName (std::string name) |
get the probe by its name Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned. | |
void | GenerateData () override |
Grabs the next frame from the Video input. This method is called internally, whenever Update() is invoked by an Output. | |
Usgfw2Lib::IUsgfw2 * | GetUsgMainInterface () |
Getter for main Telemed API object. This method is for being called by Telemed control interfaces. | |
void | SetActiveDataView (Usgfw2Lib::IUsgDataView *) |
Changes active IUsgDataView of the device. This method is for being called by Telemed control interfaces. | |
virtual HRESULT __stdcall | raw_OnProbeArrive (IUnknown *pUsgProbe, ULONG *reserved) |
virtual HRESULT __stdcall | raw_OnBeamformerArrive (IUnknown *pUsgBeamformer, ULONG *reserved) |
virtual HRESULT __stdcall | raw_OnProbeRemove (IUnknown *pUsgProbe, ULONG *reserved) |
virtual HRESULT __stdcall | raw_OnBeamformerRemove (IUnknown *pUsgBeamformer, ULONG *reserved) |
virtual HRESULT __stdcall | raw_OnProbeStateChanged (IUnknown *pUsgProbe, ULONG *reserved) |
virtual HRESULT __stdcall | raw_OnBeamformerStateChanged (IUnknown *pUsgBeamformer, ULONG *reserved) |
STDMETHODIMP_ (ULONG) AddRef() | |
STDMETHODIMP_ (ULONG) Release() | |
STDMETHODIMP | QueryInterface (REFIID riid, void **ppv) |
virtual HRESULT STDMETHODCALLTYPE | GetTypeInfoCount (UINT *pctinfo) |
virtual HRESULT STDMETHODCALLTYPE | GetTypeInfo (UINT itinfo, LCID lcid, ITypeInfo **pptinfo) |
virtual HRESULT STDMETHODCALLTYPE | GetIDsOfNames (const IID &riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid) |
virtual HRESULT STDMETHODCALLTYPE | Invoke (DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) |
![]() | |
mitkClassMacro (USDevice, mitk::ImageSource) | |
itkSetMacro (SpawnAcquireThread, bool) | |
itkGetMacro (SpawnAcquireThread, bool) | |
mitkNewMessage2Macro (PropertyChanged, const std::string &, const std::string &) | |
Event for being notified about changes of the micro service properties. This event can be used if no micro service context is available. | |
virtual itk::SmartPointer< USAbstractControlInterface > | GetControlInterfaceCustom () |
Default getter for the custom control interface. Has to be implemented in a subclass if a custom control interface is available. Default implementation returns null. | |
bool | Initialize () |
Changes device state to mitk::USDevice::State_Initialized. During initialization the virtual method mitk::USDevice::OnInitialization will be called. If this method returns false the initialization process will be canceled. Otherwise the mitk::USDevice is registered in a micro service. | |
bool | Connect () |
Connects this device. A connected device is ready to deliver images (i.e. be Activated). A Connected Device can be active. A disconnected Device cannot be active. Internally calls onConnect and then registers the device with the service. A device usually should override the OnConnection() method, but never the Connect() method, since this will possibly exclude the device from normal service management. The exact flow of events is:
| |
void | ConnectAsynchron () |
bool | Disconnect () |
Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection instead. | |
bool | Activate () |
Activates this device. After the activation process, the device will start to produce images. This Method will fail, if the device is not connected. | |
void | Deactivate () |
Deactivates this device. After the deactivation process, the device will no longer produce images, but still be connected. | |
virtual void | SetIsFreezed (bool freeze) |
Can toggle if ultrasound image is currently updated or freezed. | |
virtual bool | GetIsFreezed () |
void | PushFilter (AbstractOpenCVImageFilter::Pointer filter) |
void | PushFilterIfNotPushedBefore (AbstractOpenCVImageFilter::Pointer filter) |
bool | RemoveFilter (AbstractOpenCVImageFilter::Pointer filter) |
void | ProbeChanged (std::string probename) |
To be called when the used probe changed. Will update the service properties. | |
void | DepthChanged (double depth) |
To be called when the scanning depth of the probe changed. Will update the service properties. | |
void | UpdateServiceProperty (std::string key, std::string value) |
Given property is updated in the device micro service. This method is mainly for being used by the control interface superclasses. You do not need to call it by yoursefs in your concrete control interface classes. | |
void | UpdateServiceProperty (std::string key, double value) |
void | UpdateServiceProperty (std::string key, bool value) |
bool | GetIsInitialized () |
True, if the device object is created and initialized, false otherwise. | |
bool | GetIsActive () |
True, if the device is currently generating image data, false otherwise. | |
bool | GetIsConnected () |
True, if the device is currently ready to start transmitting image data or is already transmitting image data. A disconnected device cannot be activated. | |
mitk::USDevice::USImageCropArea | GetCropArea () |
unsigned int | GetSizeOfImageVector () |
DEPRECATED (std::string GetDeviceManufacturer()) | |
Deprecated -> use GetManufacturer() instead. | |
DEPRECATED (std::string GetDeviceModel()) | |
Deprecated -> use GetName() instead. | |
DEPRECATED (std::string GetDeviceComment()) | |
Deprecated -> use GetCommend() instead. | |
itkGetMacro (Manufacturer, std::string) | |
itkGetMacro (Name, std::string) | |
itkGetMacro (Comment, std::string) | |
void | SetManufacturer (std::string manufacturer) |
void | SetName (std::string name) |
void | SetComment (std::string comment) |
itkGetMacro (DeviceState, DeviceStates) | |
itkGetMacro (ServiceProperties, us::ServiceProperties) | |
void | GrabImage () |
virtual void | DeleteAllProbes () |
Cleans the std::vector containing all configured probes. | |
virtual void | AddNewProbe (mitk::USProbe::Pointer) |
adds a new probe to the device | |
virtual void | RemoveProbeByName (std::string) |
Removes the Probe with the given name. | |
virtual void | SetDefaultProbeAsCurrentProbe () |
Sets the first existing probe or the default probe of the ultrasound device as the current probe of it. | |
virtual void | SetCurrentProbe (std::string) |
Sets the probe with the given name as current probe if the named probe exists. | |
virtual void | SetSpacing (double xSpacing, double ySpacing) |
Protected Member Functions | |
USTelemedDevice (std::string manufacturer, std::string model) | |
virtual | ~USTelemedDevice () |
void | ReleaseUsgControls () |
void | ConnectDeviceChangeSink () |
void | StopScanning () |
Stop ultrasound scanning by Telemed API call. | |
![]() | |
virtual void | SetImageVector (std::vector< mitk::Image::Pointer > vec) |
void | Acquire () |
void | ConnectThread () |
void | ProvideViaOIGTL () |
Registers an OpenIGTLink device as a microservice so that we can send the images of this device via the network. | |
void | DisableOIGTL () |
Deregisters the microservices for OpenIGTLink. | |
us::ServiceProperties | ConstructServiceProperties () |
This Method constructs the service properties which can later be used to register the object with the Microservices Return service properties. | |
void | UnregisterOnService () |
Remove this device from the micro service. | |
USDevice (std::string manufacturer, std::string model) | |
Enforces minimal Metadata to be set. | |
USDevice (mitk::USImageMetadata::Pointer metadata) | |
Constructs a device with the given Metadata. Make sure the Metadata contains meaningful content! | |
~USDevice () override | |
void | GenerateData () override |
Grabs the next frame from the Video input. This method is called internally, whenever Update() is invoked by an Output. | |
std::string | GetServicePropertyLabel () |
Protected Attributes | |
USTelemedProbesControls::Pointer | m_ControlsProbes |
USTelemedBModeControls::Pointer | m_ControlsBMode |
USTelemedDopplerControls::Pointer | m_ControlsDoppler |
USTelemedImageSource::Pointer | m_ImageSource |
Usgfw2Lib::IUsgfw2 * | m_UsgMainInterface |
Usgfw2Lib::IProbe * | m_Probe |
Usgfw2Lib::IUsgDataView * | m_UsgDataView |
Usgfw2Lib::IUsgCollection * | m_ProbesCollection |
ULONG | m_RefCount |
IConnectionPoint * | m_UsgDeviceChangeCpnt |
DWORD | m_UsgDeviceChangeCpntCookie |
![]() | |
std::condition_variable | m_FreezeBarrier |
std::mutex | m_FreezeMutex |
std::mutex | m_ImageMutex |
mutex for images provided by the image source | |
std::thread | m_Thread |
std::vector< mitk::Image::Pointer > | m_ImageVector |
mitk::Vector3D | m_Spacing |
mitk::IGTLServer::Pointer | m_IGTLServer |
mitk::IGTLMessageProvider::Pointer | m_IGTLMessageProvider |
mitk::ImageToIGTLMessageFilter::Pointer | m_ImageToIGTLMsgFilter |
bool | m_IsFreezed |
DeviceStates | m_DeviceState |
USImageCropArea | m_CropArea |
unsigned int | m_NumberOfOutputs |
us::ServiceProperties | m_ServiceProperties |
Properties of the device's Microservice. | |
us::ServiceRegistration< Self > | m_ServiceRegistration |
The device's ServiceRegistration object that allows to modify it's Microservice registraton details. | |
Additional Inherited Members | |
![]() | |
enum | DeviceStates { State_NoState , State_Initialized , State_Connected , State_Activated } |
![]() | |
static mitk::USDevice::PropertyKeys | GetPropertyKeys () |
Implementation of mitk::USDevice for Telemed API devices. Connects to a Telemed API device through its COM library interface.
This class handles all API communications and creates interfaces for b mode, doppler and probes controls. Images given by the device are put into an object of mitk::USTelemedImageSource.
It implements IUsgDeviceChangeSink of the Telemed API to be notified of changes to beamformer device or probes (e.g. probe change).
Definition at line 38 of file mitkUSTelemedDevice.h.
|
protected |
Constructs a mitk::USTelemedDevice object by given manufacturer and model string. These strings are just for labeling the device in the micro service.
Control interfaces and image source are available directly after construction. Registration at the micro service happens not before initialization method was called.
Definition at line 17 of file mitkUSTelemedDevice.cpp.
|
protectedvirtual |
Definition at line 29 of file mitkUSTelemedDevice.cpp.
|
protected |
Definition at line 219 of file mitkUSTelemedDevice.cpp.
|
override |
Grabs the next frame from the Video input. This method is called internally, whenever Update() is invoked by an Output.
Definition at line 144 of file mitkUSTelemedDevice.cpp.
|
virtual |
Returns all probes for this device or an empty vector it no probes were set Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice. Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
Implements mitk::USDevice.
Definition at line 184 of file mitkUSTelemedDevice.cpp.
|
virtual |
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode control interface is available. Default implementation returns null.
Reimplemented from mitk::USDevice.
Definition at line 38 of file mitkUSTelemedDevice.cpp.
|
virtual |
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler control interface is available. Default implementation returns null.
Reimplemented from mitk::USDevice.
Definition at line 48 of file mitkUSTelemedDevice.cpp.
|
virtual |
Default getter for the probes control interface. Has to be implemented in a subclass if a probes control interface is available. Default implementation returns null.
Reimplemented from mitk::USDevice.
Definition at line 43 of file mitkUSTelemedDevice.cpp.
|
virtual |
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice. Returns null otherwise.
Implements mitk::USDevice.
Definition at line 188 of file mitkUSTelemedDevice.cpp.
|
virtual |
Returns the class of the device.
Implements mitk::USDevice.
Definition at line 33 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 318 of file mitkUSTelemedDevice.cpp.
|
virtual |
get the probe by its name Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
Implements mitk::USDevice.
Definition at line 192 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 310 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 303 of file mitkUSTelemedDevice.cpp.
Usgfw2Lib::IUsgfw2 * mitk::USTelemedDevice::GetUsgMainInterface | ( | ) |
Getter for main Telemed API object. This method is for being called by Telemed control interfaces.
Definition at line 199 of file mitkUSTelemedDevice.cpp.
|
virtual |
Implements mitk::USDevice.
Definition at line 151 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 324 of file mitkUSTelemedDevice.cpp.
mitk::USTelemedDevice::mitkClassMacro | ( | USTelemedDevice | , |
mitk::USDevice | ) |
mitk::USTelemedDevice::mitkNewMacro2Param | ( | Self | , |
std::string | , | ||
std::string | ) |
|
virtual |
Is called during the activation process. After this method is finished, the device is generating images in b mode. Changing scanning mode is possible afterwards by using the appropriate control interfaces.
mitk::Exception | if something goes wrong at the API calls |
Implements mitk::USDevice.
Definition at line 90 of file mitkUSTelemedDevice.cpp.
|
virtual |
Is called during the connection process. Connect to the Telemed API and try to get available probes from the device.
mitk::Exception | if something goes wrong at the API calls |
Implements mitk::USDevice.
Definition at line 60 of file mitkUSTelemedDevice.cpp.
|
virtual |
Is called during the deactivation process. After a call to this method the device is connected, but not producing images anymore.
mitk::Exception | if something goes wrong at the API calls |
Implements mitk::USDevice.
Definition at line 126 of file mitkUSTelemedDevice.cpp.
|
virtual |
Is called during the disconnection process. Deactivate and remove all Telemed API controls. A disconnect from the Telemed API is not possible for which reason the hardware stays in connected state even after calling this method.
mitk::Exception | if something goes wrong at the API calls |
Implements mitk::USDevice.
Definition at line 78 of file mitkUSTelemedDevice.cpp.
|
virtual |
Changes scan state of the device if freeze is toggeled in mitk::USDevice.
Reimplemented from mitk::USDevice.
Definition at line 132 of file mitkUSTelemedDevice.cpp.
|
virtual |
Is called during the initialization process. There is nothing done on the initialization of a mik::USTelemedDevive object.
Implements mitk::USDevice.
Definition at line 53 of file mitkUSTelemedDevice.cpp.
STDMETHODIMP mitk::USTelemedDevice::QueryInterface | ( | REFIID | riid, |
void ** | ppv ) |
Definition at line 288 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 242 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 249 of file mitkUSTelemedDevice.cpp.
|
inlinevirtual |
Definition at line 153 of file mitkUSTelemedDevice.h.
|
virtual |
Definition at line 258 of file mitkUSTelemedDevice.cpp.
|
virtual |
Definition at line 267 of file mitkUSTelemedDevice.cpp.
|
inlinevirtual |
Definition at line 152 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 156 of file mitkUSTelemedDevice.cpp.
void mitk::USTelemedDevice::SetActiveDataView | ( | Usgfw2Lib::IUsgDataView * | usgDataView | ) |
Changes active IUsgDataView of the device. This method is for being called by Telemed control interfaces.
Definition at line 204 of file mitkUSTelemedDevice.cpp.
mitk::USTelemedDevice::STDMETHODIMP_ | ( | ULONG | ) |
mitk::USTelemedDevice::STDMETHODIMP_ | ( | ULONG | ) |
|
protected |
Stop ultrasound scanning by Telemed API call.
mitk::Exception | if API call returned with an error |
Definition at line 166 of file mitkUSTelemedDevice.cpp.
|
protected |
Definition at line 191 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 192 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 190 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 194 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 197 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 199 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 201 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 198 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 202 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 203 of file mitkUSTelemedDevice.h.
|
protected |
Definition at line 196 of file mitkUSTelemedDevice.h.