next up previous contents
Next: Evaluation of the Maximum Up: Rendering Previous: Template Calculation   Contents


Projection

As the parallel projection of a point can be performed by independently projecting it's $x$, $y$, and $z$ coordinates, the projected positions $x_{img}$ and $y_{img}$ can be precalculated for the projection of all possible $x$, $y$, and $z$ cell coordinates within the volume. This results in six arrays - one for each $x_{img}$, $y_{img}$ position of each $x$, $y$, and $z$ coordinate.

For performance reasons, integer values are used to represent positions. As the summation of 3 integer values to obtain the $x_{img}$ or $y_{img}$ position of a cell's projection introduces an error of up to 1.5 pixels in $x_{img}$ and $y_{img}$, the arrays have to contain sub-pixel coordinates to keep the error below one pixel.

In combination with precalculated templates, the projection of a cell becomes simple and efficient. Cmax is obtained in a way described in the following paragraph, img_width is the width of the image in pixels. .pixel is the x or y coordinate of an image pixel, .subpix is a sub-pixel offset.

(xp,yp)=projection(cell.v1);
imgpos=xp.pixel+yp.pixel*img_width;
template=subtemplate[xp.subpix, yp.subpix];
for all elements in template
{
  if(image[imgpos+template_element.imgoffset]<Cmax)
    evaluate cell contribution at this pixel
}



Lukas Mroz, May 2001,
mailto:mroz@cg.tuwien.ac.at.