Medical Imaging Interaction Toolkit  2018.4.99-6ca56567
Medical Imaging Interaction Toolkit
mitkUSTelemedDevice.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKUSTelemedDevice_H_HEADER_INCLUDED_
14 #define MITKUSTelemedDevice_H_HEADER_INCLUDED_
15 
16 #include "mitkUSDevice.h"
22 
23 #include "mitkUSTelemedSDKHeader.h"
24 
25 namespace 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 
113  Usgfw2Lib::IUsgfw2* GetUsgMainInterface();
114 
119  void SetActiveDataView(Usgfw2Lib::IUsgDataView*);
120 
121  // Methods implemented for IUsgDeviceChangeSink
122  virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved);
123  virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved);
124  virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved);
125  virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved);
126  virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved) { return S_OK; };
127  virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved) { return S_OK; };
128 
129  // Methods implemented for IUnknown (necessary for IUsgDeviceChangeSink)
130  STDMETHODIMP_(ULONG) AddRef();
131  STDMETHODIMP_(ULONG) Release();
132  STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
133 
134  // Methods implemented for IDispatch (necessary for IUsgDeviceChangeSink)
135  virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
136  virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
137  virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
138  virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
139 
140  protected:
150  USTelemedDevice(std::string manufacturer, std::string model);
151  virtual ~USTelemedDevice();
152 
153  void ReleaseUsgControls( );
154 
155  void ConnectDeviceChangeSink( );
156 
162  void StopScanning( );
163 
164  USTelemedProbesControls::Pointer m_ControlsProbes;
165  USTelemedBModeControls::Pointer m_ControlsBMode;
166  USTelemedDopplerControls::Pointer m_ControlsDoppler;
167 
168  USTelemedImageSource::Pointer m_ImageSource;
169 
170  Usgfw2Lib::IUsgfw2* m_UsgMainInterface;
171  Usgfw2Lib::IProbe* m_Probe;
172  Usgfw2Lib::IUsgDataView* m_UsgDataView;
173  Usgfw2Lib::IUsgCollection* m_ProbesCollection;
174 
175  ULONG m_RefCount;
176  IConnectionPoint* m_UsgDeviceChangeCpnt;
178  };
179 } // namespace mitk
180 
181 #endif // MITKUSTelemedDevice_H_HEADER_INCLUDED_
virtual bool OnConnection()
Is called during the connection process. Connect to the Telemed API and try to get available probes f...
Usgfw2Lib::IUsgfw2 * m_UsgMainInterface
virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved)
A device holds information about it's model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:73
mitkClassMacro(USTelemedDevice, mitk::USDevice)
mitkNewMacro2Param(Self, std::string, std::string)
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
Usgfw2Lib::IUsgDataView * m_UsgDataView
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
Usgfw2Lib::IProbe * m_Probe
Implementation of mitk::USDevice for Telemed API devices. Connects to a Telemed API device through it...
USTelemedDopplerControls::Pointer m_ControlsDoppler
USTelemedImageSource::Pointer m_ImageSource
virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved)
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 USControlInterfaceProbes::Pointer GetControlInterfaceProbes()
Default getter for the probes control interface. Has to be implemented in a subclass if a probes cont...
virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved)
virtual bool OnDeactivation()
Is called during the deactivation process. After a call to this method the device is connected...
USTelemedDevice(std::string manufacturer, std::string model)
virtual std::string GetDeviceClass()
Returns the class of the device.
USTelemedProbesControls::Pointer m_ControlsProbes
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
STDMETHODIMP_(ULONG) AddRef()
virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved)
USImageSource::Pointer GetUSImageSource()
void SetActiveDataView(Usgfw2Lib::IUsgDataView *)
Changes active IUsgDataView of the device. This method is for being called by Telemed control interfa...
virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler()
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler co...
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
virtual bool OnActivation()
Is called during the activation process. After this method is finished, the device is generating imag...
virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved)
virtual void OnFreeze(bool freeze)
Changes scan state of the device if freeze is toggeled in mitk::USDevice.
virtual bool OnDisconnection()
Is called during the disconnection process. Deactivate and remove all Telemed API controls...
virtual bool OnInitialization()
Is called during the initialization process. There is nothing done on the initialization of a mik::US...
IConnectionPoint * m_UsgDeviceChangeCpnt
void StopScanning()
Stop ultrasound scanning by Telemed API call.
USTelemedBModeControls::Pointer m_ControlsBMode
virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode()
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode cont...
virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved)
Usgfw2Lib::IUsgCollection * m_ProbesCollection