]> Creatis software - FrontAlgorithms.git/blob - lib/fpa/Image/Functors/SimpleNeighborhood.hxx
...
[FrontAlgorithms.git] / lib / fpa / Image / Functors / SimpleNeighborhood.hxx
1 #ifndef __fpa__Image__Functors__SimpleNeighborhood__hxx__
2 #define __fpa__Image__Functors__SimpleNeighborhood__hxx__
3
4 // -------------------------------------------------------------------------
5 template< class _TImage >
6 typename fpa::Image::Functors::SimpleNeighborhood< _TImage >::
7 TOutput fpa::Image::Functors::SimpleNeighborhood< _TImage >::
8 Evaluate( const TIndex& center ) const
9 {
10   TOutput res;
11   typename _TImage::RegionType reg = this->m_Image->GetRequestedRegion( );
12   if( this->m_Order == 1 )
13   {
14     for( unsigned int d = 0; d < _TImage::ImageDimension; ++d )
15     {
16       for( int o = -1; o <= 1; o += 2 )
17       {
18         TIndex idx = center;
19         idx[ d ] += o;
20         if( reg.IsInside( idx ) )
21           res.push_back( idx );
22
23       } // rof
24
25     } // rof
26   }
27   else
28   {
29     // TODO!!!
30
31   } // fi
32   return( res );
33 }
34
35 // -------------------------------------------------------------------------
36 template< class _TImage >
37 fpa::Image::Functors::SimpleNeighborhood< _TImage >::
38 SimpleNeighborhood( )
39   : Superclass( ),
40     m_Order( 1 )
41 {
42 }
43
44 // -------------------------------------------------------------------------
45 template< class _TImage >
46  fpa::Image::Functors::SimpleNeighborhood< _TImage >::
47 ~SimpleNeighborhood( )
48 {
49 }
50
51 #endif // __fpa__Image__Functors__SimpleNeighborhood__hxx__
52
53 // eof - $RCSfile$