int main( int argc, char *argv[] )
{
typedef unsigned char PixelType;
const unsigned int Dimension = 2;
LineType, ImageType > SpatialObjectToImageFilterType;
std::vector<LineType::LinePointType> points;
for(unsigned int i = 0; i < 20; i++)
{
LineType::LinePointType point;
point.SetPosition(10,i);
LineType::LinePointType::VectorType normal;
normal[0] = 0;
normal[1] = 1;
point.SetNormal(normal,0);
points.push_back(point);
}
LineType::Pointer line = LineType::New();
line->SetPoints(points);
SpatialObjectToImageFilterType::Pointer imageFilter =
SpatialObjectToImageFilterType::New();
imageFilter->SetInsideValue(255);
imageFilter->SetSize(size);
imageFilter->SetInput(line);
imageFilter->Update();
WriterType::Pointer writer = WriterType::New();
writer->SetFileName("line.png");
writer->SetInput( imageFilter->GetOutput() );
writer->Update();
return EXIT_SUCCESS;
}