Is there any tool in ArcMap to extract pixel values from layer stacked satellite images?

5004
5
06-16-2016 09:15 AM
JamesVarghese
New Contributor

While analyzing multiple (more than 3) satellite images from the same location, it is sometimes necessary to extract pixel values from specific areas of the image to see the changing trends whether it be for phenological studies, change detection, ecological studies etc. I know there is a tool called 'ROI' in ENVI but I was wondering if there is a similar tool in ArcMap Toolbox?

0 Kudos
5 Replies
FC_Basson
MVP Regular Contributor

You might want to look at the Extract Multi Values to Points tool: Extract Values to Points—Help | ArcGIS for Desktop

0 Kudos
AbdullahAnter
Regular Contributor II
0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Really?  The true method?

How about true multidimensional tools

3 image with 3 bands stacked... what are the values for the middle pixel for all images and all bands

>>> import numpy as np
>>> np.set_printoptions(edgeitems=2,linewidth=80,precision=2,suppress=True,threshold=10)
>>> a = np.arange(81).reshape(9,3,3)
>>>
>>> a
array([[[ 0,  1,  2],
        [ 3,  4,  5],
        [ 6,  7,  8]],
       [[ 9, 10, 11],
        [12, 13, 14],
        [15, 16, 17]],
       ...,
       [[63, 64, 65],
        [66, 67, 68],
        [69, 70, 71]],
       [[72, 73, 74],
        [75, 76, 77],
        [78, 79, 80]]])
>>> a[...,1,1]  # center cell over 9 bands
array([ 4, 13, 22, 31, 40, 49, 58, 67, 76])
>>> # extract by points

>>> b # point mask
array([[1, 0, 1],
       [0, 1, 0],
       [1, 0, 1]])
>>> a[np.where(b==1)]
array([[ 0,  1,  2],
       [ 6,  7,  8],
       [12, 13, 14],
       [18, 19, 20],
       [24, 25, 26]])
>>> # or where the mask is nonzero
>>> r,c = np.nonzero(b)
>>> r
array([0, 0, 1, 2, 2], dtype=int64)
>>> c
array([0, 2, 1, 0, 2], dtype=int64)
>>> sub = a[:,r,c]
>>> sub
array([[ 0,  2,  4,  6,  8],
       [ 9, 11, 13, 15, 17],
       [18, 20, 22, 24, 26],
       ...,
       [54, 56, 58, 60, 62],
       [63, 65, 67, 69, 71],
       [72, 74, 76, 78, 80]])
>>> sub.shape
(9, 5)
JamesVarghese
New Contributor

Thanks FC, Abdullah and Dan for your valuable answers and comments. I see that the Spatial Analyst tools 'Extract Values to Points' and 'Extract Multi Values to Points' only work with point feature. There is another tool under the Geostatistical Analyst called the 'Extract Values to Table' which seems to work with both points and polygon. I was looking for the polygon option. Nevertheless, I don't find these tools as intuitive and interactive as the 'ROI' tool. Surely Dan, open source solutions work, I just need to get familiar with the coding part. Python is cool.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor
0 Kudos