int main(int, char *[])
{
using PixelType = unsigned short;
PointSetType::Pointer pointSet = PointSetType::New();
unsigned int dataId = 0;
PixelType value = 79;
pointSet->SetPointData( dataId++, value );
const bool found = pointSet->GetPointData( dataId, & value );
if( found )
{
std::cout << "Pixel value = " << value << std::endl;
}
using PointDataContainer = PointSetType::PointDataContainer;
PointDataContainer::Pointer pointData = PointDataContainer::New();
unsigned int pointId = 0;
PixelType value0 = 34;
PixelType value1 = 67;
pointData->InsertElement( pointId++ , value0 );
pointData->InsertElement( pointId++ , value1 );
pointSet->SetPointData( pointData );
PointDataContainer::Pointer pointData2 = pointSet->GetPointData();
using PointDataIterator = PointDataContainer::Iterator;
PointDataIterator pointDataIterator = pointData2->Begin();
PointDataIterator end = pointData2->End();
while( pointDataIterator != end )
{
PixelType p = pointDataIterator.Value();
std::cout << p << std::endl;
++pointDataIterator;
}
return EXIT_SUCCESS;
}