int
main(int, char *[])
{
PointSetType::PixelType pixel;
unsigned int pointId = 0;
constexpr double radius = 3.0;
for (unsigned int i = 0; i < 360; ++i)
{
point[0] = radius * std::sin(angle);
point[1] = radius * std::cos(angle);
pixel.SetRed(
point[0] * 2.0);
pixel.SetGreen(
point[1] * 2.0);
pixel.SetBlue(
point[2] * 2.0);
pointSet->SetPoint(pointId,
point);
pointSet->SetPointData(pointId, pixel);
pointId++;
}
using PointIterator = PointSetType::PointsContainer::ConstIterator;
PointIterator pointIterator = pointSet->GetPoints()->Begin();
const PointIterator pointEnd = pointSet->GetPoints()->End();
while (pointIterator != pointEnd)
{
point = pointIterator.Value();
std::cout <<
point << std::endl;
++pointIterator;
}
using PointDataIterator = PointSetType::PointDataContainer::ConstIterator;
PointDataIterator pixelIterator = pointSet->GetPointData()->Begin();
const PointDataIterator pixelEnd = pointSet->GetPointData()->End();
while (pixelIterator != pixelEnd)
{
pixel = pixelIterator.Value();
std::cout << pixel << std::endl;
++pixelIterator;
}
return EXIT_SUCCESS;
}
A superclass of the N-dimensional mesh structure; supports point (geometric coordinate and attribute)...
Represent Red, Green and Blue components for color images.
ImageBaseType::PointType PointType
static constexpr double pi
*par Constraints *The filter image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents