[Insight-users] obtain pointset from STL file
tony hakki
tony2007vtk at yahoo.com
Wed Apr 11 12:42:57 EDT 2007
hello Luis;
I would like to tell you about my steps to obtain pointset from stl file.
1-I read my STL with VTK
2-I converted vtkpolydata to itk mesh
3-I tried to obtain pointset from itk mesh with the following code.
Is these steps true?my registration process gives very nonsense results ,therefore I thought that it is pointset's false. Would you like to add my registration code I can add it.
Thanks in advance
Tony
here is the code to obtain pointset from a itkmesh.
const unsigned int Dimension = 3;
typedef unsigned short PixelType;
typedef itk::PointSet< float, Dimension > FixedPointSetType;
typedef itk::Image< PixelType, Dimension > MovingImageType;
typedef FixedPointSetType::PointsContainer PointsContainer;
itk::PointSet<float, 3>::Pointer pointSet = itk::PointSet<float,3>::New();
pointSet->SetPoints(pointsContainer);
unsigned long pointId = 0;
typedef FMeshType::PointsContainer::Iterator PointsIterator;
PointsIterator pointIterator = input_mesh->GetPoints()->Begin();
PointsIterator end = input_mesh->GetPoints()->End();
while( pointIterator != end )
{
FMeshType::PointType p = pointIterator.Value(); // access the point
std::cout << p << std::endl; // print the point
pointSet->SetPoint( pointId, p );// advance to next point
pointSet->SetPointData( pointId, pointSet->GetBufferedRegion() );
++pointIterator;
++pointId;
}
____________________________________________________________________________________
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070411/bebf7abe/attachment.html
More information about the Insight-users
mailing list