Updating a line profile of an image while movig the line drawn in the image

Hello,

For the purposes of extended code I am writing to run a specific set of operations on transmission electron microscope images, I recently created my own version to extract line profiles from the image I am displaying.

The line profile is extracted from a line that the user draws in the ProgFront layer, a line that he can edit when he hits "Start Editing Line" in the image of the interface I have attached. Hitting Finish editing line will update the profile, but I'd also like the profile displayed in the graph to be updated while the user is moving the line around in the image (red line in attached image).

Does anyone have any suggestions as to how I could implement it? I was thinking of a hook function that I'd add to the Graph Window that displays the image, but I can't seem to find events in the hook structure that allow me to track the movement of objects that are drawn in the image.

Thanks in advance for your help.
LineProfInterfaceSnapShot.png (418.48 KB)
If both Cursor A and B are placed on the image, you could automatically draw a line between the cursors and display the line profile. The hook function updates when the cursors are moved.
I think you can:
1 first save the line infomation in a wave (or X Y wave pair)
2 write a function to complete profiling in a function using the above line wave
3 in the hook function call the above profiling function in the mouse event(I suppose you edit the line using mouse)

another way:
you can use dependence, this may be simplier
namely: profiledtrace:=profilingfunc(originalimage,linewave)
kpantzas wrote:
Hello,

For the purposes of extended code I am writing to run a specific set of operations on transmission electron microscope images, I recently created my own version to extract line profiles from the image I am displaying.

The line profile is extracted from a line that the user draws in the ProgFront layer, a line that he can edit when he hits "Start Editing Line" in the image of the interface I have attached. Hitting Finish editing line will update the profile, but I'd also like the profile displayed in the graph to be updated while the user is moving the line around in the image (red line in attached image).

Does anyone have any suggestions as to how I could implement it? I was thinking of a hook function that I'd add to the Graph Window that displays the image, but I can't seem to find events in the hook structure that allow me to track the movement of objects that are drawn in the image.

Thanks in advance for your help.