Replace.im(spatstat)
Replace.im()所属R语言包:spatstat
Reset Values in Subset of Image
复位值的子集图片
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Reset the values in a subset of a pixel image.
重设的值的像素的图像中的一个子集。
用法----------Usage----------
## S3 replacement method for class 'im'
x[i] <- value
参数----------Arguments----------
参数:x
A two-dimensional pixel image. An object of class "im".
一个二维的像素的图像。对象的类"im"。
参数:i
Object defining the subregion or subset to be extracted. Either a spatial window (an object of class "owin") or a point pattern (an object of class "ppp") or something that can be converted into a point pattern by as.ppp, or any type of index that applies to a matrix.
对象定义的分区域或要提取的子集。无论空间窗口(类的一个对象"owin")或点模式(一个对象的类"ppp")或东西,可以转换成一个点模式as.ppp,或任何类型的的索引,适用于一个矩阵。
参数:value
Vector, matrix, factor or pixel image containing the replacement values. Short vectors will be recycled.
向量,矩阵,因素或像素的图像包含替换值。短的向量会被回收。
Details
详细信息----------Details----------
This function changes some of the pixel values in a pixel image. The image X must be an object of class "im" representing a pixel image defined inside a rectangle in two-dimensional space (see im.object).
此函数改变部分的像素的图像中的像素值。图像X必须是类的一个对象"im"代表定义在二维空间中的矩形内的像素的图像(参见im.object)。
The subset to be changed is determined by the argument i.
以被改变的子集被确定的参数i。
If i is a spatial window (an object of class "owin"), the values of the image inside this window are changed.
如果i是一个空间窗口(类的一个对象"owin")的值,在此窗口内的图像被改变。
If i is a point pattern (an object of class "ppp", or something that can be converted into a point pattern by as.ppp), then the values of the pixel image at the points of this pattern are changed.
如果i是一个点模式(对象类"ppp",或东西,可以转换成一个点模式as.ppp),然后在该点的值的像素的图像这种模式被改变。
If i does not satisfy any of the conditions above, then it is assumed to be a valid index for the matrix as.matrix(x).
如果i不满足上述的任何条件,那么就假设它是一个有效的指数为矩阵as.matrix(x)。
值----------Value----------
The image x with the values replaced.
图像x的值取代。
(作者)----------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----------
im.object, [.im, ppp.object, as.ppp, owin.object
im.object,[.im,ppp.object,as.ppp,owin.object
实例----------Examples----------
# make up an image[图像]
X <- setcov(unit.square())
plot(X)
# a rectangular subset[矩形子集]
W <- owin(c(0,0.5),c(0.2,0.8))
X[W] <- 2
plot(X)
# a polygonal subset[多边形的子集]
data(letterR)
R <- affine(letterR, diag(c(1,1)/2), c(-2,-0.7))
X[R] <- 3
plot(X)
# a point pattern[点模式]
P <- rpoispp(20)
X[P] <- 10
plot(X)
# change pixel value at a specific location[在一个特定的位置,改变像素值]
X[list(x=0.1,y=0.2)] <- 7
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|