[Insight-users] Simplify a set of points in ITK

Dawood Masslawi masslawi at gmail.com
Fri Nov 26 17:02:01 EST 2010


Dear Marta,
You can store the generated random values in an array and for every new value check
the generated value against the existing values in the array, if you already have that value
you can reject the new generated value and continue this process till you have sufficient
number of values.
Best regards,
Dawood Masslawi



>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<


Hi!
thanks for the suggestions...
I tried that out, but its main problem are the repetitions, which I am not allowed to have. 
Marta

On 24 November 2010 17:57, Arnaud GELAS <arnaud_gelas at hms.harvard.edu> wrote:
Hi Marta,

If the underlying container of your pointset is a vector container (which is the default), you only need to generate a random sequence in between 0 and the number of points in your container.

You may have a look at vnl_random, here:
http://www.lems.brown.edu/vision/vxl_doc/html/core/vnl/html/classvnl__random.html

HTH,
Arnaud

On 11/24/2010 11:17 AM, Marta Peroni wrote:Hi!
I have a kind of "dummy" problem. I do need to select a subset of point cloud describing the contour of a structure (the points are previously derived with the ITK Review implementation of Marching Squares and therefore I do have *lots* of points). 
I found a very nice implementation of this in CGAL Random_Simplify_Points, but unfortunately I cannot include the whole library in my project. 
So here it comes the question: 
I did store my points (x,y,z) in a PointsContainer (as in PointSet2.cxx). Now in order for the algorithm to work, I need to randomly shuffle / randomly extract from the container (shuffle would be the best option). 
Is there something similar to itk::ImageRandomNonRepeatingIteratorWithIndex but for points containers?and/or a shuffle method?
thanks a lot
Marta
-- 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20101126/b7873c5e/attachment.htm>


More information about the Insight-users mailing list