CPlotView:PlotCursorColRange CPlotView:PlotCursorRowAvg

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.

Syntax

CPlotView:PlotCursorRow( CImageView )

bullet.gif    CImageView is a reference to the class object where the image is displayed.

Remarks

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.

Example

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:

V:SetPlotAvgMode(1)

-- set the averaging method to 1 (median)

R = new_rect()

-- create a CRect object

R:Set(100,199,300,501)

-- specify the region to plot

V:SetCursorRect(R)

-- assign the CRect to the cursor

P = new_plotview()

-- create a new CPlotView

P:PlotCursorRow(V)

-- 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):

sRa = "5:20:13.54"

-- set the first coordinate (right ascension)

sDec = "-12:15:20.4"

-- set the second coordinate (right ascension)

V:SetCursorPosWcs(sRA,sDec)

-- position the image cursor

V:SetCursorWidth(100)

-- set the cursor width, in pixels

P = new_plotview()

-- create a new CPlotView

P:PlotCursorRow(V)

-- plot the row at the center of the cursor

Related Topics

CPlotView class, CImageView, SetCursorRect, SetCursorPosWcs, PlotCursorCol, Image Coordinate System, Subpixel Coordinate Definition

 

Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.