82 int main(
int argc,
char *argv[])
86 std::cerr <<
"Usage: " << std::endl;
87 std::cerr <<
"ImageAdaptor1 inputFileName" << std::endl;
101 typedef unsigned char InputPixelType;
102 const unsigned int Dimension = 2;
106 ImageAdaptorType::Pointer adaptor = ImageAdaptorType::New();
118 ReaderType::Pointer reader = ReaderType::New();
121 reader->SetFileName(argv[1]);
132 adaptor->SetImage(reader->GetOutput());
145 IteratorType it(adaptor, adaptor->GetBufferedRegion());
149 while (!it.IsAtEnd())
151 float value = it.Get();
157 std::cout <<
"Sum of pixels is: " << sum << std::endl;