2D
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 the 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 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
, …). All these modules create or interact with scene objects and are based on the module SoView2D
, which can convert a voxel-image into a scene object. In this example, you will get to know some members of the SoView2D
-family.
Chapter V: Data Objects
Data Objects in MeVisLab
MeVisLab provides pre-defined data objects, e. g.
- Contour Segmented Objects (CSOs)
which are three-dimensional objects encapsulating formerly defined contours within images. - Surface Objects (Winged Edge Meshes or WEMs)
represent the surface of geometrical figures and allow the user to manipulate them. - Markers
are used to mark specific locations or aspects of an image and allow to process those later on. - Curves
can print the results of a function as two-dimensional mathematical graphs into a diagram.
Usage, advantages and disadvantages of each above mentioned data object type will be covered in the following specified chapters, where you will be building example networks for some of the most common use cases.
Contour Objects (CSO)
Contour Segmented Objects (CSOs) in MeVisLab
Introduction
Structure of CSOs
MeVisLab provides modules to create contours in images. 3D objects which encapsulate these contours are called Contour Segmented Objects (CSOs).
In the next image, you can see a rectangular shaped CSO. The pink circles you can see are called Seed Points.
Seed Points define the shape of the CSO. In case of a rectangle, you need four Seed Points forming the corners, to define the whole rectangle.
Contour Example 1: Creation of Contours
Contour Example 1: Creation of Contours
Introduction
We like to start with the creation of CSOs. To create CSOs, you need a SoCSO*
-Editor. There are several different editors, which can be used to create CSOs (see here). Some of them are introduced in this example.
Steps to do
Develop your network
For this example, we need the following modules. Add the modules to your workspace, connect them as shown below and load the example image $(DemoDataPath)/BrainMultiModal/ProbandT1.tif.
Contour Example 2: Contour Interpolation
Contour Example 2: Creating Contours using Live Wire and Interpolation
Introduction
In this example, we like to create CSOs using the Live Wire Algorithm, which allows semi-automatic CSO creation. The algorithm uses edge detection to support the user creating CSOs.
We also like to interpolate CSOs over slices. That means additional CSOs are generated between manual segmentations based on a linear interpolation.
Contour Example 3: 2D and 3D Visualization of Contours
Contour Example 3: Overlay Creation and 3D Visualization of Contours
Introduction
In this example, we’d like to use the created CSOs to display an overlay. This allows us to mark one of two lungs. In addition to that, we will display the whole segmented lobe of the lung in a 3D image.
Steps to do
Develop your network
Use the network from the contour example 2 and add the modules VoxelizeCSO
,
SoView2DOverlay
and View2D
to your workspace. Connect the module as
shown. The module VoxelizeCSO
allows to convert CSOs into voxel images.
Contour Example 4: Annotation of Images
Contour Example 4: Annotation of Images
Introduction
In this example we like to calculate the volume of our object, in this case the part of the lung we have segmented.
Steps to do
Develop your network and calculate the lung volume
Add the module CalculateVolume
and SoView2DAnnotation
to your workspace
and connect both modules as shown. Update the module CalculateVolume
,
which directly shows the volume of our object.
Contour Example 5: Contours and Ghosting
Contour Example 5: Visualizing Contours and Images
Introduction
In this example, we like to automatically create CSOs based on a predefined iso value.
Steps to do
Develop your network
Add the following modules to your workspace and connect them as shown. Load the example image Bone.tiff.
Automatic creation of CSOs based on the iso value
Now, open the panel of CSOIsoGenerator
to set the Iso Value to 1200. If you press Update in
the panel, you can see the creation of CSOs on every slide, when opening
the module View2D
. In addition to that the number of CSOs is displayed in the CSOManager
. The module
CSOIsoGenerator
generates iso-contours for each slice at a fixed iso
value. This means that closed CSOs are formed based on the detection of the
voxel value of 1200 on every slice.
Contour Example 6: Adding Labels to Contours
Contour Example 6: Adding Labels to Contours
Introduction
In this example, we are adding a label to a contour. The label provides information about measurements and about the contour itself. The label remains connected to the contour and can be moved via mouse interactions.
Steps to do
Develop your network
Add a LocalImage
and a View2D
module to your workspace and connect them as shown below. Load the file ProbandT1.dcm from MeVisLab demo data. In order to create contours (CSOs), we need a SoView2DCSOExtensibleEditor
module. It manages attached CSO editors, renderers and offers an optional default renderer for all types of CSOs.
Contour Example 7: Using the CSOListContainer
Contour Example 7: Using the CSOListContainer
Introduction
In this example, we are using the module CSOListContainer
instead of the CSOManager
. The CSOManager
is a heavy weight, UI driven module. You can use it to see all of your CSOs, CSOLists and CSOGroups in the module panel. The CSOListContainer
is a light weight module with focus on Python scripting. We recommend to use this module for final application development, because Python provides much more flexibility in handling CSO objects.
Marker Objects
Markers in MeVisLab
In MeVisLab you can equip images and other data objects with markers. In this example you will see how to create, process and use markers.
Creation and Rendering
To create markers, you can use a marker editor, for example the SoView2DMarkerEditor
. Connect this editor to a viewer as shown below. Now you can interactively create new markers. Connect the module XMarkerListContainer
to your marker editor to store markers in a list.
Example 1: Distance between Markers
Example 1: Calculating the distance between markers
Introduction
In this example, we will measure the distance between one position in an image to a list of markers.
Steps to do
Develop your network
Add the following modules and connect them as shown.
We changed the names of the modules SoView2DMarkerEditor
and XMarkerLIstContainer
, to distinguish these modules from two similar modules we will add later on. Open the panel of SoView2DMarkerEditor
and select the tab Drawing. Now chose the Color red.
Curves
Curves in MeVisLab
Introduction
Curves can be used in MeVisLab to print the results of a function as two-dimensional mathematical curves into a diagram.
In the given example, only modules available in commercial MeVisLab Professional SDK have been used. The non-commercial MeVisLab Standard SDK provides more modules for curves.
Example 1: Drawing curves
Example 1: Drawing curves
Introduction
In this example, you will draw one or more curves into a diagram and define different styles for the curves.
Steps to do
Develop your network
A curve requires x- and y-coordinates to be printed. You can use the CurveCreator
module as input for these coordinates. The SoDiagram2D
draws the curves into a SoRenderArea
. You can also define the style of the curves by using the StylePalette
module.