static void CreateImage(FloatImageType::Pointer image);
int main(int, char *[])
{
FloatImageType::Pointer image = FloatImageType::New();
CreateImage(image);
AbsImageFilterType::Pointer absFilter
= AbsImageFilterType::New ();
absFilter->SetInput(image);
viewer.
AddImage<FloatImageType>(absFilter->GetOutput());
return EXIT_SUCCESS;
}
void CreateImage(FloatImageType::Pointer image)
{
start[0] = 0;
start[1] = 0;
size[0] = 200;
size[1] = 300;
region.SetIndex(start);
image->SetRegions(region);
image->Allocate();
while(!imageIterator.IsAtEnd())
{
imageIterator.Set(imageIterator.GetIndex()[0] - imageIterator.GetIndex()[1]);
++imageIterator;
}
}