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

Method AddNewLabelInstance

Modules/SegmentationUI/src/QmitkMultiLabelInspector.cpp:568–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

566}
567
568mitk::Label* QmitkMultiLabelInspector::AddNewLabelInstance()
569{
570 auto currentLabel = this->GetFirstSelectedLabelObject();
571 if (nullptr == currentLabel)
572 return nullptr;
573
574 auto result = this->AddNewLabelInstanceInternal(currentLabel);
575
576 // this is needed as workaround for (T27307). It circumvents the fact that modifications
577 // of data (here the segmentation) does not directly trigger the modification of the
578 // owning node (see T27307). Therefore other code (like renderers or model views) that e.g.
579 // listens to the datastorage for modification would not get notified.
580 if (m_SegmentationNode.IsNotNull())
581 {
582 m_SegmentationNode->Modified();
583 }
584
585 return result;
586}
587
588mitk::Label* QmitkMultiLabelInspector::AddNewLabelInternal(const mitk::MultiLabelSegmentation::GroupIndexType& containingGroup,
589 bool skipNamingPrompt)

Callers

nothing calls this directly

Calls 4

IsNotNullMethod · 0.80
ModifiedMethod · 0.45

Tested by

no test coverage detected