\HeaderA{id2image}{Converting an id tag to a Set of Image Coordinates and Vice Versa}{id2image}
\aliasA{image2id}{id2image}{image2id}
\keyword{attribute}{id2image}
\begin{Description}\relax
The function \code{id2image} converts an id tag of a gene supplied
by a user into a set of image coordinates regarding the location of
the gene being 
considered. Conversion of image coordinates to an id tag is performed
by \code{image2id}.
\end{Description}
\begin{Usage}
\begin{verbatim}
id2image(X, layout)
image2id(x, layout)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{X}] an integer value representing the id of a particular gene
\item[\code{layout}] 
\item[\code{x}] a vector of 4 integer elements which make up the image
coordinates of the gene.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The image coordinates of a gene correspond to the gene's grid row and
grid column position within a slide, and the gene's row and column
position within a grid.
\end{Details}
\begin{Value}
\code{id2image} returns a vector of 4 integer elements which is
the set of image coordinates. 
\code{image2id} returns an integer value which is the gene's id tag.
\end{Value}
\begin{Author}\relax
Yee Hwa Yang, \email{yeehwa@stat.berkeley.edu}
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{MouseArray}{MouseArray}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}data(MouseArray)
# mouse.setup <- init.grid()

id2image(1024, mouse.setup)
## You will see: [1]  1 3 11 16
## the grid in which gene 1024 can be found, is in row 1, column 3
## and the gene is located in row 11, column 16 of this particular grid.
 
image2id(c(2,4,6,8), mouse.setup)
## You will see: [1] 2906
## the gene located in row 6, column 8 in the grid that is in row 2 and
## column 4 is the 2906th gene of the data set.  
\end{ExampleCode}
\end{Examples}

