| 1584 | } |
| 1585 | |
| 1586 | void 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 | |
| 1612 | void mitk::nnInteractiveTool::Impl::AddInitialSegInteraction(MultiLabelSegmentation* previewImage, TimeStepType timeStep) const |
| 1613 | { |
no test coverage detected