
Axis Designations in SetMarquee Operation

jjweimer
The GetMarquee operation allows us to use axis designations (e.g. left, top) to specify the relative settings for the return coordinates. The SetMarquee operation has no equivalent.
I have a window with an image above using left, top and a graph below using its own axes (e.g. hleft, hbottom). I would like to regenerate a previously drawn marquee with SetMarquee based on coordinates returned from GetMarquee relative to (left, top) rather than relative to the entire window.
The feature request is therefore to allow this type of language.
SetMarquee/W=.../A=(left/right axis, top/bottom axis) left, top, right, bottom
Update: it seems like the following approach works (until this wish is granted). In an earlier version of this post, the code didn't work because I wasn't converting from pixel coordinates to point coordinates.
July 9, 2019 at 11:57 am - Permalink
In reply to It seems like the following… by gsb
Thanks. I am using a structure and a function call to populate either marquee or drawing coordinates.
I can draw a marquee on an image to restrict a histogram region. I need the graph coordinates to compute the image mask. I can get those and the absolute coordinates from the GetMarquee operation. As needed, I lock down the RoI as a drawing (hRoI). For this function, I also need the graph coordinates. When all is done, I can clear the RoI drawing. I want to restore the marquee to those coordinates. But I need the absolute coordinates to do a SetMarquee. Unfortunately ... :-( ... , the extractOutline flag pulls the drawing using graph coordinates, not absolute coordinates.
Hence, the desire to have SetMarquee be aware of placements in graph coordinates as (most) other operations also are.
July 9, 2019 at 01:51 pm - Permalink
Jeff- I have just implemented in Igor 9:
SetMarquee/HAX=axisname/VAX=axisname left, top, right, bottom
Using separate flags allows you to mix points and axis coordinates. That might or might not be particularly useful, but seems to me that unnecessary restrictions will only generate future enhancement requests :)
July 9, 2019 at 03:11 pm - Permalink
John: Thanks. I would have thought with one flag to handle the independent option with star or blank ...
/AX=(left,*) ... or ... /AX=(left,) // set vertical on the axis titled left and horizontal as absolute top/bottom
/AX=(*,*) ... or ... /AX=() // clear all axes designations (set to absolute)
July 10, 2019 at 05:58 am - Permalink
That's harder to code :)
July 10, 2019 at 12:36 pm - Permalink
Oh! OK.
July 10, 2019 at 02:45 pm - Permalink
I use the GetMarquee left, top operation for a marquee on an image. Why does it return values of v_left ... that are offset by -0.5? For example, when I force it to set at what I think is left=0, top=0, I read back -0.5, -0.5 rather than 0, 0?!?! I presume the right and bottom are also "offset" by -0.5 because the values also end with 0.5 (e.g. 615.5 rather than 615 or 616).
Is the marquee coordinates to be read as being "left and above the next whole number pixel" in this case?
How will this be handled for the new flags with the /HAX=top and /LAX=left designations? What will be the value when we would use SetMarquee/HAX=left 0,... to place the marquee at 0,0 and then read it back using GetMarquee left, top? Will we get v_left = 0 or will we get v_left = -0.5?
March 14, 2020 at 12:41 pm - Permalink
In reply to I use the GetMarquee left,… by jjweimer
An experiment which shows this behavior would be helpful.
March 16, 2020 at 06:31 pm - Permalink
Jim: I'll pull out a working example from my Image Tools package and try to post it by later this week or weekend.
March 16, 2020 at 08:26 pm - Permalink
Ok. I think I have it figured out. Help me here where I am wrong. This is for an image in a window.
GetMarquee - returns window coordinates as integer numbers
GetMarquee left, top - returns graph coordinates as real numbers
SetMarquee - takes window coordinates as integer numbers OR rounds inputs to integer numbers
The result is that I cannot position the marquee to WHOLE NUMBER (integer) values of a position in image pixels.
I'll work with this new knowledge in my code.
Thanks!
March 17, 2020 at 07:03 pm - Permalink