Re: Mask to ROI [message #52506 is a reply to message #52405] |
Tue, 06 February 2007 11:31   |
Erik[1]
Messages: 23 Registered: December 2006
|
Junior Member |
|
|
On 6 feb, 18:39, "Erik" <jansse...@gmail.com> wrote:
> On 5 feb, 23:12, "Karsten Rodenacker" <karsten.rodenac...@gsf.de>
> wrote:
>
>
>
>> Possibly you should try to use contour procedure with keyword PATH_XY,
>> PATH_INFO, PATH_DATA_COORDS.
>> Regards
>> Karsten
>
>> Am Fri, 02 Feb 2007 15:28:57 +0100 schrieb Erik <jansse...@gmail.com>:
>
>>> Hi Folks,
>
>>> A time ago I asked if I could cut a piece out of a ROI. Now I've
>>> created a mask of the ROI and edited the mask the way I wanted it to.
>>> This worked good for my analysis results, but I want the user to see
>>> the cutted ROI so I have to edit the DATA array from the ROI to modify
>>> the displayed ROI. This leads to the following question;
>
>>> Is there a way to convert a mask into a ROI Data Array??
>
>>> For example:
>
>>> Mask[5,5]
>>> 00000
>>> 00100
>>> 01110
>>> 00100
>>> 00000
>
>>> Needs to become:
>>> ROIData [ [2,1,0],[3,2,0],[3,3,0],[1,2,0] ]
>
>>> Please note that the ROI can be drawed when the first coordinate is
>>> connected with the second and so forth. The centered value in the mask
>>> should not be saved in the result; I only want the boundary points to
>>> draw my ROI.
>
>>> I've tried to figure out a algorithm to trace the border when I got
>>> the first point, but this takes much time and I wonder if there ain't
>>> any simpler way to do it...
>
>>> Help would be really appreciated!!
>
>> --
>> Erstellt mit Operas revolutionärem E-Mail-Modul:http://www.opera.com/m2/
>
> Thanks! I will check this out and post my findings!
Wow I'm amazed! The countour function totally did the trick for me!
So for all future searchers; THE way to convert a MASK into a new ROI:
CONTOUR, mask, /PATH_DATA_COORDS, PATH_XY=data
newROI = obj_new('IDLgrROI', DATA = data)
Big thanks!!
|
|
|