int main(int, char *[])
{
typedef unsigned short PixelType;
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;
}
typedef PointSetType::PointDataContainer 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();
typedef PointDataContainer::Iterator PointDataIterator;
PointDataIterator pointDataIterator = pointData2->Begin();
PointDataIterator end = pointData2->End();
while( pointDataIterator != end )
{
PixelType p = pointDataIterator.Value();
std::cout << p << std::endl;
++pointDataIterator;
}
return EXIT_SUCCESS;
}