[Insight-users] ITK list similar to vtkIdList?

David Doria daviddoria at gmail.com
Wed Jan 26 08:14:17 EST 2011


On Wed, Jan 26, 2011 at 1:38 AM, Sara Rolfe <smrolfe at u.washington.edu> wrote:
> Hello,
>
> I'd like to keep track of some image coordinates.  I'm looking for something
> that is similar to vtkIdList, where I don't need to know the number of
> points and would really like to use something like the InsertUniqueId
> function.  Is there anything like this?  The closest thing I've found is
> creating a point set and adding the points.
>
> Thanks,
> Sara

How about an std::set<itk::Index<2> > ? With this the insert() method
is ALWAYS "insert only if unique" and you lose the order of the
points. You could also use any of the other STL containers i.e.
std::vector<itk::Index<2> > if you want to allow duplicates and
maintain order.

David


More information about the Insight-users mailing list