4 #include <fpa/Image/RegionGrow.h>
5 #include <fpa/Image/Functors/RegionGrowAllBelongsFunction.h>
7 // -------------------------------------------------------------------------
8 const unsigned int Dim = 2;
9 typedef unsigned char TPixel;
10 typedef itk::Image< TPixel, Dim > TImage;
12 typedef fpa::Image::RegionGrow< TImage > TFrontAlgorithm;
14 fpa::Image::Functors::RegionGrowAllBelongsFunction< TImage >
17 // -------------------------------------------------------------------------
18 int main( int argc, char* argv[] )
20 // Create a dummy image
21 TImage::SizeType imageSize;
24 TImage::SpacingType imageSpacing;
25 imageSpacing.Fill( 1 );
27 TImage::Pointer image = TImage::New( );
28 image->SetRegions( imageSize );
29 image->SetSpacing( imageSpacing );
31 image->FillBuffer( TPixel( 1 ) );
34 TImage::IndexType seed;
37 // Configure membership function
38 TMembershipFunction::Pointer membership = TMembershipFunction::New( );
40 // Configure algorithm
41 TFrontAlgorithm::Pointer algorithm = TFrontAlgorithm::New( );
42 algorithm->AddSeed( seed, 0 );
43 algorithm->SetInput( image );
44 algorithm->SetNeighborhoodOrder( 1 );
45 algorithm->SetMembershipFunction( membership );