Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
Step7.cpp
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE.txt or http://www.mitk.org for details.
===================================================================*/
#include "Step7.h"
#include <mitkProperties.h>
#include <mitkSurface.h>
#include <vtkImageData.h>
#include <vtkMarchingCubes.h>
#include <vtkSTLWriter.h>
//##Documentation
//## @brief Convert result of region-grower into a surface
//## by means of a VTK filter
Step7::Step7(int argc, char *argv[], QWidget *parent) : Step6(argc, argv, parent)
{
}
{
std::cout << "7";
if (m_ResultImage.IsNotNull())
{
m_ResultNode->SetProperty("volumerendering", mitk::BoolProperty::New(false));
vtkMarchingCubes *surfaceCreator = vtkMarchingCubes::New();
surfaceCreator->SetInputData(m_ResultImage->GetVtkImageData());
surfaceCreator->SetValue(0, 1);
surfaceCreator->Update();
surface->SetVtkPolyData(surfaceCreator->GetOutput()); // VTK6_TODO
surfaceNode->SetData(surface);
m_DataStorage->Add(surfaceNode);
std::cout << "8";
surfaceCreator->Delete();
}
std::cout << "9";
}