[Insight-users] Choosing points randomly from a mask

Bill Lorensen bill.lorensen at gmail.com
Mon May 20 16:36:17 EDT 2013


Check out the itk random iterators:
itkImageRandomNonRepeatingIteratorWithIndex
itkImageRandomIteratorWithIndex

there are some wiki examples here:
http://itk.org/Wiki/ITK/Examples/Iterators/ImageRandomConstIteratorWithIndex
http://itk.org/Wiki/ITK/Examples/Iterators/ImageRandomNonRepeatingConstIteratorWithIndex

You can set the region of the iterator to the bounding box and then check
for inside/outside in the spatial object.



On Mon, May 20, 2013 at 4:19 PM, Luke Bloy <luke.bloy at gmail.com> wrote:

> Hi All,****
>
> ** **
>
> I am interested in randomly choosing locations from within a mask.
> Currently my mask is stored as a SpatialObject but I could change this if
> needed. My current plan is to ****
>
> ** **
>
> **1)      **Get the bounding box of the spatial object.****
>
> **2)      **Call vnl_sample_uniform for x,y and z****
>
> **3)      **Repeat 2 until the point is inside the spatial Object****
>
> ** **
>
> Does anyone have any better ideas on how to go about this. Has this been
> implemented somewhere else within ITK?****
>
> ** **
>
> Thanks,****
>
> Luke****
>
> ** **
>
> _____________________________________
> 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.php
>
> 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
>
>


-- 
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130520/c7829715/attachment.htm>


More information about the Insight-users mailing list