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

Method OnFinish

Modules/Segmentation/src/Interactions/mitkEditableContourTool.cpp:308–341  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308void mitk::EditableContourTool::OnFinish(StateMachineAction *, InteractionEvent *interactionEvent)
309{
310 auto positionEvent = dynamic_cast<mitk::InteractionPositionEvent *>(interactionEvent);
311
312 if (nullptr == positionEvent)
313 return;
314
315 if (m_PlaneGeometry.IsNotNull())
316 {
317 // Check if the point is in the correct slice
318 if (m_PlaneGeometry->DistanceFromPlane(positionEvent->GetPositionInWorld()) > mitk::sqrteps)
319 return;
320 }
321
322 this->FinalizePreviewContour(positionEvent->GetPositionInWorld());
323
324 this->FinishTool();
325
326 // Merge contours
327 auto contour = this->GetContour();
328 contour->Concatenate(m_PreviewContour);
329
330 auto numberOfTimesteps = static_cast<int>(contour->GetTimeSteps());
331
332 for (int i = 0; i <= numberOfTimesteps; ++i)
333 contour->Close(i);
334
335 this->ReleaseHelperObjects(false);
336
337 if (m_AutoConfirm)
338 {
339 this->ConfirmSegmentation();
340 }
341}
342
343bool mitk::EditableContourTool::OnCheckPlane(const InteractionEvent* interactionEvent)
344{

Callers

nothing calls this directly

Calls 11

GetContourMethod · 0.95
ReleaseHelperObjectsMethod · 0.95
ConfirmSegmentationMethod · 0.95
IsNotNullMethod · 0.80
DistanceFromPlaneMethod · 0.80
GetPositionInWorldMethod · 0.80
GetTimeStepsMethod · 0.80
FinishToolMethod · 0.45
ConcatenateMethod · 0.45
CloseMethod · 0.45

Tested by

no test coverage detected