X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 19 Jan 2006 09:24 AM by  anon
Retrieve data without opening the image
 1 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
19 Jan 2006 09:24 AM
    "XROI, kneeImg, REGIONS_OUT = femurROIout, STATISTICS = femurStats" gives me ROI region from femurROIout. I can do "XROI, kneeImg, REGIONS_IN = femurROIout, STATISTICS = tibiaStats" to define the same region for a different image. I need statistic data for same region from different images. My question is how I can do this without opening XROI window. Once user defines a ROI, program automatically retrieve the data from the rest.

    Deleted User



    New Member


    Posts:
    New Member


    --
    19 Jan 2006 09:24 AM
    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
    You are not authorized to post a reply.