X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 28 Apr 2009 10:35 AM by  anon
Extract pixel values from image stacks
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
28 Apr 2009 10:35 AM
    Hi all, I have image stacks with several layers and an evf file with 3 points in it. How can I extract the pixel values of all bands at the location of the points? Thanks for your help!

    Deleted User



    New Member


    Posts:
    New Member


    --
    28 Apr 2009 10:52 AM
    One way to do it is to put all of your image layers into one image, then display the image, and overlay the vector points onto it.  I'm assuming you can do that part, but let me know if you need help with any of it.  Then from the Vector Parameters dialog, choose File > Export Active Layer to ROIs.  Then in the image display, choose Overlay > ROI Tool, to see the points as ROIs.  In the ROI Tool, select all of the point ROIs you just made, then choose File > Output ROIs to ASCII.  This will make a text file that looks something like this (for a 6 band image): ; ENVI Output of ROIs (4.6.1) [Tue Apr 28 10:47:53 2009] ; Number of ROIs: 3 ; File Dimension: 512 x 512 ; ; ROI name: EVF: Test Vector Layer (Record=1) ; ROI rgb value: {255, 0, 0} ; ROI npts: 1 ; ; ROI name: EVF: Test Vector Layer (Record=2) ; ROI rgb value: {255, 0, 0} ; ROI npts: 1 ; ; ROI name: EVF: Test Vector Layer (Record=3) ; ROI rgb value: {255, 0, 0} ; ROI npts: 1 ; ID    X    Y      Map X       Map Y        Lat          Lon  B1  B2  B3  B4  B5  B6    1  145  237  279105.00  4899825.00  44.220127  -107.765325   9   9   6  51  10   3    1  349  58  285225.00  4905195.00  44.270249  -107.690998  13  14  15  21  30  27    1  178  331  280095.00  4897005.00  44.195066  -107.751764  20  23  26  33  37  33 It may not be the *most* useful format for the info from the image, but it's all there.  I hope this helps. Peg

    Deleted User



    New Member


    Posts:
    New Member


    --
    01 Feb 2011 01:18 PM
    It is great that this code exisits, but can this be batched to do more than one hdf file? To put my question into context, I am working with multiple MODIS scenes and would like to extract values at particular points. In the end we are going to go through multiple years worth of MODIS images and pull values from each one (if they are cloud free). This may seem like a very simple question, but I am new to IDL and ENVI. Thanks Paul Julian

    Deleted User



    New Member


    Posts:
    New Member


    --
    07 Feb 2011 01:05 PM
    You can download the code that Jonathan Greenberg mentioned at http://www.ittvis.com/Use...ty/CodeLibrary.aspx. Search for rois_to_csv to see it. The download is the .pro file (i.e., the full source code for the tool), so you can modify it however you like. I haven't looked at the code myself, but I can't imagine that it can't be modified to work with more than one file. - Peg

    Deleted User



    New Member


    Posts:
    New Member


    --
    12 Feb 2014 09:22 PM
    Hi, I don't work too much with GIS software so I will appreciate any help with a question very related to the one here. I need to extract ALL the pixels (with all the bands info) in an image I have (Landsat 5 TM). It has the regular bands plus one I estimate. So, I can imagine extracting all the info is pretty similar to the way described here. I need a txt file (tab or comma delimited). One doubt that comes to my mind is if that would be too heavy to do (the image is pretty big) Thanks for any advice,

    Deleted User



    New Member


    Posts:
    New Member


    --
    13 Feb 2014 04:50 AM
    It might be better to describe what you want to do with the data . Take advantage of ENVI's array processing tools, rather than exporting to text, which will result in much larger file than the raw image itself. Besides, if the goal is to import it into Excel, then Excel will no doubt struggle with the file. Cheers Josh
    You are not authorized to post a reply.