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

Method OnAddPositivePoint

Modules/Segmentation/src/Interactions/mitkMonaiLabelTool.cpp:106–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void mitk::MonaiLabelTool::OnAddPositivePoint(StateMachineAction *, InteractionEvent *interactionEvent)
107{
108 if (nullptr == m_RequestParameters || !m_RequestParameters->model.IsInteractive())
109 {
110 return;
111 }
112
113 if (m_RequestParameters->model.Is2D() && ((nullptr == this->GetWorkingPlaneGeometry()) ||
114 !mitk::Equal(*(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()),
115 *(this->GetWorkingPlaneGeometry()))))
116 {
117 this->ClearSeeds();
118 this->SetWorkingPlaneGeometry(interactionEvent->GetSender()->GetCurrentWorldPlaneGeometry()->Clone());
119 this->ResetPreviewContent();
120 }
121 if (!this->IsUpdating() && m_PointSetPositive.IsNotNull())
122 {
123 const auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent);
124 if (positionEvent != nullptr)
125 {
126 m_PointSetPositive->InsertPoint(m_PointSetCount, positionEvent->GetPositionInWorld());
127 ++m_PointSetCount;
128 this->UpdatePreview();
129 }
130 }
131}
132
133void mitk::MonaiLabelTool::OnAddNegativePoint(StateMachineAction *, InteractionEvent *interactionEvent)
134{

Callers

nothing calls this directly

Calls 12

ClearSeedsMethod · 0.95
IsInteractiveMethod · 0.80
Is2DMethod · 0.80
GetSenderMethod · 0.80
ResetPreviewContentMethod · 0.80
IsUpdatingMethod · 0.80
IsNotNullMethod · 0.80
InsertPointMethod · 0.80
GetPositionInWorldMethod · 0.80
UpdatePreviewMethod · 0.80
EqualFunction · 0.50
CloneMethod · 0.45

Tested by

no test coverage detected