/usr/include/IGSTK/igstkVideoImagerTool.h is in libigstk4-dev 4.4.0-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 | /*=========================================================================
Program: Image Guided Surgery Software Toolkit
Module: $RCSfile: igstkVideoImagerTool.h,v $
Language: C++
Date: $Date: 2009-06-18 18:40:55 $
Version: $Revision: 1.1 $
Copyright (c) ISC Insight Software Consortium. All rights reserved.
See IGSTKCopyright.txt or http://www.igstk.org/copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __igstkVideoImagerTool_h
#define __igstkVideoImagerTool_h
#include "igstkObject.h"
#include "igstkTransform.h"
#include "igstkFrame.h"
#include "igstkMacros.h"
#include "igstkStateMachine.h"
#include "igstkCoordinateSystemInterfaceMacros.h"
class vtkImagedata;
namespace igstk
{
igstkEventMacro( VideoImagerToolEvent, StringEvent);
igstkEventMacro( VideoImagerToolErrorEvent, IGSTKErrorWithStringEvent);
igstkEventMacro( VideoImagerToolConfigurationEvent,VideoImagerToolEvent);
igstkEventMacro( VideoImagerToolConfigurationErrorEvent,
VideoImagerToolErrorEvent);
igstkEventMacro( InvalidRequestToAttachVideoImagerToolErrorEvent,
VideoImagerToolErrorEvent);
igstkEventMacro( InvalidRequestToDetachVideoImagerToolErrorEvent,
VideoImagerToolErrorEvent);
igstkEventMacro( VideoImagerToolAttachmentToVideoImagerEvent,
VideoImagerToolEvent);
igstkEventMacro( VideoImagerToolAttachmentToVideoImagerErrorEvent,
VideoImagerToolErrorEvent);
igstkEventMacro( VideoImagerToolDetachmentFromVideoImagerEvent,
VideoImagerToolEvent);
igstkEventMacro( VideoImagerToolDetachmentFromVideoImagerErrorEvent,
VideoImagerToolErrorEvent);
igstkEventMacro( VideoImagerToolMadeTransitionToStreamingStateEvent,
VideoImagerToolEvent);
igstkEventMacro( VideoImagerToolNotAvailableEvent,VideoImagerToolEvent);
igstkEventMacro( ToolImagingStartedEvent,VideoImagerToolEvent);
igstkEventMacro( ToolImagingStoppedEvent,VideoImagerToolEvent);
igstkLoadedEventMacro( FrameModifiedEvent, IGSTKEvent, igstk::Frame);
class VideoImager;
/** \class VideoImagerTool
* \brief Abstract superclass for concrete IGSTK VideoImagerTool classes.
*
* This class provides a generic implementation of an VideoImager.
* This may contain hardware specific details of
* the video-device.
*
*
* \image html igstkVideoImagerTool.png "VideoImagerTool StateMachineDiagram"
* \image latex igstkVideoImagerTool.eps "VideoImagerTool StateMachineDiagram"
*
* \ingroup VideoImager
*/
class VideoImagerTool : public Object
{
public:
/** Macro with standard traits declarations. */
igstkStandardAbstractClassTraitsMacro( VideoImagerTool, Object )
public:
igstkFriendClassMacro( VideoImager );
typedef VideoImager VideoImagerType;
typedef Transform TransformType;
typedef Frame FrameType;
/** Get whether the tool was updated during VideoImager UpdateStatus() */
igstkGetMacro( Updated, bool );
/** The "RequestConfigure" method attempts to configure the VideoImager tool*/
virtual void RequestConfigure( void );
/** The "RequestDetachFromVideoImager" method detaches the VideoImager tool
* from the VideoImager. */
virtual void RequestDetachFromVideoImager( );
/** Request to get the internal frame as an event */
virtual void RequestGetFrame();
/** Access the unique identifier to the VideoImager tool */
const std::string GetVideoImagerToolIdentifier( ) const;
/** The "RequestAttachToVideoImager" method attaches the VideoImager tool to a
* VideoImager. */
virtual void RequestAttachToVideoImager( VideoImagerType * );
/** Get the frame with the current index for this tool. */
FrameType* GetInternalFrame( void );
/** Set the frame for this tool. */
void SetInternalFrame( FrameType* );
void SetFrameDimensions( unsigned int * );
void GetFrameDimensions( unsigned int * );
igstkSetMacro( PixelDepth, unsigned int );
igstkGetMacro( PixelDepth, unsigned int );
igstkSetMacro( Delay, unsigned int );
igstkGetMacro( Delay, unsigned int );
igstk::Frame* GetFrameFromBuffer(const unsigned int index);
igstk::Frame* GetTemporalCalibratedFrame();
protected:
VideoImagerTool(void);
virtual ~VideoImagerTool(void);
/** Print the object information in a stream. */
virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
/** Set a unique identifier to the VideoImager tool */
void SetVideoImagerToolIdentifier( const std::string identifier );
private:
VideoImagerTool(const Self&); //purposely not implemented
void operator=(const Self&); //purposely not implemented
/** Push ImagingStarted input to the VideoImager tool */
virtual void RequestReportImagingStarted( );
/** Push ImagingStopped input to the VideoImager tool */
virtual void RequestReportImagingStopped( );
/** Push VideoImagerToolNotAvailable input to the VideoImager tool */
virtual void RequestReportImagingToolNotAvailable( );
/** Push VideoImagerToolStreaming input to the VideoImager tool */
virtual void RequestReportImagingToolStreaming( );
/** Push AttachmentToVideoImagerSuccess input to the VideoImager tool*/
void RequestReportSuccessfulVideoImagerToolAttachment();
/** Push AttachmentToVideoImagerFailure input to the VideoImager tool*/
void RequestReportFailedVideoImagerToolAttachment();
/** Set whether the tool was updated during VideoImager UpdateStatus() */
igstkSetMacro( Updated, bool );
/** Check if the VideoImager tool is configured or not. This method should
* be implemented in the derived classes. */
virtual bool CheckIfVideoImagerToolIsConfigured( ) const = 0;
/** Inputs to the State Machine */
igstkDeclareInputMacro( ConfigureTool );
igstkDeclareInputMacro( ToolConfigurationSuccess );
igstkDeclareInputMacro( ToolConfigurationFailure );
igstkDeclareInputMacro( AttachToolToVideoImager );
igstkDeclareInputMacro( ImagingStarted );
igstkDeclareInputMacro( ImagingStopped );
igstkDeclareInputMacro( VideoImagerToolNotAvailable );
igstkDeclareInputMacro( VideoImagerToolStreaming );
igstkDeclareInputMacro( DetachVideoImagerToolFromVideoImager );
igstkDeclareInputMacro( AttachmentToVideoImagerSuccess );
igstkDeclareInputMacro( AttachmentToVideoImagerFailure );
igstkDeclareInputMacro( DetachmentFromVideoImagerSuccess );
igstkDeclareInputMacro( DetachmentFromVideoImagerFailure );
igstkDeclareInputMacro( GetFrame );
/** States for the State Machine */
igstkDeclareStateMacro( Idle );
igstkDeclareStateMacro( AttemptingToConfigureVideoImagerTool );
igstkDeclareStateMacro( Configured );
igstkDeclareStateMacro( AttemptingToAttachVideoImagerToolToVideoImager );
igstkDeclareStateMacro( Attached );
igstkDeclareStateMacro( AttemptingToDetachVideoImagerToolFromVideoImager );
igstkDeclareStateMacro( NotAvailable );
igstkDeclareStateMacro( Streaming );
/** Attempt method to configure */
void AttemptToConfigureProcessing( void );
/** Attempt method to attach VideoImager tool to the VideoImager */
void AttemptToAttachVideoImagerToolToVideoImagerProcessing( void );
/** Post-processing after a successful VideoImager tool configuration */
void VideoImagerToolConfigurationSuccessProcessing( void );
/** Post-processing after a failed VideoImager tool configuration */
void VideoImagerToolConfigurationFailureProcessing( void );
/** Post-processing after a successful VideoImager tool to VideoImager
attachment attempt . */
void VideoImagerToolAttachmentToVideoImagerSuccessProcessing( void );
/** Post-processing after a failed attachment attempt . */
void VideoImagerToolAttachmentToVideoImagerFailureProcessing( void );
/** Attempt method to detach VideoImager tool from the VideoImager */
void AttemptToDetachVideoImagerToolFromVideoImagerProcessing( void );
/** Post-processing after a successful detachment of the VideoImager tool
* from the VideoImager. */
void VideoImagerToolDetachmentFromVideoImagerSuccessProcessing( void );
/** Post-processing after a failed detachment attempt. */
void VideoImagerToolDetachmentFromVideoImagerFailureProcessing( void );
/** Retrieve frame as an event. */
void GetFrameProcessing( void );
/** Report VideoImager tool is in streaming state. */
void ReportVideoImagerToolStreamingStateProcessing( void );
/** Report VideoImager tool not available state. */
void ReportVideoImagerToolNotAvailableProcessing( void );
/** Report imaging started */
void ReportImagingStartedProcessing( void );
/** Report imaging stopped */
void ReportImagingStoppedProcessing( void );
/** Report invalid request */
void ReportInvalidRequestProcessing( void );
/** Report invalid request to attach the VideoImager tool. */
void ReportInvalidRequestToAttachVideoImagerToolProcessing( void );
/** Report invalid request to detach the VideoImager tool. */
void ReportInvalidRequestToDetachVideoImagerToolProcessing( void );
/** No operation for state machine transition */
void NoProcessing( void );
/** Ring buffer for the tool */
void AddFrameToBuffer( igstk::Frame* frame);
/** Ring buffer with frames */
std::vector< igstk::Frame* > *m_FrameRingBuffer;
/** next frame will be stored at frameRingBuffer[m_Index] */
int m_Index;
unsigned int m_NumberOfFramesInBuffer;
unsigned int m_MaxBufferSize;
unsigned int m_Delay;
unsigned int m_FrameDimensions[3];
unsigned int m_PixelDepth;
/** Updated flag */
bool m_Updated;
/** Unique identifier of the VideoImager tool */
std::string m_VideoImagerToolIdentifier;
/** VideoImager to which the tool will be attached to */
VideoImager * m_VideoImagerToAttachTo;
/** Define the coordinate system interface */
igstkCoordinateSystemClassInterfaceMacro();
/** Helper coordinate system used point of reference
* for the calibration Transform. */
CoordinateSystem::Pointer m_CalibrationCoordinateSystem;
};
std::ostream& operator<<(std::ostream& os, const VideoImagerTool& o);
}
#endif //__igstk_VideoImagerTool_h_
|