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