Image Line Profile procedure

Hello,

I'm new to Igor, and so please forgive me if this question is trivial.

I'm trying to write a procedure that automatizes loading .ibw file (AFM file), drawing an image plot of height trace, and finally drawing a plot of Z vs X (or Y) using a built-in "Line Profile" function. I normally create a line profile by clicking "Line Profile..." under the Image tab. Once I open the Line Profile, I choose the layer of .ibw I want the line profile on, choose either horizontal or vertical, and move around the line by manually dragging with my mouse, and click "Save Profile," which creates a new wave specifically for this line profile.

I have two separate functions, one loading .ibw and drawing image plot, and the other drawing Z vs X using the wave created by Line Profile (assuming I have already created line profile wave). I execute the first procedure, create line profile by the manual process as described above, and finally execute the second procedure.

Because I want to manually choose where to draw the line profile on the image plot, I am not quite sure how I can use the normal code provided by "imagelineprofile". I'd like my procedure to ask me to drag around the line on the image plot, but other than that, I want the entire process to be automatized.

I would appreciate any comments/suggestions. Thank you in advance!

You could make a window with two graphs. Graph one would be your AFM image with two cursors on it. Graph two would be the line profile between the two cursors. If you associate a hook function with the first graph you can automatically update the second graph every time the cursors are moved. See help for SetWindow.

It is difficult to understand exactly what you want to automate and what you are having problems with.

I guess what you want is to invoke the build-in line profile function programatically in your own scripts. Build-in menu entries are invoked via the DoIgorMenu call. So after you have an image open just call...

DoIgorMenu "Image", "Line Profile"

If your goal is to automate the process further, you may have to write your own script which provides the subset of functionality you want from the line profile program. For this you may be able to refer to an older version of the line profile function which exists as function code which you can directly interact with in user functions. But before I go into detail here, I would like to know first if you need further assistance at all ...