Most efficient way for extracting line profiles?

Hey,

I am momentarily trying to extract line profiles from an image for further analysis.

I understand that for the x- and y-directions, ImageTransform GetRow and GetCol would be appropriate - but how can I most efficiently extract DIAGONAL line profiles?

Thanks in advance for any help :)

Best regards,

Peter
Perhaps with the ImageLineProfile operation. There's a bit about it in the Image Analysis tutorial, File->Example Experiments->Tutorials. There's also a short example in the documentation; copy this Igor command to learn more:

DisplayHelpTopic "Image Analysis[ImageLineProfile]"

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
I read that the command ImageLineProfile does some smoothing and interpolating magic, so it might happen that the extracted line profile might have an different x-scaling than the rest of my extracted profiles...

Seems I have to go for loop and extract all relevant pixels that way and write them to a new wave (at least for the diagonal profiles)?

PeterR wrote:
Seems I have to go for loop and extract all relevant pixels that way and write them to a new wave (at least for the diagonal profiles)?


You can do that but it would be more efficient to use ImageLineProfile operation. Here is an example:
make/n=(100,200) fff=x*y
newimage fff
make/n=2 xxx,yyy
•xxx={0,99}
•yyy={0,199}
ImageLineProfile xwave=xxx,ywave=yyy, srcwave=fff,width=0


I hope this helps,

A.G.
WaveMetrics, Inc.
I was looking for an option that has already been discussed here. I used the above code, it works nice. I just realized following fact: if an image has eg. 500x500 points. I could run the macro and extract line profile along any arbitrary direction. But, when I scale the data to some starting and delta values, I expected extracted line profile will have x and y axis values from new scale. Some how it does not. If I plot table of scaled image, I am finding scaling is alright. Any help pls.
Thanks.
I recommend starting with a statement identifying the version of Igor that you are using and the platform you are running on.

The code above was not intended to illustrate how to use ImageLineProfile in the presence of scaling. Assuming that you scaled your image prior to executing ImageLineProfile then you should add the /SC flag to get the scaled profile waves. Here is an example:
make/n=(100,200) ddd=x*y
newimage ddd
SetScale/P x 0,-1,"", ddd
make/n=2 xxx,yyy
xxx={0,-99}
yyy={0,199}
ImageLineProfile/sc xwave=xxx,ywave=yyy, srcwave=ddd,width=0
appendtograph/t w_lineProfiley vs w_lineProfilex


I hope this helps,

A.G.
WaveMetrics, Inc.