Data Objects
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.
Surface Objects (WEM)
Surface Objects (WEMs)
Introduction
In MeVisLab it is possible to create, visualize, process and manipulate surface objects, also known as polygon meshes. Here, we call surface objects Winged Edge Mesh, in short WEM. In this chapter you will get an introduction into WEMs. In addition, you will find examples on how to work with WEMs. For more information on WEMs take a look at the MeVislab Toolbox Reference . If you like to know which WEM formats can be imported into MeVisLab, take a look at the assimp documentation here.
Surface Example 1: Creation of WEMs
Surface Example 1: Create Winged Edge Mesh out of voxel images and CSOs
Introduction
In this example you will learn how to create a Winged Edge Mesh (WEM). There are several approaches on creating WEMs, a few of them are shown in this example. Instead of creating WEMs, they can also be imported, see chapter Surface Objects (WEM).
Steps to do
From image to surface: Generating WEMs out of voxel images
At first, we will create a WEM out of a voxel image using the module WEMIsoSurface
. Add and connect the shown modules. Load the image $(DemoDataPath)/Bone.tiff and set the Iso Min. Value in the panel of WEMIsoSurface
to 1200. Tick the box Use image max. value. The module WEMIsoSurface
creates surface objects out of all voxels with an Iso value equal or above 1200 (and smaller than the image max value). The module SoWEMRenderer
can now be used to generate an Open Inventor scene, which can be displayed by the module SoExaminerViewer
.
Surface Example 2: Processing and Modification of WEM
Surface Example 2: Processing and Modification of WEM
Introduction
In this example, you will learn how to modify and process WEMs.
Steps to do
Develop your network
Modification of WEMs
Use the module WEMLoad
to load the file venus.off. Then add and connect the shown modules. We like to display the WEM venus two times, one time this WEM is modified. You can use the module WEMModify
to apply modifications. In its panel, change the scale and the size of the WEM. Now you see two times the venus
next to each other.
Surface Example 3: Interactions with WEM
Surface Example 3: Interactions with WEM
Introduction
In these examples, we are showing 2 different possibilities to interact with a WEM:
- Scale, rotate and move a WEM in a scene
- Modify a WEM in a scene
Scale, rotate and move a WEM in a scene
We are using a SoTransformerDragger
module to apply transformations on a 3D WEM object via mouse interactions.
Surface Example 4: Interactively moving WEM
Surface Example 4: Interactively moving WEM
Introduction
In this example, we like to interactively move WEMs using SoDragger
modules insight a viewer.
Develop your network
Interactively translating objects in 3D using SoDragger modules
Add and connect the following modules as shown. In the panel of the module WEMInitialize
select the Model Octasphere. After that, open the viewer SoExaminerViewer
and make sure to select the Interaction Mode. Now, you are able to click on the presented Octaspehere and move it alongside one axis. The following modules are involved in the interactions:
Surface Example 5: WEM - Primitive Value Lists
Surface Example 5: WEM - Primitive Value Lists
Introduction
WEMs do not only contain the coordinates of nodes and surfaces, they can also contain additional information. These information are stored in so called Primitive Value Lists (PVLs). Every node, every surface and every edge can contains such a list. In these lists, you can for example store the color of the node or specific patient information. These information can be used for visualization or for further statistical analysis.
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.