#include <mitkPythonContext.h>
Definition at line 24 of file mitkPythonContext.h.
◆ PythonContext()
mitk::PythonContext::PythonContext |
( |
const std::string & |
venvName = {} | ) |
|
|
explicitprotected |
◆ ~PythonContext()
mitk::PythonContext::~PythonContext |
( |
| ) |
|
|
protected |
◆ Activate()
void mitk::PythonContext::Activate |
( |
| ) |
|
Imports essential python packages: numpy, os, sys, io and pyMITK. Also adds current bin folder to path.
◆ ExecuteFile()
std::string mitk::PythonContext::ExecuteFile |
( |
const std::string & |
filePath | ) |
|
Executes the given python file in the current context defined by globals
(m_GlobalDictionary) & locals
(m_LocalDictionary)
◆ ExecuteString()
std::string mitk::PythonContext::ExecuteString |
( |
const std::string & |
pyCommands | ) |
|
Executes the given python syntax in the current context defined by globals
(m_GlobalDictionary) & locals
(m_LocalDictionary) namespaces.
◆ GetPythonExceptionTraceback()
std::string mitk::PythonContext::GetPythonExceptionTraceback |
( |
| ) |
|
Returns any exception stacktrace occured in python as string back to MITK.
◆ GetStdOut()
std::string mitk::PythonContext::GetStdOut |
( |
const std::string & |
varName = "_mitk_stdout" | ) |
|
◆ GetVariableAs() [1/4]
template<>
MITKPYTHON_EXPORT std::optional<bool> mitk::PythonContext::GetVariableAs |
( |
const std::string & |
| ) |
|
◆ GetVariableAs() [2/4]
template<>
MITKPYTHON_EXPORT std::optional<int> mitk::PythonContext::GetVariableAs |
( |
const std::string & |
| ) |
|
◆ GetVariableAs() [3/4]
template<>
MITKPYTHON_EXPORT std::optional<double> mitk::PythonContext::GetVariableAs |
( |
const std::string & |
| ) |
|
◆ GetVariableAs() [4/4]
template<typename T >
std::optional<T> mitk::PythonContext::GetVariableAs |
( |
const std::string & |
varName | ) |
|
◆ HasVariable()
bool mitk::PythonContext::HasVariable |
( |
const std::string & |
varName | ) |
|
Check if given variable exists in the current context defined by globals
(m_GlobalDictionary) & locals
(m_LocalDictionary) namespaces.
◆ LoadImageFromPython()
mitk::Image* mitk::PythonContext::LoadImageFromPython |
( |
const std::string & |
varName | ) |
|
◆ mitkClassMacroItkParent()
mitk::PythonContext::mitkClassMacroItkParent |
( |
PythonContext |
, |
|
|
itk::LightObject |
|
|
) |
| |
◆ mitkNewMacro1Param()
mitk::PythonContext::mitkNewMacro1Param |
( |
Self |
, |
|
|
const std::string & |
|
|
) |
| |
◆ New()
static Pointer mitk::PythonContext::New |
( |
| ) |
|
|
static |
◆ TransferBaseDataToPython()
void mitk::PythonContext::TransferBaseDataToPython |
( |
mitk::BaseData * |
mitkImage, |
|
|
const std::string & |
varName = "_mitk_image" |
|
) |
| |
Creates view of mitk::BaseData pointer in MITK into corresponding SWIG proxy type object in Python.
The documentation for this class was generated from the following file: