There is probably not enough information in your original description to be sure that I am giving the right advice. If your circle is defined as an array of polygon vertices, then I would recommend that you look at the examples IDL has for its IDLanROI object class. See particularly the Online Help article "Programmatically Defining ROIs". If you are able to initialize an IDLanROI object with your circle data, then the following steps could meet your analysis needs:
; I assume that your circle vertices are stored in a 3 x nVertices array
oROI = obj_new('IDLanROI', circleVertices)
myImageMask = oROI->ComputeMask( DIMENSIONS=myImageDims )
; This next call gets you stats on pixels included IN your circle ROI.
image_statistics, myImage, MASK=myImageMask, COUNT=nInternalSamples, $
MEAN=myInternalROImean
; Now some steps to analyze the values OUTSIDE the mask
; There are many ways to calculate this, butI think it might be efficient to
; capture the "opposite of" 'myImageMask' and run IMAGE_STATISTICS
; on that mask.
externalMask = ~myImageMask
image_statistics, myImage, MASK=externalMask, COUNT=nExternalSamples, $
MEAN=myExternalROImean
; Finally, if you need them, here are the indices of the external pixels:
externalMaskIndices = where(externalMask gt 0)
James Jones
|