X
PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 15 Feb 2007 06:52 AM by  anon
Determining mean counts outside a ROI
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages

anon



New Member


Posts:
New Member


--
15 Feb 2007 06:52 AM
    I am new to IDL and would appreciate any help I get. I wish to determine the mean number of counts outside a circular region of interest drawn on an image. I thought I would sum the total number of counts in the image and then subtract the total counts within the ROI. Is there a particular function that is most appropriate for doing this? I still have the problem of determining the number of non-zero count pixel outside the ROI. Can anyone suggest an appropriate function? Thanks Mark

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Feb 2007 06:52 AM
    To define my problem more precisely: The image data comes from a DICOM file representing PET quantitation data. What I want to calculate is the mean counts outside a region of interest, which is automatically generated, by assuming that the boundary of the ROI can be defined by pixels whose count is below an empirically determined number of counts. I know that I need to generate a mask from the ROI, or more precisely the conjugate of the ROI mask, to determine the stats using the image_stats procedure. Mark

    Deleted User



    New Member


    Posts:
    New Member


    --
    15 Feb 2007 06:52 AM
    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
    You are not authorized to post a reply.