% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ImageArray.R, R/conversion.R, R/manipulation.R,
%   R/utils.R
\name{ImageArray-methods}
\alias{ImageArray-methods}
\alias{[[,ImageArray,numeric-method}
\alias{[[<-,ImageArray,numeric-method}
\alias{rotate}
\alias{rotate,ImageArray-method}
\alias{crop}
\alias{crop,ImageArray-method}
\alias{flip}
\alias{flip,ImageArray-method}
\alias{flop}
\alias{flop,ImageArray-method}
\alias{negate}
\alias{negate,ImageArray-method}
\alias{modulate}
\alias{modulate,ImageArray-method}
\alias{meta}
\alias{meta,ImageArray-method}
\alias{axes}
\alias{axes,ImageArray-method}
\alias{realize}
\alias{realize,ImageArray-method}
\alias{as.raster}
\alias{as.raster,ImageArray-method}
\alias{path}
\alias{path,ImageArray-method}
\alias{[,ImageArray,ANY,ANY,ANY-method}
\alias{dim,ImageArray-method}
\alias{type,ImageArray-method}
\alias{length,ImageArray-method}
\alias{ImageArray}
\alias{as.raster.ImageArray}
\alias{aperm,ImageArray-method}
\alias{path<-,ImageArray-method}
\title{Methods for ImageArray}
\usage{
\S4method{[}{ImageArray,ANY,ANY,ANY}(x, i, j, ..., drop = FALSE)

\S4method{[[}{ImageArray,numeric}(x, i)

\S4method{[[}{ImageArray,numeric}(x, i, j, ...) <- value

\S4method{dim}{ImageArray}(x)

\S4method{type}{ImageArray}(x)

\S4method{length}{ImageArray}(x)

ImageArray(meta, levels)

\S4method{realize}{ImageArray}(x, level = NULL, max.pixel.size = NULL, min.pixel.size = NULL)

\method{as.raster}{ImageArray}(x, level = NULL, max.pixel.size = NULL, min.pixel.size = NULL, ...)

\S4method{rotate}{ImageArray}(x, angle)

\S4method{aperm}{ImageArray}(a, perm)

\S4method{negate}{ImageArray}(object)

\S4method{modulate}{ImageArray}(object, brightness)

\S4method{flip}{ImageArray}(x)

\S4method{flop}{ImageArray}(x)

\S4method{crop}{ImageArray}(object, index)

\S4method{axes}{ImageArray}(object)

\S4method{meta}{ImageArray}(object)

\S4method{path}{ImageArray}(object)

\S4method{path}{ImageArray}(object) <- value
}
\arguments{
\item{x, a, object}{An ImageArray object}

\item{i, j, value}{Depends on the usage
\describe{
 \item{\code{[[}, \code{[[<-}}{
   Here \code{i} is the level of the image pyramid.
   You can use the \code{length} function to get the
   number of the layers in the pyramid.
   When used with \code{crop}, arguments \code{i} and \code{j} are
   associated with indices of image dimensions (e.g. width, height)
 }
}}

\item{...}{Arguments passed to other methods}

\item{drop}{ignored}

\item{meta}{the metadata of the ImageArray object.}

\item{levels}{levels of the pyramid image, typically a vector of integers
starting with 1}

\item{level}{level}

\item{max.pixel.size}{maximum pixel size}

\item{min.pixel.size}{minimum pixel size}

\item{angle}{value between 0 and 360 for degrees to rotate}

\item{perm}{perm}

\item{brightness}{the brightness of the new image in percentage, e.g. 120}

\item{index}{a named or unnamed list of indices for cropping/subsetting the}
}
\value{
dim of the first level of the ImageArray object

type of ImageArray object

length of ImageArray object

An ImageArray object
}
\description{
Methods for \code{ImageArray} objects
}
\section{Functions}{
\itemize{
\item \code{x[i}: subset and crop
for \code{ImageArray} objects

\item \code{x[[i}: Layer access
for \code{ImageArray} objects

\item \code{`[[`(x = ImageArray, i = numeric) <- value}: Layer access
for \code{ImageArray} objects

\item \code{dim(ImageArray)}: dimensions of an ImageArray

\item \code{type(ImageArray)}: dimensions of an ImageArray

\item \code{length(ImageArray)}: length of an ImageArray

\item \code{ImageArray()}: ImageArray constructor method

A function for creating objects of ImageArray class

\item \code{realize(ImageArray)}: realize the array

\item \code{as.raster(ImageArray)}: create a raster object

\item \code{rotate(ImageArray)}: rotate image array to 90, 180, 270 degrees

\item \code{aperm(ImageArray)}: permute image

\item \code{negate(ImageArray)}: negate image

\item \code{modulate(ImageArray)}: modulate image

\item \code{flip(ImageArray)}: vertical flipping image

\item \code{flop(ImageArray)}: horizontal flipping image

\item \code{crop(ImageArray)}: cropping image

\item \code{axes(ImageArray)}: get axes metadata of the ImageArray object

\item \code{meta(ImageArray)}: get metadata of the ImageArray object

\item \code{path(ImageArray)}: path of an ImageArray object

\item \code{path(ImageArray) <- value}: replace method for path(ImageArray)

}}
\examples{
# get image
library(EBImage)
img.file <- system.file("images", "sample.png", package="EBImage")

# create ImageArray
imgarray <- createImageArray(img.file, n.levels = 3)

# access layers
imgarray[[1]]
imgarray[[2]]

# dimensions and length
dim(imgarray)
length(imgarray)

# manipulate images
imgarray <- crop(imgarray, ind = list(100:200, 100:200))
imgarray <- crop(imgarray, ind = list(x = 10:20, y = 10:20))
imgarray <- rotate(imgarray, angle = 90)
imgarray <- flip(imgarray)
imgarray <- flop(imgarray)

# create ImageArray on disk as HDF5 format
dir.create(td <- tempfile())
output_h5 <- tempfile(fileext = ".h5")
imgarray <- writeImageArray(img.file,
                          output = output_h5,
                          name = "image",
                          verbose = FALSE)

# as.raster
imgarray_raster <- as.raster(imgarray)

# realize
imgarray <- realize(imgarray)
}
