Visualization

Chapter III: Visualization

Visualization in MeVisLab

Introduction

Images and data objects can be rendered in 2D and 3D and interacted with in several ways using a set of tools available through MeVisLab. In this chapter in particular, we will focus on simple image interaction with two- and three-dimensional visualizations.

View2D and View3D

An easy way to display data and images in 2D and 3D is by using them modules View2D and View3D. What can be done with these viewers?

Example 1: Synchronous View of Two Images

Example 1: Synchronous View of Two Images

Introduction

In this example we like to use the module SynchroView2D to be able to inspect two different images simultaneously.

The module SynchroView2D provides two 2D viewers that are synchronized.

As in the tutorial Chapter 1 - Basic Mechanics of MeVisLab, the processed and the unprocessed image can be displayed simultaneously. Scrolling through one image automatically changes the slices of both viewers, so slices with the same slice number are shown in both images.

Example 2: Creating a Magnifier

Example 2: Creating a Magnifier

Introduction

Medical images are typically displayed in three different viewing directions (see image): coronal, axial, and sagittal.

Using the viewer OrthoView2D, you are able to decide which viewing direction you like to use. In addition to that, you have the opportunity to display all three orthogonal viewing directions simultaneously. Here, we like to display an image of the head in all three viewing directions and mark positions in the image.

Example 3: Image Overlays

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.

Example 4: Display 2D Images in Open Inventor SoRenderArea

Example 4: Display Images Converted to Open Inventor Scene Objects

Introduction

In the previous example you learned how to use the module SoView2DOverlay together with a View2D. MeVisLab provides a whole family of SoView2D modules (SoView2DOverlay, SoView2DRectangle, SoView2DGrid, …). These modules are derived from SoView2DExtension, which extends the SoView2D with specialized interaction and rendering. SoView2D itself renders a slice or a slab of a voxel image as a 2D image on the screen.

Example 5: Volume Rendering and Interactions

Example 5: Volume Rendering and Interactions

Introduction

In this example we like to convert a scan of a head into a 3D scene object. The scene object allows to add some textures, interactions, and animations.

Steps to Do

Develop Your Network

Implement the following network and open the image $(DemoDataPath)/BrainMultiModal/ProbandT1.tif.

SoGVRVolumeRenderer

SoGVRVolumeRenderer

The module SoGVRVolumeRenderer allows volume rendering of 3D and 4D images.

Example 6: MeVis Path Tracer

Example 6: MeVis Path Tracer

Introduction

The MeVis Path Tracer offers a Monte Carlo Path Tracing framework running on CUDA GPUs. It offers photorealistic rendering of volumes and meshes, physically based lighting with area lights and soft shadows and fully integrates into MeVisLab Open Inventor (camera, depth buffer, clipping planes, etc.).

Example 6.1: Volume Rendering vs. Path Tracer

Example 6.1: Volume Rendering vs. Path Tracer

Introduction

In this example, you develop a network to show some differences between volume rendering and the MeVis Path Tracer. You will visualize the same scene using both 3D rendering techniques and some of the modules for path tracing.

Example 6.2: Visualization Using Path Tracer

Example 6.2: Visualization Using SoPathTracer

Introduction

In this tutorial, we will explain the basics of using the SoPathTracer module in MeVisLab. You will learn how to create a scene, assign materials, add light sources, and configure the MeVis Path Tracer to generate enhanced renderings.

Example 7: Add 3D Viewer to OrthoView2D

Example 7: Add 3D Viewer to OrthoView2D

Introduction

In this example we will use the OrthoView2D module and add a 3D viewer to the layout Cube.

Steps to Do

Develop Your Network

Add the modules LocalImage and OrthoView2D to your workspace and connect them.

Network

Network

The OrthoView2D module allows you to select multiple layouts. Select layout Cube Equal. The layout shows your image in three orthogonal viewing directions. The top left segment remains empty.

Example 8: Vessel Segmentation Using SoVascularSystem

Example 8: Vessel Segmentation using SoVascularSystem

Introduction

In this tutorial, we are using an input mask to create a vessel centerline using the DtfSkeletonization module and visualize the vascular structures in 3D using the SoVascularSystem module. The second part uses the distance between centerline and surface of the vessel structures to color thin vessels red and thick vessels green.

Steps to Do

Develop Your Network

Load the example tree mask by using the LocalImage module. Connect the output to a DtfSkeletonization module as seen below. The initial output of the DtfSkeletonization module is empty. Press the Update button to calculate the skeleton and the erosion distances.

Example 9: Creating Dynamic 3D Animations Using AnimationRecorder

Example 9: Creating Dynamic 3D Animations using AnimationRecorder

Introduction

In this tutorial, we are using the AnimationRecorder module to generate dynamic and visually appealing animations of our 3D scenes. We will record a video of the results of our previous project, particularly the detailed visualizations of the muscles, bones, and blood vessels created using PathTracer.

Steps to Do

Open the network and files of Example 6.2, add a SoSeparator module and an AnimationRecorder module to your workspace and connect them as shown below.

Matplotlib

Matplotlib

Matplotlib, introduced by John Hunter in 2002 and initially released in 2003, is a comprehensive data visualization library in Python. It is widely used in the scientific world as it is easy to grasp for beginners and provides high quality plots and images that are widely customizable.

As MeVisLab supports the integration of Python scripts, e.g., for test automation, Matplotlib can be used to visualize any data you might want to see. And as it is directly integrated into MeVisLab, you don’t have to install it (via PythonPip module) first.

Example 1: Module Setup

Example 1: Module Setup

Introduction

To be able to access the data needed for our grayscale distribution plots, we need a network consisting of a module that imports DICOM data, a module that differentiates between slices, and another module that ouputs histogram data.

Steps to Do

Open up your MeVisLab workspace and add the modules LocalImage, SubImage, and Histogram to it. Connect the output of LocalImage to the input of SubImage, and the output of SubImage to the input of Histogram. If you feel like using a shortcut, you can also download the base network below and open it in your MeVisLab.

Example 2: 2D Plotting

Example 2: 2D Plotting

Introduction

In this tutorial, we will equip the macro module we created in the previous tutorial with a responsive and interactable panel to plot grayscale distributions of single slices as well as defined sequences of slices in 2D.

Steps to Do

Open the module definition folder of your macro module and the related .script file in MATE. Then, activate the preview as shown below:

MATE’s Preview view

MATE's Preview view

Example 3: Slice Comparison

Example 3: Slice Comparison

Introduction

We will adapt the previously created macro module to be able to overlay two defined slices to compare their grayscale distributions.

Steps to Do

As a first step, we will extend the panel: Open your BaseNetwork macro module within an empty MeVisLab workspace and select the .script file from its related files.

Example 4: 3D Plotting

Example 4: 3D Plotting

Introduction

In this tutorial, we will equip the macro module we created in the Example 1: Module Setup and later on adapted by enabling it to plot grayscale distributions of single slices and sequences in 2D in Example 2: 2D Plotting with a three-dimensional plotting functionality.

Steps to Do

The fields and commands needed have already been prepared in the second tutorial. We will just have to modify our .py file a little bit to make them usable. Integrate the following code into your .py file and import numpy.