找回密码
 注册
查看: 344|回复: 0

R语言 spatstat包 owin()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 13:52:01 | 显示全部楼层 |阅读模式
owin(spatstat)
owin()所属R语言包:spatstat

                                        Create a Window
                                         创建一个窗口

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Creates an object of class "owin" representing  an observation window in the two-dimensional plane
创建类的一个对象"owin"表示在二维平面上的观察窗


用法----------Usage----------


  owin(xrange=c(0,1), yrange=c(0,1), ..., poly=NULL, mask=NULL,
unitname=NULL, xy=NULL)



参数----------Arguments----------

参数:xrange
x coordinate limits of enclosing box
x坐标限制的封闭箱


参数:yrange
y coordinate limits of enclosing box
y坐标限制的封闭箱


参数:...
Ignored.
忽略。


参数:poly
Optional. Polygonal boundary of window. Incompatible with mask.  
可选。多边形边界的窗口。不相容的mask。


参数:mask
Optional. Logical matrix giving binary image of window. Incompatible with poly.  
可选。逻辑矩阵给窗口的二进制图象。不相容的poly。


参数:unitname
Optional. Name of unit of length. Either a single character string, or a vector of two character strings giving the singular and plural forms, respectively.  
可选。长度单位的名称。无论是单字符的字符串,或两个字符的字符串,分别给予单数和复数形式的向量。


参数:xy
Optional. List with components x and y specifying the pixel coordinates for mask.  
可选。与组件列表x和y指定的像素坐标mask。


Details

详细信息----------Details----------

In the spatstat library, a point pattern dataset must include information about the window of observation. This is represented by an object of class "owin". See owin.object for an overview.
在spatstat库,点模式的数据集必须包括观察窗口的信息。这是代表一个对象类"owin"。见owin.object的概述。

To create a window in its own right,  users would normally invoke owin, although sometimes as.owin may be convenient.
要创建一个窗口,在自己的权利,用户通常会调用owin,虽然有时as.owin可能是方便。

A window may be rectangular, polygonal, or a mask (a binary image).
一个窗口可以是矩形,多边形,或掩模(二进制图像)。

rectangular windows: If only xrange and yrange are given, then the window will be rectangular, with its x and y coordinate dimensions given by these two arguments (which must be vectors of length 2). If no arguments are given at all, the default is the unit square with dimensions xrange=c(0,1) and yrange=c(0,1).
矩形窗:如果唯一的xrange和yrange是给定的,那么窗口将是矩形,它的x和y坐标尺寸,这两个参数(必须是矢量的长度为2)。如果没有给出参数,默认是在所有的单位面积尺寸xrange=c(0,1)和yrange=c(0,1)。

polygonal windows: If poly is given, then the window will be polygonal.
多边形窗口:poly如果,然后窗口将多边形。

single polygon: If poly is a matrix or data frame with two columns, or a structure with two component vectors x and y of equal length, then these values are interpreted as the cartesian coordinates of the vertices of a polygon circumscribing the window. The vertices must be listed anticlockwise. No vertex should be repeated (i.e. do not repeat the first vertex).
一个多边形:poly如果是一个具有两列的矩阵或者数据框,或结构有两个矢量x和y的长度相等,那么这些值被解释为直角坐标系的顶点的多边形外接的窗口。必须列出的顶点逆时针。没有顶点应重复(即不重复的第一个顶点)。

multiple polygons or holes: If poly is a list, each entry poly[[i]] of which is a matrix or data frame with two columns or a structure with two component vectors x and y of equal length, then the successive list members poly[[i]] are interpreted as separate polygons which together make up the boundary of the window. The vertices of each polygon must be listed anticlockwise if the polygon is part of the external boundary, but clockwise if the polygon is the boundary of a hole in the window. Again, do not repeat any vertex.
多个多边形孔:如果poly是一个列表,每个条目poly[[i]]这是一个两列的矩阵或数据框的结构与双组分矢量x和y的的长度相等,然后连续列表成员poly[[i]]被解释为单独的多边形,它们一起组成了窗口边界。必须列出每个多边形的顶点的逆时针如果多边形的外部边界的一部分,但如果多边形是在窗口中的一个孔的边界的顺时针方向。再次,不要重复任何顶点。

