int main( int , char * argv[] )
{
ReaderType::Pointer reader = ReaderType::New();
const char * const filename = argv[1];
reader->SetFileName( filename );
reader->Update();
ImageType::Pointer image = reader->GetOutput();
const ImageType::IndexType pixelIndex = {{25,35,0}};
PixelType onePixel = image->GetPixel( pixelIndex );
PixelType::ValueType red = onePixel.GetRed();
PixelType::ValueType green = onePixel.GetGreen();
PixelType::ValueType blue = onePixel.GetBlue();
std::cout << "Pixel values from GetRed,GetGreen,GetBlue:" << std::endl;
std::cout << "Red = "
<< std::endl;
std::cout << "Green = "
<< std::endl;
std::cout << "Blue = "
<< std::endl;
red = onePixel[0];
green = onePixel[1];
blue = onePixel[2];
std::cout << "Pixel values:" << std::endl;
std::cout << "Red = "
<< std::endl;
std::cout << "Green = "
<< std::endl;
std::cout << "Blue = "
<< std::endl;
return EXIT_SUCCESS;
}