comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Objects in ENVI ROI files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Objects in ENVI ROI files [message #48821] Tue, 23 May 2006 00:57
Bradley Wallet is currently offline  Bradley Wallet
Messages: 4
Registered: March 2006
Junior Member
Yes, I know how to do this. The problem is that I have multiple
objects in the ROI file. I do not really need the polygon information,
but I need which pixels in the ROI file associate with each object.
Currently, I take the first pixel in the ROI, and I look for any other
ROI pixels that are 4-point neighbors. Then, I take these pixels, and
I find any ROI pixels that are 4-point neighbor. I repeat this until I
have the all the pixels connected with the first pixel. Then, I pick
another pixel that is not assigned to the first object, and I repeat
the object growing routine. I then do this again and again until all
the pixels in the ROI are assigned to an object, and I then have all
the objects that are described by the ROI file. I am pretty good at
writing code to work with ENVI and ENVI ROI files.

However, this just doesn't seem like the cleanest way to do it. ENVI
ROI files store polygons. When you open the ROI file, the information
is converted to pixel x and y coordinates. I am looking for a way to
directly access the polygon information in the ROI file so I do not
have to reconstruct the contained objects.

Brad

------------------------------------------------------------ --------------------------------------
Brad Wallet
President and Chief Scientist
Automated Decisions, LLC
consulting@automateddecisions.com
Re: Objects in ENVI ROI files [message #48822 is a reply to message #48821] Tue, 23 May 2006 00:55 Go to previous message
Bradley Wallet is currently offline  Bradley Wallet
Messages: 4
Registered: March 2006
Junior Member
Yes, I know how to do this. The problem is that I have multiple
objects in the ROI file. I do not really need the polygon information,
but I need which pixels in the ROI file associate with each object.
Currently, I take the first pixel in the ROI, and I look for any other
ROI pixels that are 4-point neighbors. Then, I take these pixels, and
I find any ROI pixels that are 4-point neighbor. I repeat this until I
have the all the pixels connected with the first pixel. Then, I pick
another pixel that is not assigned to the first object, and I repeat
the object growing routine. I then do this again and again until all
the pixels in the ROI are assigned to an object, and I then have all
the objects that are described by the ROI file. I am pretty good at
writing code to work with ENVI and ENVI ROI files.

However, this just doesn't seem like the cleanest way to do it. ENVI
ROI files store polygons. When you open the ROI file, the information
is converted pixel x and y coordinates. I am looking for a way to
directly access the polygon information in the ROI file so I do not
have to reconstruct the contained objects.

Brad

------------------------------------------------------------ --------------------------------------
Brad Wallet
President and Chief Scientist
Automated Decisions, LLC
consulting@automateddecisions.com
Re: Objects in ENVI ROI files [message #48833 is a reply to message #48822] Mon, 22 May 2006 09:56 Go to previous message
David Streutker is currently offline  David Streutker
Messages: 34
Registered: June 2005
Member
I don't have a huge amount of experience writing ROI-related code, but
here's how I would go about it. (I'm assuming that you have a ENVI
license as well, as many of these functions are ENVI-only.)

1. If necessary, use ENVI_RESTORE_ROIS to open an ROI file.
2. Use ENVI_GET_ROI_IDS to get the ID of the ROI you're interested in.
3. Use ENVI_GET_ROI to get the indices associated with your ROI.

I'm not sure what your final goal is - this may be all you need. You
can use ARRAY_INDICES to convert the 1-D ROI indices to 2-D image
coordinates and ENVI_CONVERT_FILE_COORDINATES to get the geographic
coordinates.

If you need a true polygon boundary object, you can use QHULL to find
the boundary points (note that this creates a convex hull, which may
not be optimal, depending on the shape of the ROI). You can then
create an IDLgrPolygon or IDLanROI object, if that's what you need.

Hope that at least points you in the right direction. Much of it is
covered in the *ENVI* help files.

-David
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Using WIDGET_ACTIVEX to create a Socket server
Next Topic: Symbols Plotting - Psym

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:42:03 PDT 2025

Total time taken to generate the page: 0.00529 seconds