Medical Imaging Interaction Toolkit  2023.04.00
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


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


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]

mitk::RenderWindowBase::GetRenderer
virtual mitk::VtkPropRenderer * GetRenderer()
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitk::VtkPropRenderer::SetMapperID
void SetMapperID(const MapperSlotId mapperId) override
Set the used mapperID.
mitk::DataNode::GetData
BaseData * GetData() const
Get the data object (instance of BaseData, e.g., an Image) managed by this DataNode.
mitk::BaseRenderer::Standard3D
@ Standard3D
Definition: mitkBaseRenderer.h:68
mitk::DataNode::SetProperty
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName="", bool fallBackOnDefaultContext=false) override
Add new or change existent property.
mitk::BoolProperty::New
static Pointer New()