26
Chapter 4
Painting-based Segmentation
Painting assigns voxels into segments. Using our data representation, internally every
voxel is associated with an integer, which we call the mask index or index. Visually, we
use color to distinguish between two mask indices; that is, each mask index is assigned
a color, and two different segments can be identified visually by their difference in
colors.
Painting is performed in 3D using a spherical brush whose radius is adjustable.
We determine the position of the brush by shooting a ray from the viewer eye position
to the volume, where the direction of the ray is dictated by the mouse position. An
intersection between the ray and the volume is computed by restricting the intersec-
tion to the first point on the ray with the visible volume. The point of intersection is
used to place the center of the sphere. The user can then paint the volume by press-
ing a key, which indicates that all visible voxels within the sphere will be assigned
a certain mask index. The visibility of a voxel is determined through the transfer
function; a voxel υ is visible if T(∕(υ)) > б where T is the transfer function, f is the
volume function, and б is a small tolerance.
The mask indices are stored in a mask volume, which is updated per painting
operation. We choose an index as the base index to represent the unpainted portion
of the volume. Painting writes over the indices of the voxels contained within the
sphere with the brush denoted index. To allow operations such as drilling through
the volume, we also set the condition that the sphere will not intersect with a voxel
that has the same index as the brush. This condition has the effect that the user can
drill through the volume by repeatedly painting a region or gradually peel away the