Interaction between Line Profiles and a Cursor
Nasser
I'm trying to design a litte GUI to extract the Horizontal and Vertical line profiles of an image. I'd like these profiles to update when I scroll a slider, or when I move the cursor on the image. Reciprocally, I'd like the slider to move when I move the cursor.
Is it possible to do so in a smart way, that is to say by extracting the right column and row, corresponding to the current values of (x,y) given by the horizontal and vertical sliders, and/or by the Cursor on the image ?
I think the image transform is appropriate for this job, isn't it ?
imagetransform /G=CurrentColumn getcol MyImage
Thank you,
Regards
You might find it more flexible to use the newer:
Connecting cursors to a slider would require that you use a window hook to set the position of the slider to match the cursor (see SetWindow operation for more information) and to move the cursor in response to a change in the slider position you can simply use the Cursor operation.
I think it is worth noting that simple cursors are not ideal for this application because you seem to be selecting a whole row or a whole column. In this case I recommend using something like the cross-cursors as implemented in the Image Particle.ipf (in WaveMetrics Procedures:Image Processing).
I hope this helps,
A.G.
WaveMetrics, Inc.
April 12, 2011 at 10:16 am - Permalink
Thank you for the info. I'm going to test what you have suggested.
Best Regards
April 13, 2011 at 12:17 am - Permalink
you might also consider looking into GraphWaveEdit and friends. This allows you to move the endpoints of a 1D wave with the mouse on a graph.
So you add a 1D wave with two points to the image, call GraphWaveEdit and move the endpoints of this trace with the mouse. After you have finished moving it you call GraphWaveNormal.
Using a dependency on this 1D-wave and ImageLineProfile lets you then interactively calculate the profile with an arbitrary width and not restricted to horizontal and vertical.
bye,
thomas
April 13, 2011 at 12:52 am - Permalink
I'm trying to understand the dependencies (I'd like to display the current values, and when I use "ValDisplay", it returns an error because I am not allowed to "use a local variable in a dependency formula"...
ValDisplay valdisp_Pos_vert value=DF(Pos_vert_SliderValue)
EDIT: It's OK, no need (I think) to use dependencies.
ValDisplay valdisp_Pos_vert value=_NUM:DF(Pos_vert_SliderValue)
And I've moved this into the Slider procedure, so that it's updated when I change the value.
Best Regards
April 13, 2011 at 08:23 am - Permalink