binary masks: If mask is given, then the window will be a binary image. The argument mask should be a logical matrix such that mask[i,j] is TRUE if the point (x[j],y[i]) belongs to the window, and FALSE if it does not. Note carefully that rows of mask correspond to the y coordinate, and columns to the x coordinate. Here x and y are vectors of x and y coordinates equally spaced over xrange and yrange respectively. The pixel coordinate vectors x and y may be specified explicitly using the argument xy, which should be a list containing components x and y. Alternatively there is a sensible default.
二进制口罩:如果mask,则该窗口将是一个二进制图像。的参数mask应该是一个逻辑矩阵,mask[i,j]是TRUE,如果点(x[j],y[i])属于窗口,FALSE如果没有的话。请注意,行的masky坐标和列x坐标。这是x和yx和y坐标同样间隔超过xrange和yrange分别是向量。像素坐标向量x和y可以指定显式地使用参数xy,这应该是一个列表,其中包含的组件x和y。或者是一个明智的默认值。

To create a window which is mathematically defined by inequalities in the Cartesian coordinates,  use raster.x() and raster.y() as in the examples below.
要创建一个窗口,它在数学上定义为在直角坐标系中的不平等,使用raster.x()和raster.y()在下面的例子。

Functions square and disc will create square and circular windows, respectively.
功能square和disc将创建方形和圆形的窗户,。


值----------Value----------

An object of class "owin"  describing a window in the two-dimensional plane.
类"owin"描述的是在二维平面上的窗口中的一个目的。


(作者)----------Author(s)----------


Adrian Baddeley
<a href="mailto:Adrian.Baddeley@csiro.au">Adrian.Baddeley@csiro.au</a>
<a href="http://www.maths.uwa.edu.au/~adrian/">http://www.maths.uwa.edu.au/~adrian/</a>
and Rolf Turner
<a href="mailto:r.turner@auckland.ac.nz">r.turner@auckland.ac.nz</a>




参见----------See Also----------

square, disc, owin.object, as.owin, complement.owin, ppp.object, ppp
square,disc,owin.object,as.owin,complement.owin,ppp.object,ppp


实例----------Examples----------


  w <- owin()
  w <- owin(c(0,1), c(0,1))
  # the unit square[单位面积]

  w <- owin(c(10,20), c(10,30), unitname=c("foot","feet"))
  # a rectangle of dimensions 10 x 20 feet[尺寸为10×20英尺的矩形]
  # with lower left corner at (10,10)[与低级的左上角在(10,10)]

  # polygon (diamond shape)[多边形(钻石形)]
  w <- owin(poly=list(x=c(0.5,1,0.5,0),y=c(0,1,2,1)))
  w <- owin(c(0,1), c(0,2), poly=list(x=c(0.5,1,0.5,0),y=c(0,1,2,1)))

  # polygon with hole[多边形孔]
  ho <- owin(poly=list(list(x=c(0,1,1,0), y=c(0,0,1,1)),
                       list(x=c(0.6,0.4,0.4,0.6), y=c(0.2,0.2,0.4,0.4))))
  
  w <- owin(c(-1,1), c(-1,1), mask=matrix(TRUE, 100,100))
          # 100 x 100 image, all TRUE[100×100的图像,所有的TRUE]
  X <- raster.x(w)
  Y <- raster.y(w)
  wm <- owin(w$xrange, w$yrange, mask=(X^2 + Y^2 <= 1))
          # discrete approximation to the unit disc[离散逼近的单位圆]

  ## Not run: [#不运行:]
  plot(c(0,1),c(0,1),type="n")
  bdry <- locator()
  # click the vertices of a polygon (anticlockwise)[单击“多边形的顶点(逆时针)]
  
## End(Not run)[#(不执行)]
  
  w <- owin(poly=bdry)
  ## Not run: plot(w)[#未运行图(W)]

## Not run: [#不运行:]
im <- as.logical(matrix(scan("myfile"), nrow=128, ncol=128))
# read in an arbitrary 128 x 128 digital image from text file[在任意128×128数字图像从文本文件中读取]
rim <- im[, 128:1]
# Assuming it was given in row-major order in the file[假设这是由于在文件中的行主要为了]
# i.e. scanning left-to-right in rows from top-to-bottom,[即扫描左到右行从顶至底,]
# the use of matrix() has effectively transposed rows &amp; columns,[矩阵()的使用,有效地调换的行和列,]
# so to convert it to our format just reverse the column order.[所以将它转换成我们的格式,只是扭转列的顺序。]
w <- owin(mask=rim)
plot(w)
# display it to check![显示它来检查!]

## End(Not run)[#(不执行)]

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-15 14:11 , Processed in 0.036530 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表