IGSTK
igstkVideoFrameRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkVideoFrameRepresentation.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 #ifndef __igstkVideoFrameRepresentation_h
18 #define __igstkVideoFrameRepresentation_h
19 
22 
23 class vtkImageData;
24 class vtkImageActor;
25 class vtkLookupTable;
26 class vtkImageMapToColors;
27 
28 namespace igstk
29 {
30 
31 template < class TVideoFrameSpatialObject >
33 {
34 
35 public:
38 
39 
41  typedef itk::ReceptorMemberCommand < Self > LoadedObserverType;
42 
43  typedef TVideoFrameSpatialObject VideoFrameSpatialObjectType;
44  typedef typename VideoFrameSpatialObjectType::ConstPointer
46 
48  void RequestSetVideoFrameSpatialObject(const VideoFrameSpatialObjectType*
49  spatialObject);
50 
54  igstkObserverMacro( VTKImage, VTKImageModifiedEvent,
55  EventHelperType::VTKImagePointerType );
56 
58  void SetWindowLevel( double window, double level );
59 
60  void SaveScreenShot( const std::string & filename );
61 
63  Pointer Copy() const;
64 
65 protected:
67 
69 
71  void DeleteActors();
72 
73  bool VerifyTimeStamp( ) const;
74 
76  void CreateActors();
77 
78 private:
79 
81  VideoFrameSpatialObjectConstPointer m_VideoFrameSpatialObject;
82  VideoFrameSpatialObjectConstPointer m_VideoFrameSpatialObjectToAdd;
83 
85  vtkImageData *m_ImageData;
86  vtkImageActor *m_ImageActor;
87  vtkLookupTable *m_LookupTable;
88  vtkImageMapToColors *m_MapColors;
89 
90  double m_Level;
91  double m_Window;
92  double m_Shift;
93  double m_Scale;
94 
95  std::string m_ScreenShotFileName;
96 
98  virtual void UpdateRepresentationProcessing();
99 
101  void NoProcessing();
102 
105  void SetVideoFrameSpatialObjectProcessing();
106 
109  void SetImage( const vtkImageData * image );
110 
112  void ConnectVTKPipelineProcessing();
113 
115  typename VTKImageObserver::Pointer m_VTKImageObserver;
116 
118  igstkDeclareInputMacro( ValidVideoFrameSpatialObject );
119  igstkDeclareInputMacro( NullVideoFrameSpatialObject );
120  igstkDeclareInputMacro( EmptyVideoFrameSpatialObject );
121  igstkDeclareInputMacro( ConnectVTKPipeline );
122 
124  igstkDeclareStateMacro( NullVideoFrameSpatialObject );
125  igstkDeclareStateMacro( ValidVideoFrameSpatialObject );
126 };
127 
128 } // end namespace igstk
129 
130 #ifndef IGSTK_MANUAL_INSTANTIATION
131 #include "igstkVideoFrameRepresentation.txx"
132 #endif
133 
134 #endif // __igstkVideoFrameRepresentation_h
void DeleteActors()
Overloaded function to delete actors.
igstkObserverMacro(VTKImage, VTKImageModifiedEvent, EventHelperType::VTKImagePointerType)
Observer macro that will received a event with an image as payload and will store it internally...
void CreateActors()
Create the VTK actors for displaying geometry.
#define igstkStandardTemplatedClassTraitsMacro(classname, superclassname)
Convenience macro for the traits of a templated class.
Definition: igstkMacros.h:286
void SetWindowLevel(double window, double level)
Set the Window Level for the representation.
void SaveScreenShot(const std::string &filename)
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
igstkStandardTemplatedClassTraitsMacro(VideoFrameRepresentation, ObjectRepresentation) typedef itk typedef TVideoFrameSpatialObject VideoFrameSpatialObjectType
Observer type for loaded event, the callback can be set to a member function.
Pointer Copy() const
Return a copy of the current object representation.
VideoFrameSpatialObjectType::ConstPointer VideoFrameSpatialObjectConstPointer
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
bool VerifyTimeStamp() const
Verify the time stamp.
void RequestSetVideoFrameSpatialObject(const VideoFrameSpatialObjectType *spatialObject)
Connect this representation class to the spatial object.
::itk::SmartPointer< const Self > ConstPointer
Definition: igstkObject.h:51
An abstract base class for all the igstk representation objects.
vtkImageData * VTKImagePointerType
Definition: igstkEvents.h:61