X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FImage%2FAlgorithm.hxx;h=ed7342130ba2389b6c64bbbac1dfc3208259ae01;hb=026b2fe203089e1917ab78ebafb3131f147223f5;hp=9eb2640cd9a2b80025916692959cfb03226efe5a;hpb=ea46079b5aef76c1782648ed23e70ea944649635;p=FrontAlgorithms.git diff --git a/lib/fpa/Image/Algorithm.hxx b/lib/fpa/Image/Algorithm.hxx index 9eb2640..ed73421 100644 --- a/lib/fpa/Image/Algorithm.hxx +++ b/lib/fpa/Image/Algorithm.hxx @@ -4,6 +4,7 @@ // Send Piotr's code to Anna #include +#include // ------------------------------------------------------------------------- template< class _TInputImage, class _TOutputImage > @@ -11,11 +12,17 @@ fpa::Image::Algorithm< _TInputImage, _TOutputImage >:: Algorithm( ) : Superclass( ) { + typedef itk::ImageBase< _TInputImage::ImageDimension > _TImageBase; + typedef fpa::Image::Functors::SimpleNeighborhood< _TImageBase > _TNeigh; typedef itk::Image< TFrontId, _TInputImage::ImageDimension > _TMarks; + this->m_MarksIdx = this->GetNumberOfRequiredOutputs( ); this->itk::ProcessObject::SetNumberOfRequiredOutputs( this->m_MarksIdx + 1 ); typename _TMarks::Pointer marks = _TMarks::New( ); this->SetNthOutput( this->m_MarksIdx, marks ); + + typename _TNeigh::Pointer neigh = _TNeigh::New( ); + this->SetNeighborhoodFunction( neigh ); } // ------------------------------------------------------------------------- @@ -34,7 +41,9 @@ _BeforeGenerateData( ) this->AllocateOutputs( ); TNeighborhoodFunction* neighFunc = - dynamic_cast< TNeighborhoodFunction* >( this->GetNeighborhoodFunction( ) ); + dynamic_cast< TNeighborhoodFunction* >( + this->GetNeighborhoodFunction( ) + ); if( neighFunc == NULL ) itkExceptionMacro( << "NeighborhoodFunction not well defined." ); neighFunc->SetImage( this->GetInput( ) );