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

Home » Public Forums » archive » ENVI batch ROI
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
ENVI batch ROI [message #31035] Wed, 05 June 2002 08:13 Go to previous message
jdvona is currently offline  jdvona
Messages: 6
Registered: April 2002
Junior Member
I am not an IDL programmer and need help with a routine I developed.
The routine batch processes a GIS vector file with multiple polygons
by creating a single ROI for each individual polygon, which then
outputs the mean, total and standard deviation for the pixels within
the ROI.

The program has worked well for very simple polygons with few
verticies, but I found a bug, which occurs with fairly complex (eg
real-world) vegetation polygons. After the routine completes if I
look at the ROI's in ENVI they have missing parts of the polygons,
weird bisections, and filled in holes that were not part of the
original polygon. The code which creates the ROI is below:
I think 3.5 has this capability but I am still running 3.2 (long
story).
Thanks for the help.

FOR i=0,num-1 DO BEGIN

; read the record
;
vec = ENVI_EVF_READ_RECORD(evf_id, i)
; convert from map coordinates to file coordinates, again
; this assumes that the map proj for the vector data is the
; same as that of the image
;
ENVI_MAP_CONVERT, xpts, ypts, vec(0,*), vec(1,*), h_map=h_map,
/to_file
; make an ROI in memory
roi_id = ENVI_CREATE_ROI(ns=ns, nl=nl)

; add the vector record as an ROI
ENVI_DEFINE_ROI, roi_id, xpts=REFORM(xpts, /over), $
ypts=REFORM(ypts, /over), /polygon

; extract the image data associated w/the ROI
; XXX CHANGE J=0,8 below to represent the appropriate number of
bands
FOR j=0,0 DO BEGIN
print, roi_id
roi_data = ENVI_GET_ROI_DATA( roi_id, fid=fid, pos = [j])
printf, lun, strtrim(i,2), total(roi_data), MEAN(roi_data)
ENDFOR
ENDFOR
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: axis is too thin? - test.ps (0/1)
Next Topic: Limiting concatenation IDL 5.5

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

Current Time: Fri Oct 10 15:47:46 PDT 2025

Total time taken to generate the page: 0.72146 seconds