Medical Imaging Interaction Toolkit  2018.4.99-86eb38db
Medical Imaging Interaction Toolkit
MITK Tutorial - Step 3: Create 3D view

As in the previous step, one or more data sets (many images, surface and other formats) may be loaded. The difference is that they are displayed in a 3D view. The QmitkRenderWindow is now used for displaying a 3D view, by setting the used mapper-slot to Standard3D. Since volume-rendering is a (rather) slow procedure, the default is that images are not displayed in the 3D view.

  • Step 3a works for default condition for surface mesh. To run this tutorial with Step 3a, pass the argument as "lungs.vtk" (without quotes).
  • Step 3b works for surface mesh with volume rendering. To run this tutorial with Step 3b, pass the arguments as "Pic3D.nrrd lungs.vtk" (without quotes).

Step 3a - Volume rendering turned off

step3a_result.png

Tell the renderer to create a 3D view:

// Use it as a 3D view!

The rest of the code remains unchanged.

The picture above shows the result of the program when reading both the image and the surface file. As volume rendering is off the image is not visible.

Step 3b - Volume rendering turned on

step3b_result.png

Volume Rendering is now turned on as shown in the picture above.

The property "volumerendering" has to be enabled on the node containing the image.

// Check if the data is an image by dynamic_cast-ing the data
// contained in the node. Warning: dynamic_cast's are rather slow,
// do not use it too often!
mitk::Image::Pointer image = dynamic_cast<mitk::Image *>(node->GetData());
if (image.IsNotNull())
{
// Set the property "volumerendering" to the Boolean value "true"
node->SetProperty("volumerendering", mitk::BoolProperty::New(true));

[Previous step] [Next step] [Main tutorial page]