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 
88  typedef Superclass::SpatialObjectType SpatialObjectType;
89  typedef Superclass::GroupSpatialObjectType GroupSpatialObjectType;
90  typedef SpatialObjectType::ConstPointer SpatialObjectTypeConstPointer;
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
void ReportObjectProcessing()
This method will invoke the TubeModifiedEvent.
#define igstkFriendClassMacro(type)
Create a Macro for friend class.
Definition: igstkMacros.h:137
igstkLoadedObjectEventMacro(SpatialObjectModifiedEvent, IGSTKEvent, SpatialObject)
Event to be invoked when the state of the SpatialObject changes.
void ConnectTube()
Connect the ITK TubeSpatialObject to the output TubeSpatialObject.
This class reads spatial object data stored in files.
itk::TubeSpatialObject< 3 > TubeSpatialObjectType
Base class for all the IGSTK classes.
Definition: igstkObject.h:40
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
Definition: igstkMacros.h:275
static void ConnectTube(TReader *reader, TTubeSpatialObject *tubeSpatialObject)
void PrintSelf(std::ostream &os, itk::Indent indent) const
Print the object information in a stream.
defines standard system-wide macros, constants, and other common parameters in the IGSTK Library...
This class represents a Tube object.
::itk::SmartPointer< Self > Pointer
Definition: igstkObject.h:50
Superclass::SpatialObjectType SpatialObjectType
Macro with standard traits declarations.
This class is intended to make the connection between the TubeReader and its output, the TubeSpatialObject.
This class reads 3D Tube in the metaIO format.
SpatialObjectType::ConstPointer SpatialObjectTypeConstPointer
igstkEventMacro(ObjectReaderEvent, IGSTKEvent)
Superclass::GroupSpatialObjectType GroupSpatialObjectType
igstk::TubeObject TubeType
void AttemptReadObjectProcessing()
This method request Object read.