Chapter 4. Implementing a Contour Filter

Table of Contents

4.1. Loading the Input Image
4.2. Implementing the Contour Filter
4.3. Parameter Connection for Synchronization

In this chapter we will introduce to you how an image processing pipeline is implemented by means of a MeVisLab network. We are going to implement a contour filter which is based on the elementary image processing steps average, dilation, and subtraction. To get a visual impression of what the filter is doing, we will also implement two synchronized render pipelines with 2D viewers for the filter in- and output.

This will be our resulting network:

Figure 4.1. Example Network Contour Filter

Example Network Contour Filter


In this example, the Inventor inputs of the View2D modules are hidden by unchecking the context menu option View2D OptionsShow Inventor Inputs. For more information, see the MeVisLab Reference Manual, chapter Additional Inputs.

4.1. Loading the Input Image

First, we need an image as input. This image will be used as the input image for the normal viewer as well as as the input and filter image for the image processing pipeline.

  1. Create a new network (FileNew) and save it to disk.

  2. Find and add the LocalImage module via the Quick Search. As image input, use an image from the default MeVisLab demo data path.

  3. The default image loaded by LocalImage, ProbandT1 is fine.

  4. For the output, find and add the View2D module via the Quick Search and connect it to the LocalImage output. Double-click View2D to see the original image. Later, we will compare this output with the image resulting from the filter process.

Figure 4.2. Viewing the Input Image for the Contour Filter

Viewing the Input Image for the Contour Filter


To see an immediate (albeit small) preview of the input image, you can enable the preview modus in the menu bar, ExtrasShow Image Connector Preview.