<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">Dear Marta,</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">You can store the generated random values in an array and for every new value check</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">the generated value against the existing
 values in the array, if you already have that value</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">you can reject the new generated value and continue this process till you have&nbsp;sufficient</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">number of&nbsp;values.</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">Best
 regards,</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">Dawood Masslawi</span></div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px;
 ">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; ">&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;</span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial,
 helvetica, clean, sans-serif; line-height: 15px; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, clean, sans-serif; line-height: 15px; "><br></span></div>Hi!<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">thanks for the suggestions...<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I tried that out, but its main problem are the repetitions, which I am not allowed to have.&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Marta<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><div class="yiv1350167228gmail_quote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;
 padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">On 24 November 2010 17:57, Arnaud GELAS&nbsp;<span dir="ltr" style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">&lt;<a rel="nofollow" ymailto="mailto:arnaud_gelas@hms.harvard.edu" target="_blank" href="http://us.mc523.mail.yahoo.com/mc/compose?to=arnaud_gelas@hms.harvard.edu" style="line-height: 1.2em; text-decoration: underline; color: rgb(0, 51, 153); outline-style: none; outline-width: initial; outline-color: initial; ">arnaud_gelas@hms.harvard.edu</a>&gt;</span>&nbsp;wrote:<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><blockquote class="yiv1350167228gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-top: 0px; padding-right: 0px;
 padding-bottom: 0px; padding-left: 1ex; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; display: block; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Hi Marta,<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">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.<br style="line-height: 1.2em; outline-style: none; outline-width:
 initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">You may have a look at vnl_random, here:<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><a rel="nofollow" target="_blank" href="http://www.lems.brown.edu/vision/vxl_doc/html/core/vnl/html/classvnl__random.html" style="line-height: 1.2em; text-decoration: underline; color: rgb(0, 51, 153); outline-style: none; outline-width: initial; outline-color: initial; ">http://www.lems.brown.edu/vision/vxl_doc/html/core/vnl/html/classvnl__random.html</a><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">HTH,<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><font
 color="#888888" style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Arnaud</font><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "></div><div class="yiv1350167228h5" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style:
 none; outline-width: initial; outline-color: initial; "><br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">On 11/24/2010 11:17 AM, Marta Peroni wrote:<blockquote type="cite" style="margin-top: 1em; margin-right: 40px; margin-bottom: 1em; margin-left: 40px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; display: block; ">Hi!<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">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).&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">I found a
 very nice implementation of this in CGAL Random_Simplify_Points, but unfortunately I cannot include the whole library in my project.&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">So here it comes the question:&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">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).&nbsp;<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Is there something similar to itk::ImageRandomNonRepeatingIteratorWithIndex but for points containers?and/or a shuffle method?<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">thanks a lot<br style="line-height:
 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">Marta<br style="line-height: 1.2em; outline-style: none; outline-width: initial; outline-color: initial; ">--&nbsp;</blockquote></div></div></div></blockquote></div></span></td></tr></table><br>