int main( int argc, char * argv[] )
{
if( argc < 6 )
{
std::cerr << "Usage: " << std::endl;
std::cerr << argv[0] << " inputImageFile outputImageFile normalizedOutputImageFile ";
std::cerr << " derivativeOrder direction" << std::endl;
return EXIT_FAILURE;
}
typedef float InputPixelType;
typedef float OutputPixelType;
const unsigned int Dimension = 2;
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName( argv[1] );
writer->SetFileName( argv[2] );
InputImageType, OutputImageType > FilterType;
FilterType::Pointer filter = FilterType::New();
filter->SetOrder( atoi( argv[4] ) );
filter->SetDirection( atoi( argv[5] ) );
filter->SetInput( reader->GetOutput() );
writer->SetInput( filter->GetOutput() );
writer->Update();
OutputImageType,
WriteImageType > NormalizeFilterType;
NormalizeFilterType::Pointer normalizer = NormalizeFilterType::New();
NormalizedWriterType::Pointer normalizedWriter = NormalizedWriterType::New();
normalizer->SetInput( filter->GetOutput() );
normalizedWriter->SetInput( normalizer->GetOutput() );
normalizer->SetOutputMinimum( 0 );
normalizer->SetOutputMaximum( 255 );
normalizedWriter->SetFileName( argv[3] );
normalizedWriter->Update();
return EXIT_SUCCESS;
}