CPlotView:PlotCursorRow
The PlotCursorRow method plots the pixel values in the row at the center of the image cursor on a displayed image. This plots the pixel value as a function of x-axis position measured in pixel coordinates.
CPlotView:PlotCursorRow( CImageView ) |
CImageView is a reference to the class object where the image is displayed.
This method works with an image displayed in a CImageView. It creates a graph of luminance value versus column number for one row passing through the center of the image cursor. The number of columns plotted (i.e., the plot length) is defined by the cursor width. If the cursor rectangle is used to define the center position in pixel coordinates, then the central column is calculated as x = (xmin + xmax) / 2. The cursor region can be set using the SetCursorRect method or the cursor can be positioned using SetCursorPos or SetCursorPosWcs.
Assume that a CImageView object named V exists and refers to an image window. The following script plots row 400 over a length of 100 pixels (columns 100:199) for the displayed image:
|
-- set the averaging method to 1 (median) |
|
-- create a CRect object |
|
-- specify the region to plot |
|
-- assign the CRect to the cursor |
|
-- create a new CPlotView |
|
-- plot the row at the center of the image cursor |
Alternatively, suppose an astronomical image is the current image and that it has an equatorial form of world coordinate calibration. The following script plots the image luminance at coordinate (5:20:13.54,-12:15:20.4), over 100 pixels long and aligned in the row direction. Since this fragment plots 100 columns, the cursor's row extent is unimportant and we need only to set the number of columns (width):
|
-- set the first coordinate (right ascension) |
|
-- set the second coordinate (right ascension) |
|
-- position the image cursor |
|
-- set the cursor width, in pixels |
|
-- create a new CPlotView |
|
-- plot the row at the center of the cursor |
CPlotView class, CImageView class, SetCursorRect, SetCursorPosWcs, PlotCursorCol, Image Coordinate System, Subpixel Coordinate Definition