fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
GetMarks( )
{
- dynamic_cast< TMarks* >(
- this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ return(
+ dynamic_cast< TMarks* >(
+ this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ )
);
}
fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
GetMarks( ) const
{
- dynamic_cast< const TMarks* >(
- this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ return(
+ dynamic_cast< const TMarks* >(
+ this->itk::ProcessObject::GetOutput( this->m_MarksIdx )
+ )
);
}
{
}
+// -------------------------------------------------------------------------
+template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
+typename
+fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
+TNodes fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
+_UnifySeeds( )
+{
+ const TInputImage* input = this->GetInput( );
+ typename TInputImage::RegionType region = input->GetRequestedRegion( );
+ TSeeds seeds = this->GetSeeds( );
+ TNodes nodes;
+
+ typename TSeeds::iterator sIt = seeds.begin( );
+ for( ; sIt != seeds.end( ); ++sIt )
+ {
+ TNode node;
+ if( sIt->IsPoint )
+ input->TransformPhysicalPointToIndex( sIt->Point, sIt->Vertex );
+ else
+ input->TransformIndexToPhysicalPoint( sIt->Vertex, sIt->Point );
+ if( region.IsInside( sIt->Vertex ) )
+ {
+ sIt->IsUnified = true;
+ node.Vertex = sIt->Vertex;
+ node.Parent = node.Vertex;
+ if( sIt->FrontId == 0 )
+ node.FrontId = nodes.size( ) + 1;
+ else
+ node.FrontId = sIt->FrontId;
+ nodes.insert( node );
+ }
+ else
+ sIt->IsUnified = false;
+
+ } // rof
+
+ return( nodes );
+}
+
// -------------------------------------------------------------------------
template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
void
template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
void
fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
-_UpdateOutputValue( const TNode& n )
+_UpdateOutputValue( TNode& n )
{
this->GetOutput( )->SetPixel( n.Vertex, n.Value );
}
// -------------------------------------------------------------------------
template< class _TInputImage, class _TOutputImage, class _TMarksInterface, class _TSeedsInterface >
-bool
+void
fpa::Image::Algorithm< _TInputImage, _TOutputImage, _TMarksInterface, _TSeedsInterface >::
_Mark( const TVertex& v, unsigned long frontId )
{
this->GetMarks( )->SetPixel( v, TFrontId( frontId ) );
- return( true );
}
#endif // __fpa__Image__Algorithm__hxx__