next up previous
Next: Comparison with Levoy's two Up: Opacity function generation Previous: Opacity functions of data


Opacity functions of data value and gradient magnitude

The opacity functions considered so far have assigned opacity based on data value alone. Value-based opacity functions are easy to implement and facilitate simple and efficient rendering algorithms. Higher quality renderings can sometimes be obtained, however, if the opacity is assigned as a function of both data value and gradient magnitude. We term these two dimensional opacity functions. Defining these two dimensional opacity functions by hand is especially challenging because there are even more degrees of freedom than in one dimensional, value-based opacity functions. Fortunately, the ideas presented so far easily generalize to allow semi-automatic generation of two dimensional opacity functions.

Analogous to the definition of $ h(v)$, we define $ h(v,g)$ to be the average second derivative over all locations where the data value is $ v$ and the gradient magnitude is $ g$. As before, this information can be extracted from the histogram volume, as illustrated in Figure 5.7.

Figure 5.7: Calculating $ h(v,g)$ from the histogram volume. As in Figure 5.3, a histogram volume schematic is shown, but now a single scanline of the volume is extracted where data value is $ v$ and the first derivative is $ g$. The accumulation of sample points along this line is shown as a diffuse dark region. The location of the center of the region is $ h(v,g)$.
\begin{figure}
\psfrag{f0pa}[lc]{\hspace{2pt}\raisebox{0pt}{\scalebox {0.85}{$f(...
...}
\centering {
\epsfig {file=eps/findhvg.eps, width=0.9\textwidth}}
\end{figure}

For data value $ v$ and first derivative $ g$ there is a one dimensional histogram which records the distribution of second derivative values for those sample points which had both data value $ v$ and gradient magnitude $ g$. $ h(v,g)$ is the average of the distribution of second derivative values. In direct emulation of Equations 5.10 and 5.11, we define a new position function, and from that an opacity function:
$\displaystyle p(v,g)$ $\displaystyle =$ $\displaystyle \frac{-\sigma ^2 h(v,g)}{\max(g - g_{thresh}, 0)}$ (17)
$\displaystyle \alpha (v,g)$ $\displaystyle =$ $\displaystyle b(p(v,g))$ (18)

$ \alpha (v,g)$ is defined to be zero for those $ (v,g)$ pairs which never occur in the volume. $ \sigma $ is calculated exactly the same as before, using Equation 5.8. But whereas before a position was found for each data value, we are now finding position for every combination of data value and gradient magnitude. The resulting opacity function is thus two dimensional instead of one dimensional. As in the case of value-based opacity functions, the method presented here will generate two dimensional opacity functions which make all detected boundaries opaque. A simple ``lasso'' tool could then be used to select different regions in the two dimensional opacity function to render one boundary at a time.

To demonstrate the generation of two dimensional opacity functions, consider the dataset first seen in Figure 4.5, containing two concentric cylindrical shells each at distinct data values.

Figure 5.8: Precursors to the $ \alpha (v,g)$ calculation for nested cylindrical shells. (a) shows a cross-section of the data, labeling the regions of the three distinct data values. The color image in (b) represents the $ p(v,g)$ function that was computed from Equation 5.12. The values of $ p(v,g)$ are shown with a colormap, the legend of which is shown. In (c) a simple boundary emphasis function is plotted.
\begin{figure}
\setcounter {subfigure}{0}
\psfrag{v1}[tc]{\hspace{0pt}\rai...
...h}{\epsfig{figure=eps/twosph-bemph3.eps,
width=0.3\textwidth}}}}
}
\end{figure}

As can be seen in Figure 5.8(a), this dataset is similar to the nested spheres used in the previous section, in that it has a background value $ v_1$, and two material values $ v_2$ and $ v_3$. However, here the $ v_3$ region shares a boundary not just with the $ v_2$ region, but also with the $ v_1$ background region. If one wanted to visualize just the $ v_1$-$ v_3$ boundary with a value-based opacity function, the opacity function would have to make the values halfway between $ v_1$ and the $ v_3$ opaque. Unfortunately, these are precisely the values near $ v_2$, the value within the outer cylindrical shell. Thus the outer shell would obscure the $ v_1$-$ v_3$ boundary in any rendering. For this reason, one dimensional opacity functions are not sufficient to selectively render the boundaries in this dataset.

Figure 5.8(b) shows $ p(v,g)$ as calculated from Equation 5.12, with the aid of a colormap which is orange for positive values, blue for negative values, and purple in between the two extremes. Additionally, there is a small band of dark gray for values very close to zero. Where $ p(v,g)$ is undefined, the image is white. Note that as one moves along the arches from left to right, $ p(v,g)$ changes from negative to positive, hitting zero at the peak of the arches. This is closely analogous to the plot of $ p(v)$ for the nested spheres (Figure 5.4(f)) in the previous section, where position went from negative to positive as we moved up the data value axis. The position information $ p(v,g)$ is then fed into a simple boundary emphasis function $ b(x)$, shown in Figure 5.8(c). Even though the user-specified $ b(x)$ is still a simple function of one variable, it facilitates the creation of a two dimensional opacity function.

Figure 5.9: Renderings of nested cylinders and corresponding $ \alpha (v,g)$. (a) shows the two dimensional opacity function $ \alpha (v,g)$ initially generated from Equation 5.13 and a simple $ b(x)$. As with the scatterplots, the data value is on the horizontal axis, and gradient magnitude on the vertical. Black areas represent transparency; white is fully opaque. All three boundaries are visible in the corresponding rendering. By zeroing out areas in $ \alpha (v,g)$, other boundaries can be removed with ease, as seen in (b) and (c).
\begin{figure}
\setcounter {subfigure}{0}
\centering {
\psfrag{avg}[lc]{\hs...
...figure=eps/weeramp.eps,
width=0.3\textwidth}}
\end{tabular} }}
}
\end{figure}

The relationship between the two dimensional opacity function and the final rendering is shown in Figure 5.9. The initial opacity function calculated with Equation 5.13 (and the $ b(x)$ plotted in Fig. 5.8(c)) is shown at the bottom of Figure 5.9(a). As there were three boundaries recorded in the histogram volume, there are three bright regions in the opacity function, one for each boundary. To allow seeing internal structure, none of the boundaries have been rendered fully opaque. When we remove one of the regions of high opacity from $ \alpha (v,g)$ (Figure 5.9(b)), the corresponding boundary disappears from the rendering. In Fig. 5.9(b), what remains is the surface of the inner cylindrical shell. Since this object has boundaries with both the background and the lower object value, we can selectively render one or the other part of the surface, as demonstrated in Fig 5.9(c).

Though a contrived example, this serves to demonstrate the power of the method for two dimensional opacity function generation. In the one dimensional case, each detected boundary was marked by a spike in the opacity function of data value. Here, each detected boundary is marked by a bright spot in the two dimensional opacity function. This immediately gives the user a feel for what types of boundaries occur in the volume. By making only the middle of boundaries opaque, the different significant regions in the opacity function can be easily differentiated from each other by the user, and then edited to control which boundaries are rendered. Other examples of the effectiveness of this technique in generating two dimensional opacity functions are given in Chapter 6.


next up previous
Next: Comparison with Levoy's two Up: Opacity function generation Previous: Opacity functions of data