CMGUI Plugin

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

Added the possibility to use multiple rendering libraries. Now GIMIAS supports MITK and CMGUI.

CMGUI view with CMGUI regions

You can visualize the same data object in different views at the same time.

At the left, CMGUI view with a surface mesh. A the right, a CMGUI mesh in a MITK view

For users

Integrated CMGUI regions

CMGUI regions can be added to the data tree and used in any plug-in. You can show/hide the region and unload it. To read the regions you can use three readers:

  • .exnode and .exelem files: Read .exnode and .exelem files. If you open several files, these will be opened as time steps
  • Mechanical Simulation reader: Open .msml files. This files are XML files with this format:
<?xml version="1.0" encoding="UTF-8"?>
<MechanicalSimulation>
    <Files>
        <Nodes>
            <Scheme name="ResultFiles/LVwp5D8_10Steps_step_%%%STEP%%%.exnode" rangeMin="1" rangeMax="21" />
        </Nodes>
        <Elements>
            <File>ResultFiles/LVwp5D8_10Steps_step_001.exelem</File>
        </Elements>
    </Files>
    <Camera/>
</MechanicalSimulation>
  • Mesh Fitting Reader: Open .fitml files. This files have this format:
<?xml version="1.0" encoding="UTF-8"?>
<MeshFitting>
    <Mask>
        <File>ResultFiles/Mask image_Isosurface.exnode</File>
        <File>ResultFiles/Mask image_Isosurface.exelem</File>
    </Mask>
    <Fitting>
        <File>ResultFiles/Mask image_eD8_ss222_fitted2LV2b_byM2_Vfit0.exnode</File>
        <File>ResultFiles/Mask image_eD8_ss222_fitted2LV2b_byM2_Vfit0.exelem</File>
    </Fitting>
    <Camera/>
</MeshFitting>

CMGUI view

CMGUI view allows visualizing the data. The view can visualize CMGUI regions and CMGUI images.

A working area with a CMGUI and a MITK view

This render window is integrated with working area. You can create your own working area combining CMGUI render window and MITK render window at the same time.

Link views in time and position

Is possible to link the different views of a single working area in time and position. When you rotate, pan or zoom one view, the rest of the views will be updated automatically. This allows to visualize different objects in different views.

A CMGUI region in two different time values

You can use the movie toolbar for time navigation.

Visualize images

You can visualize 3D images. Images are automatically converted from VTK to CMGUI image for rendering.

VTK image and CMGUI region in a CMGUI view

You can use the visual properties widget to show/hide image slices using a checkbox.

DICOM slices with different orientation in a CMGUI view

You can visualize DICOM slice images with different orientation. You need to use the DICOM plugin and select the option “Export Raw Data”.

Dynamic CMGUI toolbar

Added a dynamic CMGUI command toolbar. At start up, the toolbar will search “.com” files in a CMGUIPlugin folder and will create toolbar tools at runtime. When the user presses a tool, the “.com” file will be executed.

The folder to search for “.com” files is “plugins\cmguiplugin\lib\release\Toolbar”. For each “.com” file you need to supply a “.png” file that will be used for the tool image.

Currently there’s one example called sphere_blue.com and sphere_blue.png.

Dynamic CMGUI toolbar with a blue sphere tool.

The user presses the blue sphere tool, this “.com” file will be executed:

gfx create material blue alpha 1
gfx modify g_element ${region} surfaces material blue scene ${scene}
gfx define face egroup ${region}

You can also use the command line widget to execute CMGUI commands manually or load a “.com” file from disk.

For developers

The plug-in contains:

  • BaseDataEntityReader: Three readers: ExnodeExelemReader, MechanicalSimulationReader, MeshFittingReader.
  • DataEntityImpl: CMGUI region and image. Implemented CmguiRegionImpl::GetData( ) and CmguiRegionImpl::SetData( ) interface that allows to convert it to other surface meshes. Implemented CmguiImageImpl::SetData( ) that allows to convert other data types to CmguiImageImpl.
  • MultiRenderWindow: Render window that renders CMGUI region and images
  • Toolbar: dynamic toolbar to load .com files

Go back to Users