static void CreateImage(ImageType::Pointer image);
int main(int, char *[])
{
ImageType::Pointer image = ImageType::New();
CreateImage(image);
NormalizeToConstantImageFilterType::Pointer normalizeToConstantImageFilter = NormalizeToConstantImageFilterType::New();
normalizeToConstantImageFilter->SetInput(image);
normalizeToConstantImageFilter->SetConstant(1);
normalizeToConstantImageFilter->Update();
normalizeToConstantImageFilter->GetOutput()->GetLargestPossibleRegion());
while(!imageIterator.IsAtEnd())
{
std::cout << imageIterator.
Get() << std::endl;
++imageIterator;
}
return EXIT_SUCCESS;
}
static void CreateImage(ImageType::Pointer image)
{
ImageType::IndexType start;
start.Fill(0);
ImageType::SizeType size;
size.Fill(3);
ImageType::RegionType region(start,size);
image->SetRegions(region);
image->Allocate();
image->FillBuffer(1);
}