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

Method IsInstalled

Modules/PythonSegmentation/src/mitknnInteractiveTool.cpp:703–713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

701////////////////////////////////////////////////////////////////////////////////
702
703bool mitk::nnInteractiveTool::IsInstalled() const
704{
705 std::ostringstream pyCommands; pyCommands
706 << "import importlib.util\n"
707 << "is_installed = importlib.util.find_spec('nnInteractive') is not None\n";
708
709 auto pythonContext = m_Impl->GetPythonContext();
710 pythonContext->Execute(pyCommands.str());
711
712 return pythonContext->GetVariableAsBool("is_installed").value_or(false);
713}
714
715bool mitk::nnInteractiveTool::IsLocalInferenceAvailable() const
716{

Callers 1

InstallMethod · 0.80

Calls 3

GetVariableAsBoolMethod · 0.80
GetPythonContextMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected