MCPcopy Create free account
hub / github.com/MITK/MITK / main

Function main

Examples/Tutorial/Step4/Step4.cpp:42–160  ·  view source on GitHub ↗

#Documentation # @brief Use several views to explore data # # As in Step2 and Step3, load one or more data sets (many image, # surface and other formats), but create 3 views on the data. # The QmitkRenderWindow is used for displaying a 3D view as in Step3, # but without volume-rendering. # Furthermore, we create two 2D views for slicing through the data. # We use the class QmitkSliceWidget, which

Source from the content-addressed store, hash-verified

40//## The two slices are also shown at their correct position in 3D as
41//## well as intersection-line, each in the other 2D view.
42int main(int argc, char *argv[])
43{
44 QApplication qtapplication(argc, argv);
45
46 if (argc < 2)
47 {
48 fprintf(
49 stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str());
50 return 1;
51 }
52
53 // Register Qmitk-dependent global instances
54 QmitkRegisterClasses();
55
56 //*************************************************************************
57 // Part I: Basic initialization
58 //*************************************************************************
59
60 // Create a DataStorage
61 mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New();
62
63 //*************************************************************************
64 // Part II: Create some data by reading files
65 //*************************************************************************
66 int i;
67 for (i = 1; i < argc; ++i)
68 {
69 // For testing
70 if (strcmp(argv[i], "-testing") == 0)
71 continue;
72
73 //*********************************************************************
74 // Part III: Put the data into the datastorage
75 //*********************************************************************
76 // Load datanode (eg. many image formats, surface formats, etc.)
77 mitk::IOUtil::Load(argv[i], *ds);
78 }
79
80 //*************************************************************************
81 // Part IV: Create windows and pass the tree to it
82 //*************************************************************************
83
84 // Create toplevel widget with horizontal layout
85 QWidget toplevelWidget;
86 QHBoxLayout layout;
87 layout.setSpacing(2);
88 layout.setContentsMargins({});
89 toplevelWidget.setLayout(&layout);
90
91 //*************************************************************************
92 // Part IVa: 3D view
93 //*************************************************************************
94
95 // Create a renderwindow
96 QmitkRenderWindow renderWindow(&toplevelWidget);
97 layout.addWidget(&renderWindow);
98
99 // Tell the renderwindow which (part of) the datastorage to render

Callers

nothing calls this directly

Calls 13

QmitkRegisterClassesFunction · 0.85
LoadFunction · 0.85
SetLevelWindowEnabledMethod · 0.80
GetSubsetMethod · 0.80
showMethod · 0.80
NewFunction · 0.50
SetDataStorageMethod · 0.45
GetRendererMethod · 0.45
SetMapperIDMethod · 0.45
GetVtkRendererMethod · 0.45
SetDataMethod · 0.45
BeginMethod · 0.45

Tested by

no test coverage detected