#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
int main( int argc, char *argv[])
{
if( argc < 7 )
{
std::cerr << "Missing Parameters " << std::endl;
std::cerr << "Usage: " << argv[0];
std::cerr << " inputImage outputImage lowerThreshold upperThreshold "
"seedX seedY [seed2X seed2Y ... ]" << std::endl;
return 1;
}
typedef float InternalPixelType;
{
std::cerr << "Input image is not a " << Dimension << " dimensional image as expected!" << std::endl;
return 1;
}
InternalImageType::Pointer itkImage =
dynamic_cast <InternalImageType*>( image.
GetITKBase() );
if ( itkImage.IsNull() )
{
std::cerr << "Unexpected error converting SimpleITK image to ITK image!" << std::endl;
return 1;
}
BlurFilterType;
BlurFilterType::Pointer blurFilter = BlurFilterType::New();
blurFilter->SetInput( itkImage );
blurFilter->SetNumberOfIterations( 5 );
blurFilter->SetTimeStep( 0.125 );
blurFilter->Update();
segmentationFilter.
SetLower( atof( argv[3] ) );
segmentationFilter.SetUpper( atof( argv[4] ) );
segmentationFilter.SetReplaceValue( 255 );
for (int i = 5; i+1 < argc; i+=2)
{
std::vector<unsigned int> seed;
seed.push_back(atoi(argv[i]));
seed.push_back(atoi(argv[i+1]));
segmentationFilter.AddSeed(seed);
std::cout << "Adding a seed at ";
for( unsigned int j = 0; j < seed.size(); ++i )
{
std::cout << seed[j] << " ";
}
std::cout << std::endl;
}
sitk::Image outImage = segmentationFilter.Execute(blurredImage);
return 0;
}