next up previous
Next: Opacity functions of data Up: Opacity function generation Previous: Mathematical boundary analysis


Opacity functions of data value

We now define some important functions of data value. $ g(v)$ is the average first directional derivative of $ f$ over all the positions $ \mathbf{x}$ at which $ f(\mathbf{x})=v$. $ h(v)$ is likewise the average second directional derivative at value $ v$.

Figure 5.3: Calculating $ g(v)$ and $ h(v)$ from the histogram volume. A schematic of the histogram volume is shown, with the axes labeled. The slice of the histogram volume at data value $ v$ is extracted, and the accumulation of sample points within this slice is shown as a diffuse dark region. The coordinates of the centroid of the region along the $ f'$ and $ f''$ axes are the $ g(v)$ and $ h(v)$ values.
\begin{figure}
\vspace{3pt}
\psfrag{f0pa}[lc]{\hspace{2pt}\raisebox{0pt}{\scaleb...
...
\centering {
\epsfig {file=eps/findgvhv.eps, width=0.9\textwidth}}
\end{figure}

These two functions can be obtained from the histogram volume for a given dataset as Figure 5.3 illustrates. The slice of the histogram volume at data value $ v$ records the distribution of the measured first and second derivative values for all the sample points with data value $ v$. The centroid of the distribution on the slice is then calculated. The coordinate of the centroid along the $ f'$ axis is $ g(v)$, and along the $ f''$ axis it is $ h(v)$. If there are data values $ v$ which received no hits in the histogram volume (that is, value $ v$ never occurs in the original volume dataset), then $ h(v)$ and $ g(v)$ are left undefined.

Knowing $ g(v)$ and $ h(v)$ for the range of data values, we can calculate $ \sigma $ with Equation 5.6. For more robust results, instead of using just the maximum or minimum of $ h(v)$, we can use both8:

$\displaystyle \sigma = \frac{2 \sqrt{e} \, \max_v(g(v))}{\max_v(h(v)) - \min_v(h(v))}$ (13)

Now we can produce the mapping $ p(v)$ that was referred to earlier, giving a position along a boundary as a function of data value:
$\displaystyle p(v)$ $\displaystyle =$ $\displaystyle \frac{-\sigma ^2 h(v)}{g(v)}$ (14)
  $\displaystyle \approx$ $\displaystyle \frac{-\sigma ^2 f''(f^{-1}(v))}{f'(f^{-1}(v))} = x$  

$ p(v)$, like $ f(v)$ and $ g(v)$, is undefined for values $ v$ which never occur in the original volume dataset.

Mathematically, we see that $ p(v)$ is a local inverse of $ f(x)$, since $ p(v) = x$, and by definition $ f(x) = v$. Intuitively, $ p(v)$ implies which side of the nearest boundary a data value $ v$ tends to fall. For values closer to $ v_{min}$, the position $ p(v)$ will be negative; for values closer to $ v_{max}$, $ p(v)$ will be positive. At the value half-way between $ v_{min}$ and $ v_{max}$, $ p(v)$ will be zero, the position at the middle of the boundary. In practice, it is useful to modify Equation 5.9 to account for the fact that due to low-level measurement noise, the gradient magnitude at the interior of materials is rarely exactly zero. Knowing how it differs from zero is a matter of experience, but assuming one can find a scalar quantity $ g_{thresh}$ which is higher than the ambient gradient magnitude9, Equation 5.9 is re-formulated, with a slight loss of mathematical accuracy, as

$\displaystyle p(v) = \frac{-\sigma ^2 h(v)}{\max(g(v) - g_{thresh}, 0)}$ (15)

To demonstrate the steps involved in the calculation of the position function $ p(v)$, we consider another synthetic dataset, containing two concentric spheres with distinct data values.

Figure 5.4: Precursors to $ \alpha (v)$ calculation for nested concentric spheres. A dataset cross-section and the usual scatterplots are shown in (a), (b), and (c). The three data values $ v_1$, $ v_2$, $ v_3$ are tagged in the dataset cross-section and marked on the horizontal axes of the two scatterplots. The functions $ g(v)$ and $ h(v)$ were calculated from the histogram volume and are plotted in (d) and (e). From $ g(v)$ and $ h(v)$, $ p(v)$ is calculated with Equation 5.10, and shown in (f).
\begin{figure}
\psfrag{VV}[l]{\hspace{4pt}$v$}
\psfrag{PV}[lb]{\raisebox{4pt}{$p...
...
\epsfig {figure=eps/twosph-pplot.eps,
width=0.3\textwidth}}
}
}
\end{figure}

Figure 5.4 shows a central cross-section of the dataset, as well as the usual scatterplots. The boundaries that occur in the dataset can be learned by inspecting the cross-section or by interpreting the scatterplots. The background value $ v_1$ shares a boundary with the lower material value $ v_2$, and the lower material value has a boundary with the higher one $ v_3$. The figure next shows plots of the functions $ g(v)$, $ h(v)$, and $ p(v)$. Note that for this dataset, the graph of $ g(v)$ closely mimics the shape of the $ f'$ versus $ f$ scatterplot, and the graph of $ h(v)$ closely mimics the $ f''$ versus $ f$ scatterplot. The plot of $ p(v)$, calculated with Equation 5.9, also has the expected shape, similar to two graphs of $ f(x)$ rotated ninety degrees. This is a graphical demonstration of the concept that $ p(v)$ is a local inverse of data value $ f(x)$. Because $ p(v)$ does the opposite of $ f(x)$ by mapping from data value to position, we can see from the graph of $ p(v)$ that there are two data values which occur in the middle of boundaries. As expected, they are the data values half-way between $ v_1$ and $ v_2$, and half-way between $ v_2$ and $ v_3$.

Once $ p(v)$ is known, it is a relatively simple matter to generate an opacity function which makes the boundaries of objects visible in the rendered image. Since the middle of a boundary is always where the position is zero, we need only make opaque those data values $ v$ for which $ p(v)$ is near zero. Exactly how this is done is determined by the user, who specifies a function $ b(x)$, which we term the boundary emphasis function. The function $ b(x)$ maps from position along a boundary to opacity. Since $ b(x)$ should be non-zero only near zero, we have not been especially careful in preventing $ p(v)$ from attaining infinite values due to a low $ g(v)$; such a data value $ v$ should not contribute to the final image. With $ b(x)$, the user can directly control the proximity of the rendered boundary to the object interior, and whether rendered boundaries will appear thick or thin, sharp or fuzzy. The final opacity function $ \alpha (v)$ is then defined as

$\displaystyle \alpha (v) = b(p(v))$ (16)

For those values $ v$ where $ p(v)$ is undefined, we define $ \alpha (v)$ to be zero.

Figures 5.5 and 5.6 illustrate and discuss how the choice of the boundary emphasis function affects the opacity function and the rendered image, using the same concentric spheres dataset analyzed in Figure 5.4. Instead of exploring the parameter space of all possible opacity functions $ \alpha (v)$, the user explores the parameter space of $ b(x)$ and lets the information from the histogram volume, embodied in $ p(v)$, constrain the search to those opacity functions which display object boundaries. Defining opacity as a function of position within a boundary then becomes a more intuitive task than defining opacity as a function of data value, as there is a more predictable relationship between changes made to the boundary emphasis function and the corresponding change in rendered results.

Figure 5.5: Using $ b(x)$ to control the proximity of the rendered boundary to the object interior. In (a), a simple boundary emphasis function $ b(x)$ (at top) makes the positions between $ -2$ and $ 2$ opaque, peaking at zero, the middle of the boundary. Below (middle), the resulting opacity function $ \alpha (v)$ is shown. The data values near $ 80$ and $ 176$ for which $ p(v)$ (Fig.5.4) was zero receive maximum opacity. The rendering (bottom) nicely shows the boundaries of the two spheres. In (b), the peak in $ b(x)$ (top) has been shifted upward, to emphasize values closer to the interior of the spheres. Correspondingly, the peaks in $ \alpha (v)$ (middle) have shifted upward, and in the rendering (bottom), the spheres appear slightly smaller.
\begin{figure}
\setcounter {subfigure}{0} \psfrag{AAbofx}[bl]{\hspace{-3pt}\rais...
...2.high.eps,
width=0.4\columnwidth}\end{tabular}}
\end{tabular*}}
\end{figure}

