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

Method OnAddLabel

Modules/SegmentationUI/src/QmitkMultiLabelInspector.cpp:1445–1464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1443}
1444
1445void QmitkMultiLabelInspector::OnAddLabel()
1446{
1447 auto currentIndex = this->m_Controls->view->currentIndex();
1448 auto groupIDVariant = currentIndex.data(QmitkMultiLabelTreeModel::ItemModelRole::GroupIDRole);
1449
1450 if (groupIDVariant.isValid())
1451 {
1452 auto groupID = groupIDVariant.value<mitk::MultiLabelSegmentation::GroupIndexType>();
1453 this->AddNewLabelInternal(groupID);
1454
1455 // this is needed as workaround for (T27307). It circumvents the fact that modifications
1456 // of data (here the segmentation) does not directly trigger the modification of the
1457 // owning node (see T27307). Therefore other code (like renderers or model views) that e.g.
1458 // listens to the datastorage for modification would not get notified.
1459 if (m_SegmentationNode.IsNotNull())
1460 {
1461 m_SegmentationNode->Modified();
1462 }
1463 }
1464}
1465
1466void QmitkMultiLabelInspector::OnAddLabelInstance()
1467{

Callers

nothing calls this directly

Calls 4

AddNewLabelInternalMethod · 0.95
IsNotNullMethod · 0.80
dataMethod · 0.45
ModifiedMethod · 0.45

Tested by

no test coverage detected