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

Method Initialize

Examples/Tutorial/Step6/Step6.cpp:46–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46void Step6::Initialize()
47{
48 // setup the widgets as in the previous steps, but with an additional
49 // QVBox for a button to start the segmentation
50 this->SetupWidgets();
51
52 // Create controlsParent widget with horizontal layout
53 QWidget *controlsParent = new QWidget(this);
54 this->layout()->addWidget(controlsParent);
55
56 QHBoxLayout *hlayout = new QHBoxLayout(controlsParent);
57 hlayout->setSpacing(2);
58
59 QLabel *labelThresholdMin = new QLabel("Lower Threshold:", controlsParent);
60 hlayout->addWidget(labelThresholdMin);
61
62 m_LineEditThresholdMin = new QLineEdit("-1000", controlsParent);
63 hlayout->addWidget(m_LineEditThresholdMin);
64
65 QLabel *labelThresholdMax = new QLabel("Upper Threshold:", controlsParent);
66 hlayout->addWidget(labelThresholdMax);
67
68 m_LineEditThresholdMax = new QLineEdit("-400", controlsParent);
69 hlayout->addWidget(m_LineEditThresholdMax);
70
71 // create button to start the segmentation and connect its clicked()
72 // signal to method StartRegionGrowing
73 QPushButton *startButton = new QPushButton("start region growing", controlsParent);
74 hlayout->addWidget(startButton);
75
76 connect(startButton, SIGNAL(clicked()), this, SLOT(StartRegionGrowing()));
77 if (m_FirstImage.IsNull())
78 startButton->setEnabled(false);
79
80 // as in Step5, create PointSet (now as a member m_Seeds) and
81 // associate a interactor to it
82
83 m_Seeds = mitk::PointSet::New();
84 mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New();
85 pointSetNode->SetData(m_Seeds);
86 pointSetNode->SetProperty("layer", mitk::IntProperty::New(2));
87 m_DataStorage->Add(pointSetNode);
88
89 // Create PointSetDataInteractor
90 mitk::PointSetDataInteractor::Pointer interactor = mitk::PointSetDataInteractor::New();
91 interactor->LoadStateMachine("PointSet.xml");
92 interactor->SetEventConfig("PointSetConfig.xml");
93 interactor->SetDataNode(pointSetNode);
94}
95
96int Step6::GetThresholdMin()
97{

Callers 6

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
ImageFromNumpyFunction · 0.45
InitImageFunction · 0.45

Calls 10

SetupWidgetsMethod · 0.95
LoadStateMachineMethod · 0.80
SetEventConfigMethod · 0.80
NewFunction · 0.50
IsNullMethod · 0.45
setEnabledMethod · 0.45
SetDataMethod · 0.45
SetPropertyMethod · 0.45
AddMethod · 0.45
SetDataNodeMethod · 0.45

Tested by

no test coverage detected