static void CreateImage(UnsignedCharImageType::Pointer image);
int main(int, char *[])
{
UnsignedCharImageType::Pointer image = UnsignedCharImageType::New();
CreateImage(image);
AntiAliasBinaryImageFilterType;
AntiAliasBinaryImageFilterType::Pointer antiAliasFilter
= AntiAliasBinaryImageFilterType::New ();
antiAliasFilter->SetInput(image);
viewer.
AddImage<UnsignedCharImageType>(image);
viewer.
AddImage<FloatImageType>(antiAliasFilter->GetOutput());
return EXIT_SUCCESS;
}
void CreateImage(UnsignedCharImageType::Pointer image)
{
UnsignedCharImageType::IndexType start;
start.Fill(0);
UnsignedCharImageType::SizeType size;
size.Fill(200);
UnsignedCharImageType::RegionType region;
region.SetSize(size);
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
while(!imageIterator.IsAtEnd())
{
if(imageIterator.GetIndex()[0] - imageIterator.GetIndex()[1] > 5)
{
imageIterator.Set(255);
}
else
{
imageIterator.Set(0);
}
++imageIterator;
}
}