Figure 5.6: Using $ b(x)$ to control the character of the rendered boundary. In (a), the boundary emphasis peak (top) has been raised to make the rendered boundary more opaque. Accordingly, the peaks in $ \alpha (v)$ (middle) have raised, and the rendered boundary (bottom) is indeed more opaque. In (b), the shape of the boundary emphasis function (top) has been changed to be more discontinuous. This characteristic is reflected in the resulting $ \alpha (v)$ (middle), as well as in the rendering (bottom).
\begin{figure}
\setcounter {subfigure}{0} \centering {
\begin{tabular*}{\column...
...4.high.eps,
width=0.4\columnwidth} \end{tabular}}
\end{tabular*}}
\end{figure}

It should be stressed that the user does not set the initial location of the peaks in $ \alpha (v)$, since this is determined by the information in $ p(v)$. However the user can modify the location of the peaks, as well as their width, height, and shape. This is the main benefit of the method presented in this thesis: if the histogram volume has successfully captured information about the boundaries in the dataset, the user enjoys high-level control over the character of the rendered boundaries without being required to give an exact specification of $ \alpha (v)$. For instance, the user can specify (as in Figure 5.5) that the opacity linearly ramp up and down near the boundary. Unless the user somehow has an intuition for the position function $ p(v)$, it is unlikely that he or she would be able to manually create the opacity function $ \alpha (v)$ which achieves this. Furthermore, the $ \alpha (v)$ generated by this method is usually sensible enough that it can be manually edited if desired. For example, since this technique will attempt to make all boundaries opaque, a useful supplement to the interface would be a feature which allows removal of the peaks in $ \alpha (v)$ for one or more boundaries, so as to remove the corresponding boundaries from the rendering.

