- typename I::RegionType reg = this->GetInput( )->GetRequestedRegion( );
-
- N.clear( );
- if( this->m_NeighborhoodOrder == 1 )
- {
- for( unsigned int d = 0; d < I::ImageDimension; d++ )
- {
- for( int i = -1; i <= 1; i += 2 )
- {
- TVertex v = n.Vertex;
- v[ d ] += i;
- if( reg.IsInside( v ) )
- N.push_back( _TNode( v, n.FrontId ) );
- else
- N.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( n.Vertex );
- for( unsigned int i = 0; i < nIt.Size( ); i++ )
- {
- TVertex idxN = nIt.GetIndex( i );
- if( idxN == n.Vertex )
- continue;
- if( !reg.IsInside( idxN ) )
- continue;
- N.push_back( _TNode( idxN, n.FrontId ) );
-
- } // rof
-
- } // fi
+ typedef itk::Image< TFrontId, _TInputImage::ImageDimension > _TMarks;
+ _TMarks* marks =
+ dynamic_cast< _TMarks* >(
+ this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ );
+ marks->SetPixel( n.Vertex, n.FrontId );