Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use python libraries to do image processing for very large files (over 2GB), but the current python libraries can not read 16 or 32 bit image correctly. At least, I tried Python Image library, GDAL etc. which gave me 8 bit images or 2/3 correct images.

I want to try ArcGIS as the platform through ModelBuilder for image input. Does anyone know how to integrate ArcGIS raster input with external image processing programs? My basic idea is to convert ArcGIS raster input as an array for python libraries, but I do not know how to do. Any hint or suggestion to let me continue?

The primary works I did are just install python libraries within python 2.6 for ArcGIS and some codes as following.

import arcpy
import os, sys  
import numpy as num
from scipy import ndimage
from skimage.morphology import watershed, is_local_maximum

def setupParameters():

    #local variables for input and output

    #Image segmentation using scikit-image
    distance = ndimage.distance_transform_edt(Input_Raster)
    local_maxi = is_local_maximum(distance, Input_Raster, num.ones((3, 3)))
    markers = ndimage.label(local_maxi)[0]
    labels = watershed(-distance, markers, mask=Input_Raster)

if __name__ == '__main__':
share|improve this question
up vote 2 down vote accepted

There is a function to convert Raster to NumPy array:

arcpy.RasterToNumPyArray (in_raster, {lower_left_corner}, {ncols}, {nrows}, {nodata_to_value})
share|improve this answer
Thanks! Keep trying~ – Vicky Jul 30 '12 at 17:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.