Medical Imaging Interaction Toolkit  2023.12.00
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
14 #define mitkUSTelemedDevice_h
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 
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 
181  void ConnectDeviceChangeSink( );
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 
201  ULONG m_RefCount;
202  IConnectionPoint* m_UsgDeviceChangeCpnt;
204  };
205 } // namespace mitk
206 
207 #endif
mitkUSTelemedImageSource.h
mitk::USTelemedDevice::GetAllProbes
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 ...
mitk::USTelemedDevice::GetUSImageSource
USImageSource::Pointer GetUSImageSource()
mitkUSTelemedSDKHeader.h
mitk::USTelemedDevice::ReleaseUsgControls
void ReleaseUsgControls()
mitk::USTelemedDevice::~USTelemedDevice
virtual ~USTelemedDevice()
mitk::USTelemedDevice::STDMETHODIMP_
STDMETHODIMP_(ULONG) AddRef()
mitk::USTelemedDevice::GetTypeInfo
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo)
mitk::USTelemedDevice::m_ProbesCollection
Usgfw2Lib::IUsgCollection * m_ProbesCollection
Definition: mitkUSTelemedDevice.h:199
mitk::USTelemedDevice::m_ImageSource
USTelemedImageSource::Pointer m_ImageSource
Definition: mitkUSTelemedDevice.h:194
mitk::USTelemedDevice
Implementation of mitk::USDevice for Telemed API devices. Connects to a Telemed API device through it...
Definition: mitkUSTelemedDevice.h:38
mitk::USTelemedDevice::raw_OnBeamformerRemove
virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved)
mitk::USTelemedDevice::OnDeactivation
virtual bool OnDeactivation()
Is called during the deactivation process. After a call to this method the device is connected,...
mitkUSTelemedScanConverterPlugin.h
mitk::USTelemedDevice::OnInitialization
virtual bool OnInitialization()
Is called during the initialization process. There is nothing done on the initialization of a mik::US...
mitk::USTelemedDevice::m_RefCount
ULONG m_RefCount
Definition: mitkUSTelemedDevice.h:201
mitk::USTelemedDevice::GetTypeInfoCount
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo)
mitk::USTelemedDevice::SetActiveDataView
void SetActiveDataView(Usgfw2Lib::IUsgDataView *)
Changes active IUsgDataView of the device. This method is for being called by Telemed control interfa...
mitk::USTelemedDevice::StopScanning
void StopScanning()
Stop ultrasound scanning by Telemed API call.
mitk::USTelemedDevice::GetProbeByName
mitk::USProbe::Pointer GetProbeByName(std::string name)
get the probe by its name Returns a pointer to the probe identified by the given name....
mitk::USTelemedDevice::OnFreeze
virtual void OnFreeze(bool freeze)
Changes scan state of the device if freeze is toggeled in mitk::USDevice.
mitk::USTelemedDevice::GetControlInterfaceBMode
virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode()
Default getter for the b mode control interface. Has to be implemented in a subclass if a b mode cont...
mitk::USDevice
A device holds information about it's model, make and the connected probes. It is the common super cl...
Definition: mitkUSDevice.h:75
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::USTelemedDevice::GetCurrentProbe
mitk::USProbe::Pointer GetCurrentProbe()
Return current active probe for this USDevice Returns a pointer to the probe that is currently in use...
mitk::USTelemedDevice::GetControlInterfaceDoppler
virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler()
Default getter for the doppler control interface. Has to be implemented in a subclass if a doppler co...
mitk::USTelemedDevice::m_UsgMainInterface
Usgfw2Lib::IUsgfw2 * m_UsgMainInterface
Definition: mitkUSTelemedDevice.h:196
mitk::USTelemedDevice::raw_OnProbeStateChanged
virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved)
Definition: mitkUSTelemedDevice.h:152
mitk::USTelemedDevice::m_UsgDeviceChangeCpntCookie
DWORD m_UsgDeviceChangeCpntCookie
Definition: mitkUSTelemedDevice.h:203
mitk::USTelemedDevice::GetControlInterfaceProbes
virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes()
Default getter for the probes control interface. Has to be implemented in a subclass if a probes cont...
mitk::USTelemedDevice::m_UsgDataView
Usgfw2Lib::IUsgDataView * m_UsgDataView
Definition: mitkUSTelemedDevice.h:198
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::USTelemedDevice::mitkClassMacro
mitkClassMacro(USTelemedDevice, mitk::USDevice)
mitk::USTelemedDevice::m_UsgDeviceChangeCpnt
IConnectionPoint * m_UsgDeviceChangeCpnt
Definition: mitkUSTelemedDevice.h:202
mitk::USTelemedDevice::ConnectDeviceChangeSink
void ConnectDeviceChangeSink()
mitk::USTelemedDevice::QueryInterface
STDMETHODIMP QueryInterface(REFIID riid, void **ppv)
mitk::USTelemedDevice::OnActivation
virtual bool OnActivation()
Is called during the activation process. After this method is finished, the device is generating imag...
mitk::USTelemedDevice::GenerateData
void GenerateData() override
Grabs the next frame from the Video input. This method is called internally, whenever Update() is inv...
mitk::USTelemedDevice::GetDeviceClass
virtual std::string GetDeviceClass()
Returns the class of the device.
mitk::USTelemedDevice::mitkNewMacro2Param
mitkNewMacro2Param(Self, std::string, std::string)
mitkUSDevice.h
mitk::USTelemedDevice::OnDisconnection
virtual bool OnDisconnection()
Is called during the disconnection process. Deactivate and remove all Telemed API controls....
mitk::USTelemedDevice::raw_OnBeamformerArrive
virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved)
mitkUSTelemedProbesControls.h
mitk::USTelemedDevice::m_Probe
Usgfw2Lib::IProbe * m_Probe
Definition: mitkUSTelemedDevice.h:197
mitk::USTelemedDevice::USTelemedDevice
USTelemedDevice(std::string manufacturer, std::string model)
mitk::USTelemedDevice::raw_OnBeamformerStateChanged
virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved)
Definition: mitkUSTelemedDevice.h:153
mitkUSTelemedBModeControls.h
mitk::USTelemedDevice::raw_OnProbeArrive
virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved)
mitk::USTelemedDevice::raw_OnProbeRemove
virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved)
mitk::USTelemedDevice::m_ControlsDoppler
USTelemedDopplerControls::Pointer m_ControlsDoppler
Definition: mitkUSTelemedDevice.h:192
mitk::USTelemedDevice::OnConnection
virtual bool OnConnection()
Is called during the connection process. Connect to the Telemed API and try to get available probes f...
mitk::USTelemedDevice::m_ControlsProbes
USTelemedProbesControls::Pointer m_ControlsProbes
Definition: mitkUSTelemedDevice.h:190
mitkUSTelemedDopplerControls.h
mitk::USTelemedDevice::GetUsgMainInterface
Usgfw2Lib::IUsgfw2 * GetUsgMainInterface()
Getter for main Telemed API object. This method is for being called by Telemed control interfaces.
mitk::USTelemedDevice::GetIDsOfNames
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgdispid)
mitk::USTelemedDevice::m_ControlsBMode
USTelemedBModeControls::Pointer m_ControlsBMode
Definition: mitkUSTelemedDevice.h:191
mitk::USTelemedDevice::Invoke
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)