ImageLineProfile from a square ROI

I would like to generate an ImageLineProfile from a box on an image. Currently the software lets you generate a line profile of controlled width, but the "height" runs from -inf to inf. Is there a bit of code I could introduce to input/control the length of the Y dimension of the LineProfile.

Thanks
You appear to be using the Image Processing Package which is designed to handle the most common use of line profiles. The ImageLineProfile operation supports any path that you specify using a pair of XY waves so that you are free to invoke the operation on any range, not just -inf to inf. As I see it you have two choices:

1. Convert your ROI into a separate image. Display this image and apply the line profile in the usual way. To do so you can simply select the ROI using the mouse, right-click in the selection region and choose CopyImageSubset from the contextual menu. After you created the image select it in the Data Browser, right-click on the icon and choose NewImage.

2. Create a pair of waves:
Make/O/N=2 XX={xPosition,xPosition}
Make/O/N=2 yy={yMin,yMax}


Here xPosition is the horizontal position of the profile, yMin and yMax define the desired height limits. Now execute ImageLineProfile for this path. Your command should look like:
ImageLineProfile xWave=xx, yWave=yy, srcwave=yourImageWaveName


I hope this helps,

A.G.
WaveMetrics, Inc.
Ok, I tried to implement scenario #2, but was not successful. (Because I want the average line profile, not just a single line).

I generated my XX and YY wave using the cursor pairs CD and AB:

Make/o/n=2 xx={pcsr(c),pcsr(d)}
make/o/n=2 yy={qcsr(a),qcsr(b)}
imagelineprofile xwave=xx,ywave=yy,srcwave=MyImage

However this did not result in a line profile. I want the average line profile that exists within this box.

I agree that using the copy image subset would allow me to select out the region I want. But I need a solution which allows for user input on the boundaries of X and Y and returns the average line profile (similar to the Image Line Profile panel, which allows for changes in width, but not Y).

Thanks
ctmckee wrote:
Ok, I tried to implement scenario #2, but was not successful. (Because I want the average line profile, not just a single line).


I'm not sure what you mean by that.
ctmckee wrote:

I generated my XX and YY wave using the cursor pairs CD and AB:

Make/o/n=2 xx={pcsr(c),pcsr(d)}
make/o/n=2 yy={qcsr(a),qcsr(b)}
imagelineprofile xwave=xx,ywave=yy,srcwave=MyImage

However this did not result in a line profile. I want the average line profile that exists within this box.


How did you determine that this did not result in a line profile? Unless there is an error, the operation results in wave(s) created in the current data folder. Did you determine that such wave(s) were not created?

It seems to me that you are somehow "attached" to the IP procedures and their associated windows. In that case I'll suggest to you yet another approach:
1. In the Image Line Profile window choose, for example, Vertical Freehand from the popup menu in the top-left side of the window.
2. Click in the "Start Editing Path" button.
3. The vertical path in the window would get two red rectangular boxes, one at the top and one at the bottom. Drag them to match your selection region.
4. Click Finished Editing and you are done.

I hope this helps,

A.G.
WaveMetrics, Inc.