Image(EBImage)
Image()所属R语言包:EBImage
Image class
图片类
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The package EBImage uses the class Image to store and process images. Images are stored as multi-dimensional arrays containing the pixel intensities. The class Image extends the base class array and uses the colormode slot to store how the color information of the multi-dimensional data is handled.
包EBImage使用类Image存储和处理图像。图像存储为多维阵列包含的像素强度。类Image扩展基类的array使用colormode插槽存储颜色信息的多维数据如何处理。
The colormode slot could be either Grayscale or Color. In both modes, the two first dimensions of the underlying array are understood to be the spatial dimensions of the image. In the Grayscale mode, the remaining dimensions contain other images. In the the Color mode, the third dimension contains the red, green and blue channels of the image and the remaining dimensions contain other images.
colormode插槽可能是要么Grayscale或Color。在这两种模式,两个底层数组的第一个层面是可以理解的是图像的空间尺寸。在Grayscale模式,其余的尺寸包含其他图像。 Color模式,第三个维度包含的形象和剩余的尺寸包含其他图像的红色,绿色和蓝色通道。
All methods of the package EBImage works either with Image objects or multi-dimensional arrays but in the latter case, the color mode is assumed to be Grayscale.
所有方法的包EBImage使用Image对象或多维数组,但在后一种情况下,颜色模式假定是Grayscale。
用法----------Usage----------
Image(data, dim, colormode)
as.Image(x)
is.Image(x)
as.raster.Image(y)
colorMode(y)
colorMode(y) <- value
imageData(y)
imageData(y) <- value
getFrame(y, i, type='total')
getNumberOfFrames(y, type='total')
参数----------Arguments----------
参数:data
A vector or array containing the pixel intensities of an image. If missing, a default 1x1 null array is used.
向量或数组,包含一个图像的像素强度。如果缺少,默认的1x1空数组使用。
参数:dim
A vector containing the final dimensions of an Image object. If missing, equals to dim(data).
一个矢量包含Image对象的最终尺寸。如果丢失,等于dim(data)。
参数:colormode
A numeric or a character string containing the color mode which could be either Grayscale or Color. If missing, equals to Grayscale.
一个数字或字符串,包含颜色模式,这可能是要么Grayscale或Color。如果丢失,等于Grayscale。
参数:x
An R object.
一个R对象。
参数:y
An Image object or an array.
Image对象或数组。
参数:i
A numeric.
一个数字。
参数:value
For colorMode, a numeric or a character string containing the color mode which could be either Grayscale or Color. For imageData, an Image object or an array.
colorMode,一个数字或字符串,包含颜色模式,这可能是要么Grayscale或Color。 imageData,Image对象或数组。
参数:type
A character string containing total or render. Default is total.
一个字符串,包含total或render。默认total。
Details
详情----------Details----------
Depending of type, getNumberOfFrames returns the total number of frames contained in the object y or the number of renderable frames. The total number of frames is independent of the color mode and is equal to the product of all the dimensions except the two first ones. The number of renderable frames is equal to the total number of frames in the Grayscale color mode and is equal to the product of all the dimensions except the three first ones in the Color color mode.
根据对type,getNumberOfFrames返回的对象中的总帧数y或渲染帧。总数的帧是独立的色彩模式和等于两个第一的以外的所有尺寸的产品。渲染帧的数目等于Grayscale色彩模式的帧总数等于Color色彩模式中,除了三个第一的所有尺寸的产品。
getFrame returns the i-th frame contained in the image y. If type is total, the function is unaware of the color mode and returns an xy-plane. If render, the function returns the i-th image as shown by the display function.
getFrame返回第i帧图像y中。如果type是total,功能是不知道的色彩模式,并返回一个XY平面。如果renderdisplay函数,该函数返回第i个形象。
值----------Value----------
Image and as.Image return a new Image object.
Image和as.Image返回一个新的Image对象。
is.Image returns TRUE if x is an Image object and FALSE otherwise.
is.Image x返回TRUE,如果Image对象,否则返回FALSE。
as.raster.Image coerces an Image object to a raster object.
as.raster.Image胁迫栅格对象的Image对象。
colorMode returns the color mode of y and colorMode<- changes the color mode of y.
colorMode返回y的色彩模式和colorMode<-改变y的色彩模式。
imageData returns the array contained in an Image object.
imageData所载Image对象返回的数组。
作者(S)----------Author(s)----------
Oleg Sklyar, <a href="mailto sklyar@ebi.ac.uk">osklyar@ebi.ac.uk</a>, 2005-2007
参见----------See Also----------
readImage, display
readImage,display
举例----------Examples----------
s1 = exp(12i*pi*seq(-1, 1, length=300)^2)
y = Image(outer(Im(s1), Re(s1)))
if (interactive()) display(normalize(y))
x = Image(rnorm(300*300*3),dim=c(300,300,3), colormode='Color')
if (interactive()) display(x)
w = matrix(seq(0, 1, len=300), nc=300, nr=300)
m = abind(w, t(w), along=3)
z = Image(m, colormode='Color')
if (interactive()) display(normalize(z))
y = Image(c('red', 'violet', '#ff51a5', 'yellow'), dim=c(71, 71))[ff51a5“,”黄色“),昏暗= C(71,71))]
if (interactive()) display(y)
## colorMode example[#colorMode例如]
x = readImage(system.file('images', 'nuclei.tif', package='EBImage'))
x = x[,,1:3]
if (interactive()) display(x, title='Cell nuclei')
colorMode(x)=Color
if (interactive()) display(x, title='Cell nuclei in RGB')
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|