+ const TInputImage* in = this->GetInput( );
+
+ TOutputImage* out = this->GetOutput( );
+ out->SetLargestPossibleRegion( in->GetLargestPossibleRegion( ) );
+ out->SetRequestedRegion( in->GetRequestedRegion( ) );
+ out->SetBufferedRegion( in->GetBufferedRegion( ) );
+ out->SetSpacing( in->GetSpacing( ) );
+ out->SetOrigin( in->GetOrigin( ) );
+ out->SetDirection( in->GetDirection( ) );
+ out->Allocate( );
+ out->FillBuffer( v );
+
+ TMarks* marks = this->GetMarks( );
+ marks->SetLargestPossibleRegion( in->GetLargestPossibleRegion( ) );
+ marks->SetRequestedRegion( in->GetRequestedRegion( ) );
+ marks->SetBufferedRegion( in->GetBufferedRegion( ) );
+ marks->SetSpacing( in->GetSpacing( ) );
+ marks->SetOrigin( in->GetOrigin( ) );
+ marks->SetDirection( in->GetDirection( ) );
+ marks->Allocate( );
+ marks->FillBuffer( TFrontId( 0 ) );
+}
+
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
+typename
+fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
+TNeighborhood fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
+_GetNeighbors( const TVertex& v ) const
+{
+ typename TInputImage::RegionType region =
+ this->GetInput( )->GetRequestedRegion( );
+ TNeighborhood neighborhood;
+ if( this->m_NeigborhoodOrder != 1 )
+ {
+ // TODO
+ }
+ else
+ {
+ for( unsigned int d = 0; d < TInputImage::ImageDimension; ++d )
+ {
+ for( int s = -1; s <= 1; s += 2 )
+ {
+ TVertex n = v;
+ n[ d ] += s;
+ if( region.IsInside( n ) )
+ neighborhood.push_back( n );
+
+ } // rof
+
+ } // rof
+
+ } // fi
+ return( neighborhood );