1 // =========================================================================
2 // @author Leonardo Florez Valencia
3 // @email florez-l@javeriana.edu.co
4 // =========================================================================
5 #ifndef __fpa__Filters__SingleSeedInterface__hxx__
6 #define __fpa__Filters__SingleSeedInterface__hxx__
8 #include <itkImageBase.h>
10 // -------------------------------------------------------------------------
11 template< class _TTraits >
12 void fpa::Filters::SingleSeedInterface< _TTraits >::
13 SetSeed( const TPoint& s )
15 this->m_InputSeed.Point = s;
16 this->m_InputSeed.IsPoint = true;
17 if( this->m_Filter.IsNotNull( ) )
18 this->m_Filter->Modified( );
21 // -------------------------------------------------------------------------
22 template< class _TTraits >
23 void fpa::Filters::SingleSeedInterface< _TTraits >::
24 SetSeed( const TVertex& s )
26 this->m_InputSeed.Vertex = s;
27 this->m_InputSeed.IsPoint = false;
28 if( this->m_Filter.IsNotNull( ) )
29 this->m_Filter->Modified( );
32 // -------------------------------------------------------------------------
33 template< class _TTraits >
34 fpa::Filters::SingleSeedInterface< _TTraits >::
35 SingleSeedInterface( itk::ProcessObject* f )
40 // -------------------------------------------------------------------------
41 template< class _TTraits >
42 fpa::Filters::SingleSeedInterface< _TTraits >::
43 ~SingleSeedInterface( )
47 // -------------------------------------------------------------------------
48 template< class _TTraits >
49 void fpa::Filters::SingleSeedInterface< _TTraits >::
50 _PrepareSeeds( const itk::DataObject* reference )
52 // Input object is an image?
53 typedef itk::ImageBase< TTraits::Dimension > _TImageBase;
54 const _TImageBase* image =
55 dynamic_cast< const _TImageBase* >( reference );
58 this->m_UnifiedSeeds.clear( );
59 if( this->m_InputSeed.IsPoint )
60 image->TransformPhysicalPointToIndex(
61 this->m_InputSeed.Point, this->m_InputSeed.Vertex
64 node.Vertex = this->m_InputSeed.Vertex;
65 node.Parent = this->m_InputSeed.Vertex;
66 node.FrontId = this->m_InputSeed.FrontId;
67 this->m_UnifiedSeeds.insert( node );
72 #endif // __fpa__Filters__SingleSeedInterface__hxx__