Page MenuHomePhabricator

QmitkColourImageProcessingView does not work when loading another example
Closed, ResolvedPublic

Description

The workbench crashes when opening QmitkColourImageProcessingView and then loading another example. The problem is that in the following code

    foreach (const mitk::DataNode::Pointer node, nodes)
    {
      if (node.IsNotNull())
      {
        mitk::Image *image = dynamic_cast<mitk::Image *>(node->GetData());

			if (image->GetDimension() >= 3)
			{
				selectedNodes.push_back(node);
			}
      }
    }

image is a nullpointer. It has to be changed in the following way:

    foreach (const mitk::DataNode::Pointer node, nodes)
    {
      if (node.IsNotNull())
      {
        mitk::Image *image = dynamic_cast<mitk::Image *>(node->GetData());
		if (nullptr != image)
		{
			if (image->GetDimension() >= 3)
			{
				selectedNodes.push_back(node);
			}
		}
      }
    }

(QmitkColourImageProcessingView::OnSelectionChanged)

Event Timeline

kahl triaged this task as Normal priority.Apr 9 2018, 3:37 PM
kahl created this task.
goch closed this task as Resolved.Apr 13 2018, 9:41 AM
goch claimed this task.