1 #include <itkFunctionBase.h>
3 #include <itkImageToImageFilter.h>
4 #include <fpa/Base/Algorithm.h>
5 #include <fpa/Base/SeedsInterface.h>
6 #include <fpa/Base/MarksInterface.h>
8 // -------------------------------------------------------------------------
19 template< class _TValue >
21 : public itk::FunctionBase< _TValue, bool >
24 typedef Tautology Self;
25 typedef itk::FunctionBase< _TValue, bool > Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
32 fpa::Base::Functors::RegionGrow::Tautology,
37 virtual bool Evaluate( const _TValue& input ) const override
50 // Purposely not implemented
51 Tautology( const Self& other );
52 Self& operator=( const Self& other );
63 // -------------------------------------------------------------------------
70 template< class _TAlgorithm >
80 // -------------------------------------------------------------------------
87 template< class _TInputImage >
96 // -------------------------------------------------------------------------
103 template< class _TInputImage, class _TOutputImage, class _TSeedsInterface, class _TMarksInterface >
105 : public fpa::Base::Algorithm< itk::ImageToImageFilter< _TInputImage, _TOutputImage >, _TSeedsInterface, _TMarksInterface >
113 // -------------------------------------------------------------------------
120 template< class _TInputImage, class _TOutputImage >
122 : public fpa::Base::RegionGrow< fpa::Image::Algorithm< _TInputImage, _TOutputImage, fpa::Base::SeedsInterface< typename _TInputImage::IndexType, typename _TInputImage::IndexType::LexicographicCompare >, fpa::Image::MarksInterface< _TInputImage > > >
130 // -------------------------------------------------------------------------
131 const unsigned int Dim = 2;
132 typedef short TInputPixel;
133 typedef unsigned char TOutputPixel;
134 typedef itk::Image< TInputPixel, Dim > TInputImage;
135 typedef itk::Image< TOutputPixel, Dim > TOutputImage;
137 // -------------------------------------------------------------------------
138 int main( int argc, char* argv[] )
140 TInputImage::IndexType seed;
143 typedef fpa::Base::Functors::RegionGrow::Tautology< TInputPixel > TPredicate;
144 TPredicate::Pointer tautology = TPredicate::New( );
146 typedef fpa::Image::RegionGrow< TInputImage, TOutputImage > TFilter;
147 TFilter::Pointer filter = TFilter::New( );
148 filter->SetInput( input_image );
149 filter->AddSeed( seed );
150 filter->SetPredicate( tautology );