Extensible Visualization Component

From user's Wiki!
Jump to: navigation, search

Some advanced visualization libraries are required to visualize specific data. For example CMGUI library developed by The University of Auckland. GIMIAS kernel doesn't provide any visualization by default. The two main visualizations available are MITK and CMGUI. This feature allows visualizing the same data object in two different views at the same time and synchronize the visualization of the object, with an automatic camera configuration. For example a surface mesh can be visualized in a 3D VTK and CMGUI view at the same time. You can find a video here.

The main class of this component is the RenderingTree that manages the rendering of all data objects loaded into memory. This class should be extended by a plugin in order to provide a specific visualization. Another class is RenderWindowBase, responsible of rendering the DataEntity instances. Finally, the class RenderWindowContainer can be used to hold multiple render windows and manage them.

Combining this feature with Extensible Data Component, allows rendering a vtkPolyData object in a CMGUI view and in a MITK view. When the vtkPolyData needs to be rendered in a CMGUI view, a new CMGUI region object will be created and added to the rendering list.

Note that if the DataEntity processing data contains a CMGUI region and the user renders it in a CMGUI view, there's no need to create a new rendering data object. The rendering tree will get the processing data directly. However, if the user renders this DataEntity in a MITK rendering tree, a new vtkPolyData will be created using Extensible Data Component.

The place where the objects are rendered is called Working Area. A working area can contain render windows combined with any kind of custom window and buttons. A set of default working areas is available: ortho slice, multi slice, two 3D views and 3 slice planes.

A working area with a CMGUI and a MITK view

Rendering Tags

DataEntityMetadata store rendering properties. These properties will be used when adding the DataEntity to a RenderingTree and when saving the data to disk. This information is saved using XML format.

The allowed tags are: bool, std::string, float, double, char, unsigned char, short, unsigned short, int, unsigned int, long, unsigned long and blTagMap::Pointer.

 <?xml version="0" ?>
 <tagmap size="1">
     <tag name="Rendering" type="class blSmartPointer<class blTagMap>">Unsupported value type
         <tagmap size="16">
             <tag name="binary" type="bool">0</tag>
             <tag name="blLookupTablesType" type="int">9</tag>
             <tag name="bounding box" type="bool">0</tag>
             <tag name="dataEntityID" type="int">1</tag>
             <tag name="dataType" type="int">2</tag>
             <tag name="in plane resample extent by geometry" type="bool">0</tag>
             <tag name="layer" type="int">0</tag>
             <tag name="name" type="std::string">1 - 1#SmallImage (Volume image, -)</tag>
             <tag name="opacity" type="float">1.0000</tag>
             <tag name="outline binary" type="bool">0</tag>
             <tag name="outline width" type="float">1.0000</tag>
             <tag name="renderingId" type="int">1</tag>
             <tag name="texture interpolation" type="bool">1</tag>
             <tag name="use color" type="bool">0</tag>
             <tag name="visible" type="bool">1</tag>
             <tag name="volumerendering" type="bool">0</tag>
         </tagmap>
     </tag>
 </tagmap>
 


Loaded session with different rendering properties automatically restored like surface mesh opacity

UML class diagram and source code

You can read more details in GmKernel#RenderingTree and see example implementations in MITK Plugin and CMGUI Plugin.

Go back to GIMIAS Architecture