Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
Step7.cpp
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #include "Step7.h"
18 
19 #include <QmitkRenderWindow.h>
20 #include <QmitkSliceWidget.h>
21 
22 #include <mitkProperties.h>
23 
24 #include <mitkRenderingManager.h>
25 #include <mitkSurface.h>
26 
27 #include <vtkImageData.h>
28 #include <vtkMarchingCubes.h>
29 #include <vtkSTLWriter.h>
30 
31 //##Documentation
32 //## @brief Convert result of region-grower into a surface
33 //## by means of a VTK filter
34 Step7::Step7(int argc, char *argv[], QWidget *parent) : Step6(argc, argv, parent)
35 {
36 }
38 {
40 
41  std::cout << "7";
42  if (m_ResultImage.IsNotNull())
43  {
44  m_ResultNode->SetProperty("volumerendering", mitk::BoolProperty::New(false));
45 
46  vtkMarchingCubes *surfaceCreator = vtkMarchingCubes::New();
47  surfaceCreator->SetInputData(m_ResultImage->GetVtkImageData());
48  surfaceCreator->SetValue(0, 1);
49  surfaceCreator->Update();
50 
52  surface->SetVtkPolyData(surfaceCreator->GetOutput()); // VTK6_TODO
53 
55  surfaceNode->SetData(surface);
56 
57  m_DataStorage->Add(surfaceNode);
58 
60  std::cout << "8";
61  surfaceCreator->Delete();
62  }
63 
64  std::cout << "9";
65 }
66 
virtual void StartRegionGrowing()
Definition: Step6.cpp:110
Definition: Step6.h:32
virtual void StartRegionGrowing() override
Definition: Step7.cpp:37
mitk::Image::Pointer m_ResultImage
Definition: Step6.h:54
Step7(int argc, char *argv[], QWidget *parent=nullptr)
Convert result of region-grower into a surface by means of a VTK filter.
Definition: Step7.cpp:34
static Pointer New()
static Pointer New()
static RenderingManager * GetInstance()
mitk::DataNode::Pointer m_ResultNode
Definition: Step6.h:55
static Pointer New()
void RequestUpdateAll(RequestType type=REQUEST_UPDATE_ALL)
mitk::StandaloneDataStorage::Pointer m_DataStorage
Definition: Step6.h:50
static itkEventMacro(BoundingShapeInteractionEvent, itk::AnyEvent) class MITKBOUNDINGSHAPE_EXPORT BoundingShapeInteractor Pointer New()
Basic interaction methods for mitk::GeometryData.