Even though we have made some strong assumptions about the boundary characteristics in the volume dataset, the technique described here typically works well even if the material boundaries are not ``ideal''. Essentially, by taking the quotient of the second and first derivatives, and by having $ b(x)$ assign opacity to positions around zero, we are more apt to make opaque those data values associated with both low second derivatives and high first derivatives, consistent with the criteria usually used in computer vision edge detectors. Or, even if $ p(v)$ is not a perfect indicator of ``position relative to boundary'', the sign change in $ f''$ around its zero-crossing affords us some control over whether we want to emphasize regions closer to or further from the object's interior.

In the case of poor data, there are some adjustments to the method presented here which may yield better results. When the material boundaries are far from ideal, the calculation of $ \sigma $ from Equation 5.6 is apt to produce a poor results. Evaluating Equation 5.9, we can see that $ \sigma ^2$ appears as a scaling factor, so at worst, this will require the user to experiment with different scalings in the domain of $ b(x)$. Also, the $ g(v)$ and $ h(v)$ calculated from the histogram volume may be very noisy. Some improvements have been noted from smoothing these slightly. Results from these experiments, and from utilizing the technique on a variety of datasets are presented in Chapter 6.



Footnotes

... both8
An implicit assumption in this equation is that $ g$ attains its maxima at $ f(0)$, and that $ h$ attains its extrema at $ f(\pm\sigma )$.
... magnitude9
As will be shown in the next chapter, there is some freedom in which value is chosen for $ g_{thresh}$, but this is the defining constraint.

next up previous
Next: Opacity functions of data Up: Opacity function generation Previous: Mathematical boundary analysis