IGSTK
igstkTubeReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Image Guided Surgery Software Toolkit
4  Module: $RCSfile: igstkTubeReader.h,v $
5  Language: C++
6  Date: $Date: 2008-05-05 20:41:09 $
7  Version: $Revision: 1.15 $
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 __igstkTubeReader_h
18 #define __igstkTubeReader_h
19 
20 #include "igstkMacros.h"
22 
23 #include "itkSpatialObjectReader.h"
24 #include "itkObject.h"
25 #include "itkEventObject.h"
26 
27 #include "igstkTubeObject.h"
28 #include "itkTubeSpatialObject.h"
29 
30 namespace igstk
31 {
32 
33 namespace Friends
34 {
35 
46 {
47 public:
48 
49  template < class TReader, class TTubeSpatialObject >
50  static void
51  ConnectTube( TReader * reader,
52  TTubeSpatialObject * tubeSpatialObject )
53  {
54  tubeSpatialObject->SetTubeSpatialObject(
55  reader->GetITKTubeSpatialObject());
56  }
57 
58 }; // end of TubeReaderToTubeSpatialObject class
59 
60 } // end of Friend namespace
61 
62 
78 {
79 
80 public:
81 
84 
85 public:
86 
90  typedef SpatialObjectType::ConstPointer SpatialObjectTypeConstPointer;
91  typedef igstk::TubeObject TubeType;
92  typedef itk::TubeSpatialObject<3> TubeSpatialObjectType;
93 
95  igstkEventMacro( TubeReaderEvent,ObjectReaderEvent )
96  igstkEventMacro( TubeReadingErrorEvent, ObjectReadingErrorEvent )
97  igstkLoadedObjectEventMacro( TubeModifiedEvent, TubeReaderEvent, TubeType )
98 
102  igstkFriendClassMacro( igstk::Friends::TubeReaderToTubeSpatialObject );
103 
104 protected:
105 
107  TubeReader();
108  ~TubeReader();
109 
111  void PrintSelf( std::ostream& os, itk::Indent indent ) const;
112 
116 
118  void ReportObjectProcessing();
119 
121  void ConnectTube();
122 
123 private:
124 
125  TubeReader(const Self&); //purposely not implemented
126  void operator=(const Self&); //purposely not implemented
127 
128  // FIXME : This must be replaced with StateMachine logic
129  virtual TubeSpatialObjectType * GetITKTubeSpatialObject() const;
130 
131  TubeType::Pointer m_Tube;
132  TubeSpatialObjectType::Pointer m_TubeSpatialObject;
133 };
134 
135 } // end namespace igstk
136 
137 
138 #endif // __igstkTubeReader_h