X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FFilters%2FSingleSeedInterface.hxx;h=25acc2b5d5a949c609830fc340c936aff0420ffb;hb=34f4ff5d31c70f1127d43865c61e9f57a7071190;hp=c82b6b45aee863f741100c45353797359b0fa94e;hpb=e977d1bb57ca61759a1fb1a1d0d8937718ef8722;p=FrontAlgorithms.git diff --git a/lib/fpa/Filters/SingleSeedInterface.hxx b/lib/fpa/Filters/SingleSeedInterface.hxx index c82b6b4..25acc2b 100644 --- a/lib/fpa/Filters/SingleSeedInterface.hxx +++ b/lib/fpa/Filters/SingleSeedInterface.hxx @@ -5,20 +5,7 @@ #ifndef __fpa__Filters__SingleSeedInterface__hxx__ #define __fpa__Filters__SingleSeedInterface__hxx__ -// ------------------------------------------------------------------------- -template< class _TTraits > -fpa::Filters::SingleSeedInterface< _TTraits >:: -SingleSeedInterface( itk::ProcessObject* f ) - : m_Filter( f ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TTraits > -fpa::Filters::SingleSeedInterface< _TTraits >:: -~SingleSeedInterface( ) -{ -} +#include // ------------------------------------------------------------------------- template< class _TTraits > @@ -44,32 +31,40 @@ SetSeed( const TVertex& s ) // ------------------------------------------------------------------------- template< class _TTraits > -const typename fpa::Filters::SingleSeedInterface< _TTraits >:: -TNodes& fpa::Filters::SingleSeedInterface< _TTraits >:: -GetSeeds( ) const +fpa::Filters::SingleSeedInterface< _TTraits >:: +SingleSeedInterface( itk::ProcessObject* f ) + : Superclass( f ) +{ +} + +// ------------------------------------------------------------------------- +template< class _TTraits > +fpa::Filters::SingleSeedInterface< _TTraits >:: +~SingleSeedInterface( ) { - return( this->m_UnifiedSeed ); } // ------------------------------------------------------------------------- template< class _TTraits > void fpa::Filters::SingleSeedInterface< _TTraits >:: -_PrepareSeeds( const itk::DataObject* input ) +_PrepareSeeds( const itk::DataObject* reference ) { // Input object is an image? - typedef itk::ImageBase< Self::Dimension > _TImageBase; - const _TImageBase* image = dynamic_cast< const _TImageBase* >( input ); + typedef itk::ImageBase< TTraits::Dimension > _TImageBase; + const _TImageBase* image = + dynamic_cast< const _TImageBase* >( reference ); if( image != NULL ) { - this->m_UnifiedSeed.clear( ); - TSeed iSeed = this->m_InputSeed; - if( iSeed.IsPoint ) - image->TransformPhysicalPointToIndex( iSeed.Point, iSeed.Vertex ); + this->m_UnifiedSeeds.clear( ); + if( this->m_InputSeed.IsPoint ) + image->TransformPhysicalPointToIndex( + this->m_InputSeed.Point, this->m_InputSeed.Vertex + ); TNode node; - node.Vertex = iSeed.Vertex; - node.Parent = iSeed.Vertex; - node.FrontId = iSeed.FrontId; - this->m_UnifiedSeed.insert( node ); + node.Vertex = this->m_InputSeed.Vertex; + node.Parent = this->m_InputSeed.Vertex; + node.FrontId = this->m_InputSeed.FrontId; + this->m_UnifiedSeeds.insert( node ); } // fi }