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