Re: Creating an ordered 'blob' ROI from a messy 'criss-crossed' ROI.... [message #75930 is a reply to message #75929] |
Thu, 05 May 2011 20:35   |
James Preiss
Messages: 2 Registered: November 2010
|
Junior Member |
|
|
On May 5, 11:45 am, George Millward <george.millw...@noaa.gov> wrote:
> Hi there,
>
> I'm working on a project which involves creating several ROIs on a
> number of images. The functionality is based
> on xROI.pro (but diverged from there a long time ago).
>
> Anyhow, what I want to achieve is for the program operator to be able
> to define an ROI by shift-clicking to create
> a number of points in [x,y]. Fine, I have this - but for the ROI code
> to work, the operator must click in an 'ordered manner' around the
> edge (ie, progressing either clockwise or anticlockwise around the
> ROI). For the program to be truly 'bomb proof' I need to build it
> such that if an operator clicks around the ROI in a 'non-ordered'
> fashion - then the resulting 'criss-crossed' ROI can be re-interpreted
> as a single ordered solid ROI.
>
> Does this make sense ? Considering that ROIs in general are such a
> big deal in IDL this issue/dilemma must have been addressed
> before........
>
> I guess simply my question can be rephrased as "How do I convert a
> messy 'criss-crossed' ROI into a consistent 'blob' ROI".
>
> Any help, as ever, much appreciated.
>
> Cheers
>
> George.
There is no general way to solve this problem unless you put some
constraints on allowable region shapes. For example, see the image I
just made at http://imgur.com/NqIxG . If you only allowed convex
ROIs, then you could take the convex hull of the points, but I doubt
you want that restriction. I can't think of any elegant solutions -
you'd be better of demanding that your users click in order.
|
|
|