[Insight-users] iterate through mesh

Luis Ibanez luis.ibanez at kitware.com
Sun Oct 17 06:10:40 EDT 2010


Hi Sara,


If you want to iterate through the points of a mesh,
you may want to look at the code in

Insight/
  Examples/
     DataRepresentation/
        Mesh/
            PointSet2.cxx


This examples is described in the ITK Software Guide

          http://www.itk.org/ItkSoftwareGuide.pdf

in Section 4.2.2. "Getting Access to Points"
in pdf-page 83.

Essentially:

  PointsIterator  pointIterator = points->Begin();
  PointsIterator pend = points->End();
  while( pointIterator != pend )
    {
    PointType p = pointIterator.Value();   // access the point
    std::cout << p << std::endl;           // print the point
    ++pointIterator;                       // advance to next point
    }





     Regards,


             Luis


-----------------------------------------------------------------
On Wed, Oct 13, 2010 at 5:45 PM, Sara Rolfe <smrolfe at u.washington.edu>wrote:

> Hello,
>
> I have a 3D mesh and I want to iterate through it's vertices.  Is there a
> easy and fast way to do this?  Like iterating through the cells?
>
> Thanks,
> Sara Rolfe
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101017/c0573531/attachment.htm>


More information about the Insight-users mailing list