Beginner Tutorial Visualization 2D Overlays Masks

Example 3: How to blend images over each other

Introduction

In this example we will show you how to blend a 2D image over another one. With the help of the module SoView2DOverlay we will create an overlay, which allows us to highlight all bones in the scan.

Steps to do

Develop your network

Start this example by adding the shown modules, connecting the modules to form a network and loading the example image Bone.tiff.

Open the panel of the module Threshold and configure the module as shown below.

The module Threshold compares the contrast of each voxel of the image with a customized threshold. In this case: If the contrast of the chosen voxel is lower than the threshold, the voxel contrast is replaced by the minimum contrast of the image. If the contrast of the chosen voxel is higher than the threshold, the voxel contrast is replaced by the maximum contrast of the image. With this, we can construct a binary image, which divides the image into bone (white) and no bone (black).

Select output of the Threshold module to see the binary image in Output Inspector.

Image Threshold

Image Threshold

Overlays

The module SoView2DOverlay blends a 2D image over another one in a 2D viewer. In this case, all voxels with contrast above the Threshold are colored and therefore highlighted. The colored voxels are then blended over the original image. Using the panel of SoView2DOverlay, you can select the color of the overlay.

SoView2DOverlay

SoView2DOverlay

Exercises

  1. Play around with different Threshold values and SoView2DOverlay colors.
  2. Visualize your generated threshold mask in 3D by using the View3D module

Summary

  • The module Threshold applies a relative or an absolute threshold to a voxel image.
  • The module SoView2DOverlay blends an 2D image over another one in a 2D viewer.
  • You can also use a 3D SoRenderArea for the same visualizations. An example can be seen in the next Example 4