Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkUSTelemedScanConverterPlugin.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 mitkUSTelemedScanConverterPlugin_h
14 #define mitkUSTelemedScanConverterPlugin_h
15 
16 #include <initguid.h>
17 #include <strmif.h>
18 #include <usgfw2.h>
19 #include <usgfw.h>
20 #include <usgscanb.h>
21 #include <mutex>
22 
23 #include "mitkUSTelemedSDKHeader.h"
24 #include "mitkImage.h"
25 
26 
27 
41 class USTelemedScanConverterPlugin : public IUsgfwScanConverterPluginCB
42 
43 {
44 public:
47 
48  // internal functions for Telemed API
49  virtual HRESULT __stdcall QueryInterface(const IID& iid,void** ppv);
50  virtual ULONG __stdcall AddRef();
51  virtual ULONG __stdcall Release();
52 
61  void SetOutputImage(mitk::Image::Pointer outputImage, std::mutex* outputImageMutex);
62 
63  // receives pointers to input and output media samples
64  STDMETHOD(SampleCB) (
65  IMediaSample *pSampleIn,
66  IMediaSample *pSampleOut,
67  int nOutX1,
68  int nOutY1,
69  int nOutX2,
70  int nOutY2
71  ) {return S_OK;}
72 
73  // receives pointers to input and output sample buffers
74  STDMETHOD(BufferCB) (
75  PBYTE pBufferIn,
76  int nInBufferLen,
77  PBYTE pBufferOut,
78  int nOutBufferLen,
79  int nOutX1,
80  int nOutY1,
81  int nOutX2,
82  int nOutY2
83  ) {return S_OK;}
84 
85  // receives pointers to input and intermediate sample buffers
86  STDMETHOD(InInterimBufferCB) (
87  PBYTE pBufferIn,
88  int nInBufferLen,
89  PBYTE pBufferInterim,
90  int nInterimBufferLen,
91  int nOutX1,
92  int nOutY1,
93  int nOutX2,
94  int nOutY2
95  ) {return S_OK;}
96 
97  // receves pointers to input media sample and intermediatesample buffer
98  STDMETHOD(InInterimSampleCB) (
99  IMediaSample *pSampleIn,
100  PBYTE pBufferInterim,
101  int nInterimBufferLen,
102  int nOutX1,
103  int nOutY1,
104  int nOutX2,
105  int nOutY2
106  ) {return S_OK;}
107 
108  // receives pointers to output and intermediate sample buffers
109  STDMETHOD(InterimOutBufferCB) (
110  PBYTE pBufferInterim,
111  int nInterimBufferLen,
112  PBYTE pBufferOut,
113  int nOutBufferLen,
114  int nOutX1,
115  int nOutY1,
116  int nOutX2,
117  int nOutY2
118  );
119 
120  // receives pointers to output media sample and intermediate sample buffer
121  STDMETHOD(InterimOutSampleCB) (
122  PBYTE pBufferInterim,
123  int nInterimBufferLen,
124  IMediaSample *pSampleIn,
125  int nOutX1,
126  int nOutY1,
127  int nOutX2,
128  int nOutY2
129  ) {return S_OK;}
130 
131  // receives conversion parameter change pin index
132  // if parameter is negative parameter was changed by some filter interface
133  STDMETHOD(ParameterCB) (
134  int nPin
135  ) { return S_OK; }
136 
137  STDMETHOD(SetScanConverterPlugin)(IDispatch* plugin);
138  //STDMETHOD(getSource)(LONG* plugin);
139 
140 protected:
144  void ReleasePlugin( );
145 
149  IUsgfwScanConverterPlugin* m_Plugin;
150 
156 
161  std::mutex* m_OutputImageMutex;
162 
163 private:
164  long m_cRef ;
165 };
166 
167 #endif
USTelemedScanConverterPlugin::BufferCB
STDMETHOD() BufferCB(PBYTE pBufferIn, int nInBufferLen, PBYTE pBufferOut, int nOutBufferLen, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
Definition: mitkUSTelemedScanConverterPlugin.h:74
USTelemedScanConverterPlugin::m_OutputImageMutex
std::mutex * m_OutputImageMutex
Definition: mitkUSTelemedScanConverterPlugin.h:161
mitkUSTelemedSDKHeader.h
mitkImage.h
USTelemedScanConverterPlugin::AddRef
virtual ULONG __stdcall AddRef()
USTelemedScanConverterPlugin::Release
virtual ULONG __stdcall Release()
USTelemedScanConverterPlugin::m_OutputImage
mitk::Image::Pointer m_OutputImage
Definition: mitkUSTelemedScanConverterPlugin.h:155
USTelemedScanConverterPlugin::~USTelemedScanConverterPlugin
~USTelemedScanConverterPlugin()
itk::SmartPointer< Self >
USTelemedScanConverterPlugin::InterimOutSampleCB
STDMETHOD() InterimOutSampleCB(PBYTE pBufferInterim, int nInterimBufferLen, IMediaSample *pSampleIn, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
Definition: mitkUSTelemedScanConverterPlugin.h:121
USTelemedScanConverterPlugin::m_Plugin
IUsgfwScanConverterPlugin * m_Plugin
Definition: mitkUSTelemedScanConverterPlugin.h:149
USTelemedScanConverterPlugin::SampleCB
STDMETHOD() SampleCB(IMediaSample *pSampleIn, IMediaSample *pSampleOut, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
Definition: mitkUSTelemedScanConverterPlugin.h:64
USTelemedScanConverterPlugin::SetScanConverterPlugin
STDMETHOD() SetScanConverterPlugin(IDispatch *plugin)
USTelemedScanConverterPlugin::InInterimBufferCB
STDMETHOD() InInterimBufferCB(PBYTE pBufferIn, int nInBufferLen, PBYTE pBufferInterim, int nInterimBufferLen, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
Definition: mitkUSTelemedScanConverterPlugin.h:86
USTelemedScanConverterPlugin::USTelemedScanConverterPlugin
USTelemedScanConverterPlugin()
USTelemedScanConverterPlugin::QueryInterface
virtual HRESULT __stdcall QueryInterface(const IID &iid, void **ppv)
USTelemedScanConverterPlugin::InterimOutBufferCB
STDMETHOD() InterimOutBufferCB(PBYTE pBufferInterim, int nInterimBufferLen, PBYTE pBufferOut, int nOutBufferLen, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
USTelemedScanConverterPlugin::ReleasePlugin
void ReleasePlugin()
USTelemedScanConverterPlugin::SetOutputImage
void SetOutputImage(mitk::Image::Pointer outputImage, std::mutex *outputImageMutex)
USTelemedScanConverterPlugin
Telemed API plugin for getting images from scan lines. Implements a COM interface whereat only the fu...
Definition: mitkUSTelemedScanConverterPlugin.h:41
USTelemedScanConverterPlugin::InInterimSampleCB
STDMETHOD() InInterimSampleCB(IMediaSample *pSampleIn, PBYTE pBufferInterim, int nInterimBufferLen, int nOutX1, int nOutY1, int nOutX2, int nOutY2)
Definition: mitkUSTelemedScanConverterPlugin.h:98
USTelemedScanConverterPlugin::ParameterCB
STDMETHOD() ParameterCB(int nPin)
Definition: mitkUSTelemedScanConverterPlugin.h:133