IGSTK
igstkFrame.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkFrame.h,v $
5  Language: C++
6  Date: $Date: 2011-01-18 21:40:16 $
7  Version: $Revision: 1.3 $
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 __igstkFrame_h
19 #define __igstkFrame_h
20 
21 #include "itkVector.h"
22 #include "itkVersor.h"
23 
24 #include "igstkTimeStamp.h"
25 #include "igstkMacros.h"
26 #include "itkStdStreamLogOutput.h"
27 
28 class vtkImageData;
29 
30 namespace igstk
31 {
32 
49 class Frame
50 {
51 public:
52 
53  friend class VideoImager;
54  friend class VideoImagerTool;
55 
57 
59 
60  igstkSetMacro( Width, unsigned int );
61  igstkGetMacro( Width, unsigned int );
62 
63  igstkSetMacro( Height, unsigned int );
64  igstkGetMacro( Height, unsigned int );
65 
66  igstkSetMacro( NumberOfChannels, unsigned int );
67  igstkGetMacro( NumberOfChannels, unsigned int );
68 
70  Frame();
71  Frame(unsigned int width, unsigned int height, unsigned int channels);
72  Frame( const Frame & t );
73  virtual ~Frame();
74 
75  void * GetImagePtr();
76 
85 
86 
95 
96  void SetTimeToExpiration( TimePeriodType millisecondsToExpiration );
97 
106  bool IsValidAtTime( TimePeriodType timeToTestInMilliseconds ) const;
107 
113  bool IsValidNow() const;
114 
116  void Print(std::ostream& os, itk::Indent indent) const;
117 
118 protected:
119 
120  void PrintHeader(std::ostream& os, itk::Indent indent) const;
121 
122  void PrintTrailer(std::ostream& itkNotUsed(os),
123  itk::Indent itkNotUsed(indent)) const;
124 
126  virtual void PrintSelf( std::ostream& os, itk::Indent indent ) const;
127 
128 private:
129 
130  void SetFrameDimensions( unsigned int, unsigned int, unsigned int);
131  void SetImagePtr( void*, TimePeriodType millisecondsToExpiration);
132 
133  std::vector< unsigned char >* m_Image;
134  TimeStamp m_TimeStamp;
135  void* m_ImagePtr;
136  unsigned int m_Width;
137  unsigned int m_Height;
138  unsigned int m_NumberOfChannels;
139 
140 };
141 
142 std::ostream& operator<<(std::ostream& os, const igstk::Frame& o);
143 }
144 
145 #endif
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print the object information in a stream.
TimeStamp provides periods of validity for data.
#define igstkGetMacro(name, type)
Get built-in type.
Definition: igstkMacros.h:105
bool IsValidAtTime(TimePeriodType timeToTestInMilliseconds) const
Returns the validity status of the frame at the time passed as argument.
void SetTimeToExpiration(TimePeriodType millisecondsToExpiration)
std::ostream & operator<<(std::ostream &os, const igstk::AffineTransform &o)
virtual ~Frame()
void Print(std::ostream &os, itk::Indent indent) const
Method for printing the member variables of this class to an ostream.
Frame()
Constructor and destructor.
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
void PrintTrailer(std::ostream &itkNotUsed(os), itk::Indent itkNotUsed(indent)) const
TimePeriodType GetExpirationTime() const
Returns the time at which the validity of this information expires.
Abstract superclass for concrete IGSTK VideoImagerTool classes.
#define igstkLoggerMacro()
Macro that defines all the standard elements related to the Logger.
Definition: igstkMacros.h:143
Abstract superclass for concrete IGSTK VideoImager classes.
bool IsValidNow() const
Returns the validity status of the frame when it is called.
TimeStamp::TimePeriodType TimePeriodType
Definition: igstkFrame.h:56
#define igstkSetMacro(name, type)
Set built-in type.
Definition: igstkMacros.h:93
void PrintHeader(std::ostream &os, itk::Indent indent) const
void * GetImagePtr()
Frame from an external input device.
Definition: igstkFrame.h:49
TimePeriodType GetStartTime() const
Returns the time at which the validity of this information starts.