Medical Imaging Interaction Toolkit  2016.11.0
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,
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 MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
18 #define MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
19 
20 #include <initguid.h>
21 #include <strmif.h>
22 #include <usgfw2.h>
23 #include <usgfw.h>
24 #include <usgscanb.h>
25 
26 #include "mitkUSTelemedSDKHeader.h"
27 #include "mitkImage.h"
28 
29 #include "itkFastMutexLock.h"
30 
44 class USTelemedScanConverterPlugin : public IUsgfwScanConverterPluginCB
45 
46 {
47 public:
50 
51  // internal functions for Telemed API
52  virtual HRESULT __stdcall QueryInterface(const IID& iid,void** ppv);
53  virtual ULONG __stdcall AddRef();
54  virtual ULONG __stdcall Release();
55 
64  void SetOutputImage(mitk::Image::Pointer outputImage, itk::FastMutexLock::Pointer outputImageMutex = 0);
65 
66  // receives pointers to input and output media samples
67  STDMETHOD(SampleCB) (
68  IMediaSample *pSampleIn,
69  IMediaSample *pSampleOut,
70  int nOutX1,
71  int nOutY1,
72  int nOutX2,
73  int nOutY2
74  ) {return S_OK;}
75 
76  // receives pointers to input and output sample buffers
77  STDMETHOD(BufferCB) (
78  PBYTE pBufferIn,
79  int nInBufferLen,
80  PBYTE pBufferOut,
81  int nOutBufferLen,
82  int nOutX1,
83  int nOutY1,
84  int nOutX2,
85  int nOutY2
86  ) {return S_OK;}
87 
88  // receives pointers to input and intermediate sample buffers
89  STDMETHOD(InInterimBufferCB) (
90  PBYTE pBufferIn,
91  int nInBufferLen,
92  PBYTE pBufferInterim,
93  int nInterimBufferLen,
94  int nOutX1,
95  int nOutY1,
96  int nOutX2,
97  int nOutY2
98  ) {return S_OK;}
99 
100  // receves pointers to input media sample and intermediatesample buffer
101  STDMETHOD(InInterimSampleCB) (
102  IMediaSample *pSampleIn,
103  PBYTE pBufferInterim,
104  int nInterimBufferLen,
105  int nOutX1,
106  int nOutY1,
107  int nOutX2,
108  int nOutY2
109  ) {return S_OK;}
110 
111  // receives pointers to output and intermediate sample buffers
112  STDMETHOD(InterimOutBufferCB) (
113  PBYTE pBufferInterim,
114  int nInterimBufferLen,
115  PBYTE pBufferOut,
116  int nOutBufferLen,
117  int nOutX1,
118  int nOutY1,
119  int nOutX2,
120  int nOutY2
121  );
122 
123  // receives pointers to output media sample and intermediate sample buffer
124  STDMETHOD(InterimOutSampleCB) (
125  PBYTE pBufferInterim,
126  int nInterimBufferLen,
127  IMediaSample *pSampleIn,
128  int nOutX1,
129  int nOutY1,
130  int nOutX2,
131  int nOutY2
132  ) {return S_OK;}
133 
134  // receives conversion parameter change pin index
135  // if parameter is negative parameter was changed by some filter interface
136  STDMETHOD(ParameterCB) (
137  int nPin
138  ) { return S_OK; }
139 
140  STDMETHOD(SetScanConverterPlugin)(IDispatch* plugin);
141  //STDMETHOD(getSource)(LONG* plugin);
142 
143 protected:
147  void ReleasePlugin( );
148 
152  IUsgfwScanConverterPlugin* m_Plugin;
153 
159 
165 
166 private:
167  long m_cRef ;
168 };
169 
170 #endif // MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
itk::SmartPointer< Self > Pointer
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)