]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Mori.h
...
[FrontAlgorithms.git] / lib / fpa / Image / Mori.h
1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5
6 #ifndef __fpa__Image__Mori__h__
7 #define __fpa__Image__Mori__h__
8
9 #include <fpa/Base/Mori.h>
10 #include <fpa/Base/MarksInterface.h>
11 #include <fpa/Base/SingleSeedInterface.h>
12 #include <fpa/Image/Algorithm.h>
13 #include <fpa/Image/DefaultTraits.h>
14
15 namespace fpa
16 {
17   namespace Image
18   {
19     /**
20      */
21     template< class _TInputImage, class _TOutputImage >
22     class MoriTraits
23       : public fpa::Image::DefaultTraits< _TInputImage, _TOutputImage, typename _TOutputImage::PixelType >
24     {
25     public:
26       typedef MoriTraits    Self;
27       typedef _TInputImage  TInputImage;
28       typedef _TOutputImage TOutputImage;
29       typedef typename TOutputImage::PixelType TFrontId;
30       typedef fpa::Image::DefaultTraits< TInputImage, TOutputImage, TFrontId > Superclass;
31
32       typedef typename Superclass::TVertex       TVertex;
33       typedef typename Superclass::TInputValue   TInputValue;
34       typedef typename Superclass::TPoint        TPoint;
35       typedef typename Superclass::TOutputValue  TOutputValue;
36       typedef typename Superclass::TCompare      TCompare;
37       typedef typename Superclass::TNeighborhood TNeighborhood;
38       typedef typename Superclass::TFilter       TFilter;
39
40       typedef fpa::Base::SingleSeedInterface< TVertex, TPoint, TInputValue, TOutputValue, TFrontId, TCompare > TSeedsInterface;
41       typedef fpa::Base::MarksInterface< TVertex > TMarksInterface;
42
43       typedef typename TSeedsInterface::TNode  TNode;
44       typedef typename TSeedsInterface::TNodes TNodes;
45       typedef typename TSeedsInterface::TSeed  TSeed;
46       typedef typename TSeedsInterface::TSeeds TSeeds;
47
48     private:
49       // Purposely not implemented.
50       MoriTraits( );
51       MoriTraits( const Self& other );
52       virtual ~MoriTraits( );
53       Self& operator=( const Self& other );
54     };
55
56     /**
57      */
58     template< class _TInputImage, class _TOutputImage >
59     class Mori
60       : public fpa::Base::Mori< fpa::Image::Algorithm< fpa::Image::MoriTraits< _TInputImage, _TOutputImage > > >
61     {
62     public:
63       typedef _TInputImage  TInputImage;
64       typedef _TOutputImage TOutputImage;
65       typedef fpa::Image::MoriTraits< TInputImage, TOutputImage > TTraits;
66       typedef fpa::Image::Algorithm< TTraits >                 TAlgorithm;
67
68       typedef Mori                            Self;
69       typedef fpa::Base::Mori< TAlgorithm >   Superclass;
70       typedef itk::SmartPointer< Self >       Pointer;
71       typedef itk::SmartPointer< const Self > ConstPointer;
72
73       typedef typename TAlgorithm::TMarks TMarks;
74
75     public:
76       itkNewMacro( Self );
77       itkTypeMacro( fpa::Image::Mori, fpa::Base::Mori );
78
79     public:
80       TOutputImage* GetThresholdedOutput( );
81       const TOutputImage* GetThresholdedOutput( ) const;
82
83     protected:
84       Mori( );
85       virtual ~Mori( );
86
87       virtual void _AfterGenerateData( ) override;
88
89     private:
90       // Purposely not implemented.
91       Mori( const Self& other );
92       Self& operator=( const Self& other );
93
94     protected:
95       unsigned long m_ThresholdedOutputIdx;
96     };
97
98   } // ecapseman
99
100 } // ecapseman
101
102 #ifndef ITK_MANUAL_INSTANTIATION
103 #  include <fpa/Image/Mori.hxx>
104 #endif // ITK_MANUAL_INSTANTIATION
105
106 #endif // __fpa__Image__Mori__h__
107
108 // eof - $RCSfile$