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

Method AddLassoInteraction

Modules/PythonSegmentation/src/mitknnInteractiveTool.cpp:1586–1610  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1584}
1585
1586void mitk::nnInteractiveTool::Impl::AddLassoInteraction(const Image* mask, const InteractionBoundingBox* boundingBox) const
1587{
1588 m_PythonContext->BindImage(const_cast<Image*>(mask), "mitk_lasso_mask");
1589
1590 std::ostringstream pyCommands; pyCommands
1591 << "lasso_mask = mitk_lasso_mask.as_numpy()\n"
1592 << "session.add_lasso_interaction(\n"
1593 << " lasso_mask,\n"
1594 << " include_interaction=" << (this->PromptType == PromptType::Positive ? "True" : "False");
1595
1596 if (boundingBox != nullptr)
1597 {
1598 pyCommands
1599 << ",\n interaction_bbox=["
1600 << '[' << (*boundingBox)[0][0] << ',' << (*boundingBox)[0][1] << "],"
1601 << '[' << (*boundingBox)[1][0] << ',' << (*boundingBox)[1][1] << "],"
1602 << '[' << (*boundingBox)[2][0] << ',' << (*boundingBox)[2][1] << "]]";
1603 }
1604
1605 pyCommands << '\n'
1606 << ")\n"
1607 << "del lasso_mask\n";
1608
1609 this->ExecuteSession(pyCommands.str());
1610}
1611
1612void mitk::nnInteractiveTool::Impl::AddInitialSegInteraction(MultiLabelSegmentation* previewImage, TimeStepType timeStep) const
1613{

Callers 1

DoUpdatePreviewMethod · 0.80

Calls 2

BindImageMethod · 0.80
ExecuteSessionMethod · 0.80

Tested by

no test coverage detected