Home Image-Pro Plus Automation with Macros

Converting objects or outlines to AOI's

(Originally posted by Octothorpe on 11/14/2007)

I'm trying to measure the area of fluorescence within cell clusters on a triple-labeled sample.

I've taken my RGB image and extracted the three color channels and am able to easily threshold to the fluorescence signal I want to measure in area. The problem is, I want to be able to apply a previously saved outline so that I can report the data in terms of the area of fluorescence to an AOI representing a cluster of cells.

This seems like a simple question, but I cannot seem to find a solution.

Comments

  • (Originally posted by jch on 11/14/2007)

    One way to get the "thresholded area" is to measure the density (sum) for each object. Since you've already got the outlines copied over to your thresholded image, all you need to do is go to the Count/Size window and use the Measure | Select Measurements... window to add Density (sum) as one of the measurements... make sure you click the "Measure" button on the "Select Measurements" screen to perform the calculation.
    The measurement it generates isn't actually the area, but the sum of the intensities. But, since all of the intensities are either 0 or 255... you can divide the number by 255 to get # of pixels. Another option would be to divide the image by 255, then all of the values would be 0 or 1 - and the "Density (sum)" would be the actual # of pixels.

  • edited June 2013

    (Originally posted by YuriG on 11/15/2007)

    You can also load outlines on the binary image and measure Density (mean), which will give you thresholded area percentage per object in range from 0 to 255 (0 - 0%, 255 - 100%).

    If you still want to convert outlines to AOI you can use the following macro (from IPP help on IpBlbGet):

    
    Sub OutlineToAOI()
    	ReDim blbpts(1000) As POINTAPI
    
    	Dim numpoints As Integer, numobj As Integer
    	Dim status As Integer, i As Integer
    
    	' get the total number of objects, in-range and out-of-range,
    	' hidden and visible.
    
    	ret = IpBlbGet(GETNUMOBJ, 0, 0, numobj)
    	For i = 0 To numobj - 1
    		ret = IpBlbGet(GETSTATUS, i, 0, status)
    		Debug.Print ret ' (status)
    		' if object in-range and visible...
    		If status >= 0 Then
    			' get the outline of the object
    			numpoints = IpBlbGet(GETPOINTS, i, 1000, blbpts(0))
    			If numpoints > 0 Then
    				' create AOI out of the object outline and XOR it.
    				ret = IpAoiCreateIrregular(blbpts(0), numpoints)
    				ret = IpAoiMultShow(1)
    				ret = IpAoiMultAppend(1)
    				'ret = IpOpNumberLogic(0, OPL_NOT, 0)
    			End If
    		End If
    	Next i
    End Sub
    

     

Sign In or Register to comment.