12 Modeling bodies with images and voxels

 

This chapter covers

  • Understanding 3D images, image masks, and voxels
  • Learning the pros and cons of representing 3D models as images
  • Using the most common voxel operations, such as erosion and dilation
  • Combining voxel operations to create more complex operations
  • Making smooth contouring work on images, resulting in an image vectorization algorithm

A 3D image is an image, pretty much like any bitmap but with another dimension. As you can imagine a 2D image as an array of strings in which every string is an array of colored elements, you can imagine a 3D image as an array of 2D images (figure 12.1). 2D images are made of colored squares called pixels, and 3D images are made out of colored cubes called voxels. The term voxel means a pixel that has a volume: volume pixel, vo-xel, voxel.

Figure 12.1 The same data (a) represented as an array of colors: a 2D 4×2 image made of pixels (b) and a 3D 2×2×2 image made of voxels (c)
12-01

The term image stack is often used interchangeably with 3D image. The term has a slightly broader meaning, though. Images in a stack may not necessarily align with one another and may even have different sizes. A 3D image is like a perfect image stack—a special case.

12.1 How does computed tomography work?

12.2 Segmentation by a threshold

12.3 Typical operations on 3D images: Dilation, erosion, cavity fill, and Boolean

12.3.1 Dilation

12.3.2 Erosion

12.3.3 Practical example: Denoising

12.3.4 Boolean operations on voxel models

12.3.5 A few other uses of dilation and erosion

12.3.6 Section 12.3 summary

12.4 Practical example: Image vectorization

12.4.1 Input image

12.4.2 Step 1: Obtain a contour