IGSTK
igstkOpenIGTLinkVideoImager.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkOpenIGTLinkVideoImager.h,v $
5  Language: C++
6  Date: $Date: 2009-06-18 18:40:55 $
7  Version: $Revision: 1.1 $
8 
9  Copyright (c) ISC Insight Software Consortium. All rights reserved.
10  See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 
18 #ifndef __igstkOpenIGTLinkVideoImager_h
19 #define __igstkOpenIGTLinkVideoImager_h
20 
21 #ifdef _MSC_VER
22 #pragma warning ( disable : 4018 )
23 //Warning about: identifier was truncated to '255' characters in the debug
24 //information (MVC6.0 Debug)
25 #pragma warning( disable : 4284 )
26 #endif
27 
28 #include "igstkVideoImager.h"
30 #include "igtlServerSocket.h"
31 #include "igtlImageMessage.h"
32 
33 #include <map>
34 
35 class vtkImageData;
36 
37 namespace igstk {
38 
47 {
48 public:
51 
52 
53  typedef igtl::ServerSocket CommunicationType;
54 
57  void SetCommunication( CommunicationType *communication );
58 
59 protected:
60 
62 
63  virtual ~OpenIGTLinkVideoImager(void);
64 
67 
69  virtual ResultType InternalOpen( void );
70 
72  virtual ResultType InternalClose( void );
73 
75  virtual ResultType InternalStartImaging( void );
76 
78  virtual ResultType InternalStopImaging( void );
79 
81  virtual ResultType InternalUpdateStatus( void );
82 
86 
88  virtual ResultType InternalReset( void );
89 
92  const VideoImagerToolType * );
93 
96  virtual ResultType ValidateSpecifiedFrequency( double frequencyInHz );
97 
99  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
100 
103  VideoImagerToolType * imagerTool );
104 
107  VideoImagerToolType * imagerTool );
108 
109 private:
110 
111  OpenIGTLinkVideoImager(const Self&); //purposely not implemented
112  void operator=(const Self&); //purposely not implemented
113 
116  bool Initialize();
117 
119  itk::MutexLock::Pointer m_BufferLock;
120 
122  typedef std::map< std::string, igstk::Frame* >
123  VideoImagerToolFrameContainerType;
124 
125  VideoImagerToolFrameContainerType m_ToolFrameBuffer;
126 
128  std::map< std::string, int > m_ToolStatusContainer;
129 
131  CommunicationType::Pointer m_Communication;
132  igtl::MessageHeader::Pointer m_HeaderMsg;
133  igtl::ImageMessage::Pointer m_ImgMsg;
134  igtl::Socket::Pointer m_Socket;
135 };
136 
137 }
138 
139 #endif //__igstk_OpenIGTLinkVideoImager_h_