#include #include #include // ------------------------------------------------------------------------- const unsigned int Dim = 2; typedef unsigned char TPixel; typedef double TCost; typedef itk::Image< TPixel, Dim > TImage; typedef fpa::Image::Dijkstra< TImage, TCost > TFrontAlgorithm; // ------------------------------------------------------------------------- int main( int argc, char* argv[] ) { // Create a dummy image TImage::SizeType imageSize; imageSize.Fill( 100 ); TImage::SpacingType imageSpacing; imageSpacing.Fill( 1 ); TImage::Pointer image = TImage::New( ); image->SetRegions( imageSize ); image->SetSpacing( imageSpacing ); image->Allocate( ); image->FillBuffer( TPixel( 1 ) ); // Seed TImage::IndexType seed; seed.Fill( 50 ); // Configure algorithm TFrontAlgorithm::Pointer algorithm = TFrontAlgorithm::New( ); algorithm->AddSeed( seed, TCost( 0 ) ); algorithm->SetInput( image ); algorithm->SetNeighborhoodOrder( 1 ); algorithm->Update( ); return( 0 ); } // eof - $RCSfile$