Setting Tag annotation location
I have made a bit of code that allows a user to select a region of a 2D image plot with the marquee around a peak of intensity in the image. The user right clicks and selects "Fit peak". The region selected by the marquee is duplicated and displayed in a new window, then a 2D Gaussian is fitted to the peak with the resultant fit contour appended to the peak data. I want to then label the peak in the original data plot using the output parameters x0 and y0 from the fit (stored in W_coeff) to give the location for the tag label. The problem is that the tag label requires the linear array index for specifying the location:
Tag [flags] [traceOrAxisName, xAttach [, textStr ]]
where xAttach is the x-value for 1D but the linear array for a 2D wave. In the dialogue (right-click on image > add annotation) you can specify the scaled x and y positions and it determines the array linear index. I was wondering if anyone knows how to calculate this?
Thanks,
Tom
On the other hand, can you just do the curve fit on a subrange of the original data? If you use graph cursors instead of a marquee, then it's easy to get row and column numbers instead of scaled X and Y values.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 31, 2012 at 09:08 am - Permalink
May 31, 2012 at 09:57 am - Permalink
This means that the linear index for the point at row i and column j is given by j * nRows + i.
May 31, 2012 at 12:26 pm - Permalink
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
May 31, 2012 at 12:39 pm - Permalink