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 semicircle-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 them 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, …). 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.

Example 4: Subtracting 3D Surface Objects

Example 4: Subtracting 3D Objects

Introduction

In this example, we load an image and render it as WEMIsoSurface. Then, we create a three-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 of 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 predefined data objects, for example:

Usage, advantages, and disadvantages of each above-mentioned data object type will be covered in the following chapters, where you will build 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 viewer.

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 a voxel image.

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 of creating WEMs, a few of them are shown in this example.Additionally to 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 checkbox Use image max. value. The module WEMIsoSurface creates surface objects out of all voxels with an isovalue equal or above 1200 (and smaller than the image’s maximum 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 Modifying 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 two different possibilities to interact with the visualization of the WEM:

  • Scale, rotate, and move a WEM’s visualization 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 to the visualization of 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 inside a viewer.

Develop Your Network

Interactively Translating Objects in 3D Using SoDragger Modules

Add and connect the following modules as shown. On 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 Left Mouse Button on the presented Octasphere 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, they can also contain additional information. That information is stored in so-called Primitive Value Lists (PVLs). Every node, every edge, and every faces can contain such a list. In these lists, you can, for example, store the color of the node or specific patient information. This 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 choose 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.

SoSceneLoader

SoSceneLoader

You can also use the SoSceneWriter module to export your 3D scenes from MeVisLab in a number of output formats.

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.

Example network

Example network

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.