View source: R/profoundEllipse.R
profoundEllipseSeg | R Documentation |
Creates a logic matrix for an elliptical segment. This can be useful to allow the extraction of elliptical apertures on a target image (you can just sum the multiplication of the two).
profoundEllipseSeg(dim = c(101, 101), image = NULL, xcen = dim[1]/2, ycen = dim[2]/2,
rad = dim[1]/2, ang = 0, axrat = 1, box = 0)
dim |
Integer vector; the dimension of the logic matrix to return. |
image |
Numeric matrix; if provided this will be used to compute the dim. |
xcen |
Numeric scalar; the x centre of the segment aperture ellipse. |
ycen |
Numeric scalar; the y centre of the segment aperture ellipse. |
rad |
Numeric scalar; major axis radius for the segment aperture ellipse. |
ang |
Numeric scalar; major axis angle for the segment aperture ellipse in degrees. When plotted as an R image the angle (theta) has the convention that 0= | (vertical), 45= \, 90= - (horizontal), 135= /, 180= | (vertical). Values outside the range 0 <= ang <= 180 are allowed, but these get recomputed as ang = ang. |
axrat |
Numeric scalar; axial ratio of the segment aperture ellipse defined as minor-axis/major-axis, i.e. 1 is a circle and 0 is a line. |
box |
Numeric scalar; the boxiness of the segment aperture ellipse, defined such that r[mod]=(x^(2+box)+y^(2+box))^(1/(2+box)). When box=0 the segment will be a normal ellipse, but modifications between -1<box<1 will produce visually boxy distortions. Negative values have a pin-cushion effect, whereas positive values have a barrel effect (the major and minor axes staying fixed in all cases). |
Logical matrix, with the dimensions of dim, or the target image if supplied.
Aaron Robotham
Robotham et al, 2017, MNRAS, 466, 1513 (ProFit paper)
profoundDrawEllipse
magimage(profoundEllipseSeg())
magimage(profoundEllipseSeg(dim=c(200,200), axrat=0.5, ang=30, rad=30))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.