Radial profiles & Sector integration

I'm looking to perform some image processing operations in Igor on X-ray scattering data. Specifically Radial profiles (i.e. line profile extraction reading z-values around the circumference of a circle or an arc) and sector integration. The code for the radial profile operation in ImageJ can be found here http://rsbweb.nih.gov/ij/plugins/download/Radial_Profile.java would it be possible to adapt this code for Igor? Or has anybody managed to write original code for Iogr for these analyses?

Any help would be greatly appreciated.
Update: I have found a way to plot an arc of 180 deg using the circle equation x^2 + y^2 = r2 with x values running from 0-r to r. Taking the line profile of this wave when plotted onto the image using the ImageLineProfile operation works. However, this will only work for arcs of angle 180. Is there a good formula for plotting arcs defining the following variables:
x and y origin, radius, start and end angles.
Hello Thomas,

Thomas.Dane wrote:
Update: I have found a way to plot an arc of 180 deg using the circle equation x^2 + y^2 = r2 with x values running from 0-r to r. Taking the line profile of this wave when plotted onto the image using the ImageLineProfile operation works. However, this will only work for arcs of angle 180. Is there a good formula for plotting arcs defining the following variables:
x and y origin, radius, start and end angles.


A simple extension of the circle equation to arbitrary origin (x0,y0) would be:

(x-x0)^2+(y-y0)^2=r^2

but this is not how you would create a pair of waves that are used in ImageLine Profile. Assuming that you measure the angle (CCW) in degrees between the radius and the positive x axis then:
Make/O/N=(numPoints) xWave,yWave
Variable dAInDegrees=(endAngle-startAngle)/numPoints
xWave=x0+rad*cos((startAngle+p*dAInDegrees)*pi/180)
yWave=y0+rad*sin((startAngle+p*dAInDegrees)*pi/180)

Note that in the case of a closed contour you need to add one more point at the end of each wave that is equal to the first point. Note also that you can use the width parameter of ImageLineProfile to obtain averaged intensity over finite sampled paths including, for example, annular domains.

I hope this helps,

A.G.
WaveMetrics, Inc.