4 #include <fpa/Image/Dijkstra.h>
6 // -------------------------------------------------------------------------
7 const unsigned int Dim = 2;
8 typedef unsigned char TPixel;
10 typedef itk::Image< TPixel, Dim > TImage;
12 typedef fpa::Image::Dijkstra< TImage, TCost > TFrontAlgorithm;
14 // -------------------------------------------------------------------------
15 int main( int argc, char* argv[] )
17 // Create a dummy image
18 TImage::SizeType imageSize;
19 imageSize.Fill( 100 );
21 TImage::SpacingType imageSpacing;
22 imageSpacing.Fill( 1 );
24 TImage::Pointer image = TImage::New( );
25 image->SetRegions( imageSize );
26 image->SetSpacing( imageSpacing );
28 image->FillBuffer( TPixel( 1 ) );
31 TImage::IndexType seed;
34 // Configure algorithm
35 TFrontAlgorithm::Pointer algorithm = TFrontAlgorithm::New( );
36 algorithm->AddSeed( seed, TCost( 0 ) );
37 algorithm->SetInput( image );
38 algorithm->SetNeighborhoodOrder( 1 );