]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Config.h.in
e8503550d0ef7f7dc934036f84325e904814451d
[FrontAlgorithms.git] / lib / fpa / Config.h.in
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Config__h__
6 #define __fpa__Config__h__
7
8 #include <itkMacro.h>
9
10 // -------------------------------------------------------------------------
11 #define fpaTraitsMacro( __t__ )                                 \
12   typedef __t__::TInternalTraits::TInputValue   TInputValue;    \
13   typedef __t__::TInternalTraits::TNeighborhood TNeighborhood;  \
14   typedef __t__::TInternalTraits::TMark         TMark;          \
15   typedef __t__::TInternalTraits::TNode         TNode;          \
16   typedef __t__::TInternalTraits::TNodes        TNodes;         \
17   typedef __t__::TInternalTraits::TOutputValue  TOutputValue;   \
18   typedef __t__::TInternalTraits::TPoint        TPoint;         \
19   typedef __t__::TInternalTraits::TSeed         TSeed;          \
20   typedef __t__::TInternalTraits::TSeeds        TSeeds;         \
21   typedef __t__::TInternalTraits::TVertex       TVertex
22
23 // -------------------------------------------------------------------------
24 #define fpaFilterInputMacro( __n__, __t__ )                             \
25   private:                                                              \
26   unsigned int m_##__n__##Idx;                                          \
27   public:                                                               \
28   __t__* Get##__n__( )                                                  \
29   {                                                                     \
30     return(                                                             \
31       dynamic_cast< __t__* >(                                           \
32         this->itk::ProcessObject::GetInput(                             \
33           this->m_##__n__##Idx                                          \
34           ) ) );                                                        \
35   }                                                                     \
36   const __t__* Get##__n__( ) const                                      \
37   {                                                                     \
38     return(                                                             \
39       dynamic_cast< const __t__* >(                                     \
40         this->itk::ProcessObject::GetInput(                             \
41           this->m_##__n__##Idx                                          \
42           ) ) );                                                        \
43   }                                                                     \
44   void Set##__n__( __t__* i )                                           \
45   {                                                                     \
46     this->itk::ProcessObject::SetNthInput( this->m_##__n__##Idx, i );   \
47   }
48
49 // -------------------------------------------------------------------------
50 #define fpaFilterInputConfigureMacro( __n__, __t__ )            \
51   this->m_##__n__##Idx = this->GetNumberOfRequiredInputs( );    \
52   this->itk::ProcessObject::SetNumberOfRequiredInputs(          \
53     this->m_##__n__##Idx + 1                                    \
54     )
55
56 // -------------------------------------------------------------------------
57 #define fpaFilterOptionalInputConfigureMacro( __n__, __t__ )    \
58   this->m_##__n__##Idx = this->GetNumberOfIndexedInputs( );     \
59   this->itk::ProcessObject::SetNumberOfIndexedInputs(           \
60     this->m_##__n__##Idx + 1                                    \
61     )
62
63 // -------------------------------------------------------------------------
64 #define fpaFilterOutputMacro( __n__, __t__ )    \
65   private:                                      \
66   unsigned int m_##__n__##Idx;                  \
67   public:                                       \
68   __t__* Get##__n__( )                          \
69   {                                             \
70     return(                                     \
71       dynamic_cast< __t__* >(                   \
72         this->itk::ProcessObject::GetOutput(    \
73           this->m_##__n__##Idx                  \
74           ) ) );                                \
75   }                                             \
76   const __t__* Get##__n__( ) const              \
77   {                                             \
78     return(                                     \
79       dynamic_cast< const __t__* >(             \
80         this->itk::ProcessObject::GetOutput(    \
81           this->m_##__n__##Idx                  \
82           ) ) );                                \
83   }
84
85 // -------------------------------------------------------------------------
86 #define fpaFilterOutputConfigureMacro( __n__, __t__ )           \
87   this->m_##__n__##Idx = this->GetNumberOfRequiredOutputs( );   \
88   this->itk::ProcessObject::SetNumberOfRequiredOutputs(         \
89     this->m_##__n__##Idx + 1                                    \
90     );                                                          \
91   this->SetNthOutput( this->m_##__n__##Idx, __t__::New( ) )
92
93 #endif // __fpa__Config__h__
94 // eof - $RCSfile$