Jump to content
Sign in to follow this  

Find pixels to extract information with envi.

Recommended Posts

Hello sensors,


I have to extract information that the pixel containe in landsat 8 image with envi 4.8, I used point collection tool, I opened the ASCII file that containe the coordinates of my point samples and I click on "goto", a message tel me that the point is out of image, although I'm sure that the points are in. now I use "corsore location" tool and i seek for the point one by one, it's vey slow. 


in the other side I used Qgis, I opened the landsat image, I créat the "shp" that containe my points and coordinats, and I used the "point sampl tool", the new files created containe no informations, the tool didn't extracts information from the image and I'm sure that the pixels containe the information "NDVI"


Thank you for help.


PS: how to put a  screenshot I click on image icone a windows of URL of image open. !!!

Share this post

Link to post
Share on other sites

Hi Babyshoone!!!

 on ENVI & IDL is easy run the script roi_to_csv.pro.... And is great for many  layers stack!!!!


pro rois_to_csv
  ;Select file name to save
 filename=dialog_pickfile(Title='Enter File Name')
 if filename eq '' then return
 Openw, lun, filename, /Get_lun
  envi_select, title='Input Filename', fid=fid, pos=pos
  if (fid eq -1) then return
  printf,FORMAT='(1000(A,:,","))',lun, bname
  ;Check ROIs associated with the image
  roi_ids = envi_get_roi_ids(fid=fid, roi_names=roi_names,/Short_name)
  if (roi_ids[0] eq -1) then begin
    print, 'No regions associated with the selected file'
  ; Compound widget for ROI selection
  base = widget_auto_base(title='ROI Selection')
  wm   = widget_multi(base, list=roi_names, uvalue='list', /auto)
  result = auto_wid_mng(base)
  if (result.accept eq 0) then return
  ptr = where(result.list eq 1, count)
  ; ROI data extraction
  for i=0l, count-1 do begin
     ;Initialize temp_data to hold the ROI's data
      data = envi_get_roi_data(roi_ids[ptr], fid=fid, $
      temp_data = fltarr(n_elements(pos),n_elements(data))
      ;Extract the data for each ROI
       for j=0l, n_elements(pos)-1 do begin
               data = envi_get_roi_data(roi_ids[ptr], fid=fid, $
               temp_data[j,*] = data
               help, temp_data
       ;Prints the ROI data to filename
           for k = 0L, n_elements(temp_data[0,*])-1 do begin
               printf, FORMAT='(A,:,",",1000(F12.2,:,","))',lun, roi_names, temp_data[*,k]
       ;Returns to the next ROI
   Free_lun, lun

Share this post

Link to post
Share on other sites

Hi Sigologo, thank u for the reply,


I  will try to use IDL and "skrip", but I have to tel you that I have no profeciency in IDL language, but I will try to do what you send me.



Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.