\HeaderA{tile}{Generate a tiled image from a stack of images}{tile}
\aliasA{tile,Image-method}{tile}{tile,Image.Rdash.method}
\aliasA{tile,list-method}{tile}{tile,list.Rdash.method}
\aliasA{untile}{tile}{untile}
\aliasA{untile,Image,numeric-method}{tile}{untile,Image,numeric.Rdash.method}
\keyword{manip}{tile}
\begin{Description}\relax
Given an image stack (or a list of such those), \code{tile} generates
for each stack a single image with frames tiled. \code{untile} does exactly
the opposite dividing a tiled image into a stack.
\end{Description}
\begin{Usage}
\begin{verbatim}

  ## S4 method for signature 'Image':
  tile(x, nx=10, lwd=1, fg.col="#E4AF2B", bg.col="gray", ...)
  ## S4 method for signature 'list':
  tile(x, nx=10, lwd=1, fg.col="#E4AF2B", bg.col="gray", ...)
  ## S4 method for signature 'Image, numeric':
  untile(x, nim, lwd=1, ...)

\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] An object of \code{\LinkA{Image}{Image.Rdash.class}} or a list of such objects.
Images must be grayscale and carry object indexing information, like those
returned by \code{\LinkA{watershed}{watershed}} or \code{\LinkA{propagate}{propagate}}. 
\item[\code{nx}] The number of tiled images in a row. 
\item[\code{lwd}] The width of the grid lines between tiled images, can be 0. 
\item[\code{fg.col}] The color of the grid lines (if \code{lwd > 0}).
This will be converted to Grayscale if the color mode of \code{x} is \code{Grayscale}. 
\item[\code{bg.col}] The color of the background for extra tiles. This will be
converted to Grayscale if the color mode of \code{x} is \code{Grayscale}. 
\item[\code{nim}] A numeric vector of 2 elements for the number of images in both directions.
\item[\code{...}] Reserved. 
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{tile} for \code{x=list} is a useful addition to \code{stackObjects},
which returns a list of stacks, thus it can be directly used on the result of
the latter.
\end{Details}
\begin{Value}
An image of the same class and in the same color mode as \code{x}.
\end{Value}
\begin{Author}\relax
Oleg Sklyar, \email{osklyar@ebi.ac.uk}, 2006-2007
\end{Author}
\begin{SeeAlso}\relax
\code{
  \LinkA{stackObjects}{stackObjects}, \LinkA{stackObjects}{stackObjects}
}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
  ## see example(stackObjects)
\end{ExampleCode}
\end{Examples}

