]> Creatis software - cpPlugins.git/blob - lib/cpExtensions/Algorithms/SkeletonReader.h
e1a3064937d27f7a622171b2f29626a5b0650669
[cpPlugins.git] / lib / cpExtensions / Algorithms / SkeletonReader.h
1 // -------------------------------------------------------------------------
2 // @author Leonardo Florez-Valencia (florez-l@javeriana.edu.co)
3 // -------------------------------------------------------------------------
4
5 #ifndef __cpExtensions__Algorithms__SkeletonReader__h__
6 #define __cpExtensions__Algorithms__SkeletonReader__h__
7
8 #include <cpExtensions/Config.h>
9 #include <itkProcessObject.h>
10
11 // -------------------------------------------------------------------------
12 namespace cpExtensions
13 {
14   namespace Algorithms
15   {
16     /**
17      */
18     template< class _TSkeleton >
19     class SkeletonReader
20       : public itk::ProcessObject
21     {
22     public:
23       // Basic types
24       typedef SkeletonReader                  Self;
25       typedef itk::ProcessObject              Superclass;
26       typedef itk::SmartPointer< Self >       Pointer;
27       typedef itk::SmartPointer< const Self > ConstPointer;
28
29       typedef _TSkeleton TSkeleton;
30
31     public:
32       itkNewMacro( Self );
33       itkTypeMacro( SkeletonReader, itk::ImageSource );
34
35       itkGetConstMacro( FileName, std::string );
36       itkSetMacro( FileName, std::string );
37
38     public:
39       TSkeleton* GetOutput( );
40       TSkeleton* 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         ) cpExtensions_OVERRIDE;
51
52       virtual void Update( ) cpExtensions_OVERRIDE
53         { this->GenerateData( ); }
54
55     protected:
56       SkeletonReader( );
57       virtual ~SkeletonReader( );
58
59       virtual void GenerateData( ) cpExtensions_OVERRIDE;
60
61       // Do nothing
62       virtual void GenerateOutputInformation( ) cpExtensions_OVERRIDE
63         { }
64
65     private:
66       // Purposely not implemented
67       SkeletonReader( const Self& );
68       void operator=( const Self& );
69
70     protected:
71       std::string m_FileName;
72     };
73
74   } // ecapseman
75
76 } // ecapseman
77
78 // -------------------------------------------------------------------------
79 #ifndef ITK_MANUAL_INSTANTIATION
80 #  include <cpExtensions/Algorithms/SkeletonReader.hxx>
81 #endif // ITK_MANUAL_INSTANTIATION
82
83 #endif // __cpExtensions__Algorithms__SkeletonReader__h__
84
85 // eof - $RCSfile$