Sorry to take so long to reply, I was working through the code and thinking about implementation. Nifty idea, but not I do not believe practical for my situation. I have 7 ROIs, each could contain as many as 10 points, and of those ten the true point may or may not exist. So coming up with all of the possible combinations/permutations could make this solution prohibitive.

I have been thinking about filtering by point instead of collection (at least initially). For good registration, I need at least 4 points. Knowing the distance between the points I can work through each of the points and check the distance between each of the other points. If I set some tolerance, then I can discriminate the points that are not within the tolereance for at least 4 of the 6 distances. This should be fairly quick { 6 distances per point max ~ 10 points per ROI => 420 checks, and if I splice the array for the ROI then this number should decrease as bad points are thrown out. }


If I can run a few tests then I will see what we typically have left. If it is only 1-3 points per ROI then your solution is much more viable.


Quick question (I have not looked for this yet, thought of it while writting), do you or does anyone know of a good module for doing the permutations I need? i.e. N arrays with M elements, creating new unique arrays containing only 1 element from each of the N arrays? I am sure that it is out there, I will look for it tonight.

Thanks for you help,


Cameron

In reply to Re^2: Interesting problem fitting points to a template (algorithm?) by doowah2004
in thread Interesting problem fitting points to a template (algorithm?) by doowah2004

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.