Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKUSTelemedDevice_H_HEADER_INCLUDED_
18 #define MITKUSTelemedDevice_H_HEADER_INCLUDED_
19 
20 #include "mitkUSDevice.h"
26 
27 #include "mitkUSTelemedSDKHeader.h"
28 
29 namespace mitk {
42  class USTelemedDevice : public USDevice, public Usgfw2Lib::IUsgDeviceChangeSink
43  {
44  public:
46  mitkNewMacro2Param(Self, std::string, std::string);
47 
51  virtual std::string GetDeviceClass();
52 
56 
63  virtual bool OnInitialization();
64 
72  virtual bool OnConnection();
73 
83  virtual bool OnDisconnection();
84 
94  virtual bool OnActivation();
95 
103  virtual bool OnDeactivation();
104 
108  virtual void OnFreeze(bool freeze);
109 
112 
117  Usgfw2Lib::IUsgfw2* GetUsgMainInterface();
118 
123  void SetActiveDataView(Usgfw2Lib::IUsgDataView*);
124 
125  // Methods implemented for IUsgDeviceChangeSink
126  virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved);
127  virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved);
128  virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved);
129  virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved);
130  virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved) { return S_OK; };
131  virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved) { return S_OK; };
132 
133  // Methods implemented for IUnknown (necessary for IUsgDeviceChangeSink)
134  STDMETHODIMP_(ULONG) AddRef();
135  STDMETHODIMP_(ULONG) Release();
136  STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
137 
138  // Methods implemented for IDispatch (necessary for IUsgDeviceChangeSink)
139  virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
140  virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
141  virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
142  virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
143 
144  protected:
154  USTelemedDevice(std::string manufacturer, std::string model);
155  virtual ~USTelemedDevice();
156 
157  void ReleaseUsgControls( );
158 
159  void ConnectDeviceChangeSink( );
160 
166  void StopScanning( );
167 
171 
173 
175  Usgfw2Lib::IProbe* m_Probe;
176  Usgfw2Lib::IUsgDataView* m_UsgDataView;
177  Usgfw2Lib::IUsgCollection* m_ProbesCollection;
178 
179  ULONG m_RefCount;
180  IConnectionPoint* m_UsgDeviceChangeCpnt;
182  };
183 } // namespace mitk
184 
185 #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:77
itk::SmartPointer< Self > Pointer
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.
STL namespace.
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...
Implementation of mitk::USControlInterfaceProbes for Telemed ultrasound devices. See documentation of...
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...
Implementation of mitk::USImageSource for Telemed API devices. The method mitk::USImageSource::GetNex...
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...
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...
Implementation of mitk::USControlInterfaceBMode for Telemed ultrasound devices. See documentation of ...
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
Implementation of mitk::USControlInterfaceDoppler for Telemed ultrasound devices. See documentation o...