This kind of work is done most easily with an image mask, I think. It is fairly easy to do this with XROI, because the REGIONS_OUT output is an array of IDLgrROI objects, each of whom have the inherited method from IDLanROI called 'ComputeMask'. Thus, you might proceed as follows.
imgDims = size(kneeImg, /DIMENSIONS) ; 'ComputeMask' needs image dimensions
; Let's group all the user-selected ROI objects together
oFemurROIgroup = obj_new('IDLgrROIGroup')
for i = 0, n_elements(femurROIout) -1 do oFemurROIgroup->Add, femurROIout[i]
; This next line sets value 255 to all pixels on or within the borders of the ROI's, else 0
roiMask = oFemurROIgroup->ComputeMask(DIMENSIONS=imgDims)
roiMask = roiMask gt 0 ; Make the mask be 0/1 rather than 0/255
After you have the mask, it is easy to home in on the statistics of images that have the same dimensions as your XROI target and for which the same ROI polygons would be meaningful. For example,
myInterestingPixelRegion = nextImg * roiMask
will put value of 0 in all the image coordinates which are outside the ROI region(s), while it leaves the original image values in all the image coordinates which are inside the ROI region(s).
More automatically, IDL's IMAGE_STATISTICS procedure takes 'nextImg' data and you 'roiMask' as inputs, and gives you a number of different statistical output options.
James Jones
|