int
main(int argc, char * argv[])
{
  
  if (argc < 4)
  {
    std::cerr << "Usage: " << std::endl;
    std::cerr << argv[0] << " inputImageFile  outputImageFile component"
              << std::endl;
    return EXIT_FAILURE;
  }
 
 
  
  using OutputPixelType = unsigned char;
  constexpr unsigned int Dimension = 2;
 
  
 
 
  
  using FilterType =
  
 
 
  
  auto filter = FilterType::New();
  filter->SetIndex(std::stoi(argv[3]));
  
 
 
  
  
  
  
  
  
  
  
  
  
 
  
  auto reader = ReaderType::New();
  auto writer = WriterType::New();
 
  filter->SetInput(reader->GetOutput());
  writer->SetInput(filter->GetOutput());
  
 
 
  
  
  
  const char * inputFilename = argv[1];
  const char * outputFilename = argv[2];
 
 
  
  reader->SetFileName(inputFilename);
  writer->SetFileName(outputFilename);
  
 
 
  
  
  
  
  
  
  
 
 
  
  try
  {
    writer->Update();
  }
  {
    std::cout << "ExceptionObject caught !" << std::endl;
    std::cout << err << std::endl;
    return EXIT_FAILURE;
  }
  
 
 
  return EXIT_SUCCESS;
}
Standard exception handling object.
 
Data source that reads image data from a single file.
 
Writes image data to a single file.
 
Templated n-dimensional image class.
 
Represent Red, Green and Blue components for color images.
 
Extracts the selected index of the vector that is the input pixel type.