[Insight-users] Factors

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 19 14:01:17 EDT 2009


Hi Kevin,

Could this code do the trick ?:
http://forums.devarticles.com/c-c-help-52/c-calculating-prime-factors-15530.html

It's about 30 lines of code...


  Regards,


     Luis


---------------------------------------
On Wed, Oct 14, 2009 at 10:33 AM, Kevin H. Hobbs <hobbsk at ohiou.edu> wrote:
> Does anybody know of an itk-ish (not requiring a library that isn't
> already in ITK) factoring function?
>
> I'm monkeying around with writing an MPI Fast Marching program I
> mentioned earlier.
>
> I'd like the region splits to have certain properties :
>  1. each region should have at most one neighbor in each dimension.
>  2. the number of regions should be exactly equal to the number of
>     nodes.
>  3. the splits should be roughly square (cubes or hyper-cubes).
>
> itkImageRegionMultidimensionalSplitter produces only n^3 pieces,
> itkImageRegionSplitter produces only slabs, and the splitter I've
> already written produces pieces with more than 2 neighbors.
>
> I figure if I can factor the number of splits then I can multiply the
> least two of these factors together until I have ndims factors which
> will become the number of splits in each dimension.
>
> I could write the prime finding myself but I don't want it to become a
> time sink.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>
>


More information about the Insight-users mailing list