int main( int , char * argv[] )
{
ReaderType::Pointer reader = ReaderType::New();
const char * filename = argv[1];
reader->SetFileName( filename );
reader->Update();
ImageType::Pointer image = reader->GetOutput();
ImageType::IndexType pixelIndex;
pixelIndex[0] = 25;
pixelIndex[1] = 35;
pixelIndex[2] = 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 0;
}