3D
Chapter II: Open Inventor
Open Inventor modules
Introduction
In total, there are three types of modules:
- blue ML modules
- brown macro modules
- green Open Inventor modules
The names of Open Inventor modules start with the prefix So\*
(for Scene Objects). Open Inventor modules process and render 3D scene objects and enable image interactions. Scene objects are transmitted using the semi-circle shaped input and output connectors. With the help of these modules, Open Inventor scenes can be implemented.
Example 1: Open Inventor Objects
Example 1: Open Inventor Objects
Introduction
In this example we like to construct an Open Inventor scene in which we display three 3D objects of different color and shape.
Steps to do
Generating Open Inventor Objects
First, add the modules SoExaminerViewer
and SoCone
to the workspace and connect both modules as shown. The module SoCone
creates a cone shaped object, which can be displayed in the Viewer SoExaminerViewer
.
Example 2: Mouse interactions in Open Inventor
Example 2: Mouse interactions in Open Inventor
Introduction
In this example, we implement some image or object interactions. We will create a 3D scene, in which we display a cube and change its size using the mouse. We also get to know another viewer, the module SoExaminerViewer
. This viewer is important. It enables the rendering of Open Inventor scenes and allows interactions with the Open Inventor scenes.
Example 3: Camera Interactions in Open Inventor
Example 3: Camera Interactions in Open Inventor
Introduction
In this example, we are learning the basic principles of camera interactions in Open Inventor. We will show the difference between a SoRenderArea
and a SoExaminerViewer
and use different modules of the SoCamera*
group.
The SoRenderArea
module
The module SoRenderArea
is a simple renderer for Open Inventor scenes. It offers functionality to record movies and to create snapshots, but does not include an own camera or light.
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 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.
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.
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 lightning 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 MeVisLab Path Tracer. You will visualize the same scene using both 3D rendering techniques and some of the modules for path tracing.
The MeVis Path Tracer requires an NVIDIA graphics card with CUDA support. In order to check your hardware, open MeVisLab and add a SoPathTracer
module to your workspace. You will see a message if your hardware does not support CUDA:
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 PathTracer to generate enhanced renderings.
The MeVis Path Tracer requires an NVIDIA graphics card with CUDA support. In order to check your hardware, open MeVisLab and add a SoPathTracer
module to your workspace. You will see a message if your hardware does not support CUDA:
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.
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 be recording 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.
Example 4: Subtract 3D objects
Example 4: Subtract 3D objects
Introduction
In this example, we load an image and render it as WEMIsoSurface
. Then we create a 3-dimensional SoSphere
and subtract the sphere from the initial WEM.
Steps to do
Develop your network
Add a LocalImage
module to your workspace and select load $(DemoDataPath)/BrainMultiModal/ProbandT1.dcm. Add a WEMIsoSurface
, a SoWEMRenderer
, a SoBackground
and a SoExaminerViewer
module and connect them as seen below. Make sure to configure the WEMIsoSurface
to use a Iso Min. Value of 420 and a Voxel Sampling 1.
Example 5: Clip Planes
Example 5: Clip Planes
Introduction
In this example, we are using the SoGVRDrawOnPlane
module to define the currently visible slice from a 2D view as a clip plane in 3D.
Steps to do
Develop your network
First we need to develop the network to scroll through the slices. Add a LocalImage
module to your workspace and select the file ProbandT1 from MeVisLab demo data.
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 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.
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.
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.
assimp
Asset-Importer-Lib (assimp)
Introduction
Assimp (Asset-Importer-Lib) is a library to load and process geometric scenes from various 3D data formats.
This chapter provides some examples of how 3D formats can be imported into MeVisLab. In general you always need a SoSceneLoader
module. The SoSceneLoader
allows to load meshes as Open Inventor points/lines/triangles/faces using the Open Asset Import Library.
You can also use the SoSceneWriter
module to export your 3D scenes from MeVisLab into any of the output formats listed below.
Example 1: 3D Printing in MeVisLab
Example 1: 3D Printing in MeVisLab
Introduction
This example uses the assimp library to load a 3D file and save the file as *.stl for 3D printing.
Steps to do
Develop your network
Add the modules SoSceneLoader
, SoBackground
and SoExaminerViewer
to your workspace and connect them as seen below.
Open the 3D file
Select the file vtkCow.obj from MeVisLab demo data directory. Open SoExaminerViewer
and inspect the scene. You will see a 3D cow.