static void
CreateImage(ImageType::Pointer image);
int
main(int , char * [])
{
ImageType::Pointer image = ImageType::New();
CreateImage(image);
FunctionType::Pointer function = FunctionType::New();
function->SetInputImage(image);
function->ThresholdAbove(100);
seed[0] = 25;
seed[1] = 25;
std::vector<itk::Index<2>> seeds;
seeds.push_back(seed);
IteratorType it(image, function, seeds);
it.GoToBegin();
while (!it.IsAtEnd())
{
std::cout << it.GetIndex() << std::endl;
++it;
}
return EXIT_SUCCESS;
}
void
CreateImage(ImageType::Pointer image)
{
image->SetRegions(region);
image->Allocate();
image->FillBuffer(0);
for (unsigned int i = 20; i < 50; ++i)
{
image->SetPixel(pixelIndex, 255);
}
}