MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
mitkUSTelemedDevice.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13#ifndef mitkUSTelemedDevice_h
14#define mitkUSTelemedDevice_h
15
16#include "mitkUSDevice.h"
22
24
25namespace mitk {
38 class USTelemedDevice : public USDevice, public Usgfw2Lib::IUsgDeviceChangeSink
39 {
40 public:
42 mitkNewMacro2Param(Self, std::string, std::string);
43
47 virtual std::string GetDeviceClass();
48
49 virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode();
50 virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes();
51 virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler();
52
59 virtual bool OnInitialization();
60
68 virtual bool OnConnection();
69
79 virtual bool OnDisconnection();
80
90 virtual bool OnActivation();
91
99 virtual bool OnDeactivation();
100
104 virtual void OnFreeze(bool freeze);
105
107 USImageSource::Pointer GetUSImageSource( );
108
114 std::vector<mitk::USProbe::Pointer> GetAllProbes();
115
121 mitk::USProbe::Pointer GetCurrentProbe();
122
127 mitk::USProbe::Pointer GetProbeByName(std::string name);
128
133 void GenerateData() override;
134
139 Usgfw2Lib::IUsgfw2* GetUsgMainInterface();
140
145 void SetActiveDataView(Usgfw2Lib::IUsgDataView*);
146
147 // Methods implemented for IUsgDeviceChangeSink
148 virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved);
149 virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved);
150 virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved);
151 virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved);
152 virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved) { return S_OK; };
153 virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved) { return S_OK; };
154
155 // Methods implemented for IUnknown (necessary for IUsgDeviceChangeSink)
156 STDMETHODIMP_(ULONG) AddRef();
157 STDMETHODIMP_(ULONG) Release();
158 STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
159
160 // Methods implemented for IDispatch (necessary for IUsgDeviceChangeSink)
161 virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
162 virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
163 virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
164 virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
165
166 protected:
176 USTelemedDevice(std::string manufacturer, std::string model);
177 virtual ~USTelemedDevice();
178
179 void ReleaseUsgControls( );
180
182
188 void StopScanning( );
189
190 USTelemedProbesControls::Pointer m_ControlsProbes;
191 USTelemedBModeControls::Pointer m_ControlsBMode;
192 USTelemedDopplerControls::Pointer m_ControlsDoppler;
193
194 USTelemedImageSource::Pointer m_ImageSource;
195
196 Usgfw2Lib::IUsgfw2* m_UsgMainInterface;
197 Usgfw2Lib::IProbe* m_Probe;
198 Usgfw2Lib::IUsgDataView* m_UsgDataView;
199 Usgfw2Lib::IUsgCollection* m_ProbesCollection;
200
202 IConnectionPoint* m_UsgDeviceChangeCpnt;
204 };
205} // namespace mitk
206
207#endif
A device holds information about it's model, make and the connected probes. It is the common super cl...
Implementation of mitk::USDevice for Telemed API devices. Connects to a Telemed API device through it...
void GenerateData() override
Grabs the next frame from the Video input. This method is called internally, whenever Update() is inv...
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved)
USTelemedImageSource::Pointer m_ImageSource
virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved)
Usgfw2Lib::IProbe * m_Probe
USTelemedDevice(std::string manufacturer, std::string model)
USTelemedDopplerControls::Pointer m_ControlsDoppler
virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved)
USImageSource::Pointer GetUSImageSource()
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
STDMETHODIMP_(ULONG) Release()
Usgfw2Lib::IUsgfw2 * GetUsgMainInterface()
Getter for main Telemed API object. This method is for being called by Telemed control interfaces.
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
virtual bool OnActivation()
Is called during the activation process. After this method is finished, the device is generating imag...
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
void StopScanning()
Stop ultrasound scanning by Telemed API call.
void SetActiveDataView(Usgfw2Lib::IUsgDataView *)
Changes active IUsgDataView of the device. This method is for being called by Telemed control interfa...
virtual bool OnInitialization()
Is called during the initialization process. There is nothing done on the initialization of a mik::US...
mitk::USProbe::Pointer GetProbeByName(std::string name)
get the probe by its name Returns a pointer to the probe identified by the given name....
Usgfw2Lib::IUsgDataView * m_UsgDataView
Usgfw2Lib::IUsgfw2 * m_UsgMainInterface
mitk::USProbe::Pointer GetCurrentProbe()
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use...
mitkClassMacro(USTelemedDevice, mitk::USDevice)
virtual void OnFreeze(bool freeze)
Changes scan state of the device if freeze is toggeled in mitk::USDevice.
virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode()
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode cont...
USTelemedProbesControls::Pointer m_ControlsProbes
virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved)
virtual std::string GetDeviceClass()
Returns the class of the device.
virtual bool OnDisconnection()
Is called during the disconnection process. Deactivate and remove all Telemed API controls....
Usgfw2Lib::IUsgCollection * m_ProbesCollection
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 ...
virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes()
Default getter for the probes control interface. Has to be implemented in a subclass if a probes cont...
mitkNewMacro2Param(Self, std::string, std::string)
virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler()
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler co...
USTelemedBModeControls::Pointer m_ControlsBMode
virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved)
IConnectionPoint * m_UsgDeviceChangeCpnt
virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved)
STDMETHODIMP_(ULONG) AddRef()
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
virtual bool OnConnection()
Is called during the connection process. Connect to the Telemed API and try to get available probes f...
virtual bool OnDeactivation()
Is called during the deactivation process. After a call to this method the device is connected,...
IGT Exceptions.