]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Common/Image/PathReader.h
...
[FrontAlgorithms.git] / lib / fpa / Common / Image / PathReader.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Common__Image__PathReader__h__
6 #define __fpa__Common__Image__PathReader__h__
7
8 #include <itkProcessObject.h>
9
10 namespace fpa
11 {
12   namespace Common
13   {
14     namespace Image
15     {
16       /**
17        */
18       template< class _TPath >
19       class PathReader
20         : public itk::ProcessObject
21       {
22       public:
23         // Basic types
24         typedef PathReader    Self;
25         typedef itk::ProcessObject              Superclass;
26         typedef itk::SmartPointer< Self >       Pointer;
27         typedef itk::SmartPointer< const Self > ConstPointer;
28
29         typedef _TPath TPath;
30
31       public:
32         itkNewMacro( Self );
33         itkTypeMacro( PathReader, itk::ProcessObject );
34
35         itkGetConstMacro( FileName, std::string );
36         itkSetMacro( FileName, std::string );
37
38       public:
39         TPath* GetOutput( );
40         TPath* GetOutput( unsigned int i );
41
42         virtual void GraftOutput( itk::DataObject* out );
43         virtual void GraftOutput(
44           const typename Superclass::DataObjectIdentifierType& key,
45           itk::DataObject* out
46           );
47         virtual void GraftNthOutput( unsigned int i, itk::DataObject* out );
48         virtual itk::DataObject::Pointer MakeOutput(
49           itk::ProcessObject::DataObjectPointerArraySizeType i
50           ) override;
51
52         virtual void Update( ) override
53           { this->GenerateData( ); }
54
55       protected:
56         PathReader( );
57         virtual ~PathReader( );
58
59         virtual void GenerateData( ) override;
60
61         // Do nothing
62         virtual void GenerateOutputInformation( ) override
63           { }
64
65       private:
66         // Purposely not implemented
67         PathReader( const Self& );
68         void operator=( const Self& );
69
70       protected:
71         std::string m_FileName;
72       };
73
74     } // ecapseman
75
76   } // ecapseman
77
78 } // ecapseman
79
80 #ifndef ITK_MANUAL_INSTANTIATION
81 #  include <fpa/Common/Image/PathReader.hxx>
82 #endif // ITK_MANUAL_INSTANTIATION
83 #endif // __fpa__Common__Image__PathReader__h__
84
85 // eof - $RCSfile$