int
main(int, char *[])
{
RandomImageSourceType::Pointer randomImageSource =
RandomImageSourceType::New();
size[0] = 10;
size[1] = 10;
randomImageSource->SetSize(size);
randomImageSource->Update();
ImageType::Pointer image = randomImageSource->GetOutput();
EllipseType::Pointer ellipse = EllipseType::New();
ellipse->SetRadiusInObjectSpace(2);
ellipse->SetCenterInObjectSpace(offset);
ellipse->Update();
using CalculatorType =
CalculatorType::Pointer calculator = CalculatorType::New();
calculator->SetImage(image);
calculator->SetSpatialObject(ellipse);
calculator->Update();
std::cout << "Sample mean = " << calculator->GetMean() << std::endl;
std::cout << "Sample covariance = " << calculator->GetCovarianceMatrix();
return EXIT_SUCCESS;
}