+// -------------------------------------------------------------------------
+template< class _TImage >
+void fpa::Image::Functors::SimpleNeighborhood< _TImage >::
+_1stCombination( ) const
+{
+ for( int d = 0; d < _TImage::ImageDimension; ++d )
+ {
+ typename TIndex::OffsetType off;
+ off.Fill( 0 );
+ for( int i = -1; i <= 1; i += 2 )
+ {
+ off[ d ] = i;
+ this->m_Offsets.push_back( off );
+
+ } // rof
+
+ } // rof
+}
+
+// -------------------------------------------------------------------------
+template< class _TImage >
+void fpa::Image::Functors::SimpleNeighborhood< _TImage >::
+_2ndCombination( ) const
+{
+ std::vector< std::vector< std::vector< int > > > M;
+ M.push_back( std::vector< std::vector< int > >( ) );
+
+ std::vector< int > base;
+ base.push_back( -1 );
+ base.push_back( 0 );
+ base.push_back( 1 );
+ int dim = _TImage::ImageDimension;
+
+ M.push_back( std::vector< std::vector< int > >( ) );
+ for( int j = 0; j < base.size( ); ++j )
+ M[ 1 ].push_back( std::vector< int >( 1, base[ j ] ) );
+
+ for( int i = 2; i <= dim; ++i )
+ {
+ M.push_back( std::vector< std::vector< int > >( ) );
+ for( int j = 0; j < base.size( ); ++j )
+ {
+ for( int k = 0; k < M[ i - 1 ].size( ); ++k )
+ {
+ M[ i ].push_back( std::vector< int >( 1, base[ j ] ) );
+ for( int l = 0; l < M[ i - 1 ][ k ].size( ); ++l )
+ M[ i ].back( ).push_back( M[ i - 1 ][ k ][ l ] );
+
+ } // rof
+
+ } // rof
+
+ } // rof
+
+ for( int i = 0; i < M[ dim ].size( ); ++i )
+ {
+ TOffset off;
+ for( int j = 0; j < M[ dim ][ i ].size( ); ++j )
+ off[ j ] = M[ dim ][ i ][ j ];
+ this->m_Offsets.push_back( off );
+
+ } // rof
+}
+