int
main(int, char *[])
{
auto randomImageSource = RandomImageSourceType::New();
ImageType::SizeValueType size[2];
size[0] = 10;
size[1] = 10;
randomImageSource->SetSize(size);
randomImageSource->Update();
const ImageType::Pointer image = randomImageSource->GetOutput();
auto ellipse = EllipseType::New();
ellipse->SetRadiusInObjectSpace(2);
ellipse->SetCenterInObjectSpace(offset);
ellipse->Update();
using CalculatorType =
auto 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;
}
Templated n-dimensional image class.
Generate an n-dimensional image of random pixel values.
constexpr TContainer MakeFilled(typename TContainer::const_reference value)