- typename I::RegionType reg = this->GetInput( )->GetRequestedRegion( );
-
- neighborhood.clear( );
- if( this->m_NeighborhoodOrder == 1 )
- {
- for( unsigned int d = 0; d < I::ImageDimension; d++ )
- {
- for( int i = -1; i <= 1; i += 2 )
- {
- TVertex n = v;
- n[ d ] += i;
- if( reg.IsInside( n ) )
- neighborhood.push_back( n );
-
- } // rof
-
- } // rof
- }
- else
- {
- typedef itk::ConstNeighborhoodIterator< I > TNeighIt;
- typename I::SizeType nSize;
- nSize.Fill( 1 );
-
- TNeighIt nIt( nSize, this->GetInput( ), reg );
- nIt.SetLocation( v );
- for( unsigned int i = 0; i < nIt.Size( ); i++ )
- {
- TVertex n = nIt.GetIndex( i );
- if( n == v )
- continue;
- if( reg.IsInside( n ) )
- neighborhood.push_back( n );
-
- } // rof
-
- } // fi
+ typedef itk::Image< TFrontId, _TInputImage::ImageDimension > _TMarks;
+ const _TMarks* marks =
+ dynamic_cast< const _TMarks* >(
+ this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ );
+ return( marks->GetPixel( v ) != 0 );