#include "itkPointSet.h"
//创建一个点集
int
main(int, char* [])
{
//1.
using PixelType = float;//像素类型为float
constexpr unsigned int Dimension = 3;//三维
using PointSetType = itk::PointSet<PixelType,Dimension>;
//创建PointSet对象,分配一个智能指针
PointSetType::Pointer PointSet = PointSetType::New();
//2.
//using PointSetType = itk::PointSet<float, 3>;
//PointSetType::Pointer PointSet = PointSetType::New();
using PointsContainerPointer = PointSetType::PointsContainerPointer;
//创建一个PointSet对象,分配一个智能指针
PointsContainerPointer points = PointSet->GetPoints();
//创建点
using PointType = PointSetType::PointType;
PointType p0, p1, p2;
p0[0] = 0.0;
p0[1] = 0.0;
p0[2] = 0.0;
p1[0] = 0.1;
p1[1] = 0.0;
p1[2] = 0.0;
p2[0] = 0.0;
p2[1] = 0.1;
p2[2] = 0.0;
points->InsertElement(0, p0);
points->InsertElement(1, p1);
points->InsertElement(2, p2);
return EXIT_SUCCESS;
}