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

Method AddScribbleInteraction

Modules/PythonSegmentation/src/mitknnInteractiveTool.cpp:1560–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1558}
1559
1560void mitk::nnInteractiveTool::Impl::AddScribbleInteraction(const Image* mask, const InteractionBoundingBox* boundingBox) const
1561{
1562 m_PythonContext->BindImage(const_cast<Image*>(mask), "mitk_scribble_mask");
1563
1564 std::ostringstream pyCommands; pyCommands
1565 << "scribble_mask = mitk_scribble_mask.as_numpy()\n"
1566 << "session.add_scribble_interaction(\n"
1567 << " scribble_mask,\n"
1568 << " include_interaction=" << (this->PromptType == PromptType::Positive ? "True" : "False");
1569
1570 if (boundingBox != nullptr)
1571 {
1572 pyCommands
1573 << ",\n interaction_bbox=["
1574 << '[' << (*boundingBox)[0][0] << ',' << (*boundingBox)[0][1] << "],"
1575 << '[' << (*boundingBox)[1][0] << ',' << (*boundingBox)[1][1] << "],"
1576 << '[' << (*boundingBox)[2][0] << ',' << (*boundingBox)[2][1] << "]]";
1577 }
1578
1579 pyCommands << '\n'
1580 << ")\n"
1581 << "del scribble_mask\n";
1582
1583 this->ExecuteSession(pyCommands.str());
1584}
1585
1586void mitk::nnInteractiveTool::Impl::AddLassoInteraction(const Image* mask, const InteractionBoundingBox* boundingBox) const
1587{

Callers 1

DoUpdatePreviewMethod · 0.80

Calls 2

BindImageMethod · 0.80
ExecuteSessionMethod · 0.80

Tested by

no test coverage detected