Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitk::PythonService Class Reference

#include <mitkPythonService.h>

Inheritance diagram for mitk::PythonService:
Collaboration diagram for mitk::PythonService:

Public Member Functions

 PythonService ()
 instantiate python manager here More...
 
 ~PythonService ()
 empty implementation... More...
 
std::string Execute (const std::string &pythonCommand, int commandType=SINGLE_LINE_COMMAND)
 
void ExecuteScript (const std::string &pathToPythonScript)
 
bool PythonErrorOccured () const
 
std::vector< PythonVariableGetVariableStack () const
 
bool DoesVariableExist (const std::string &name) const
 
void AddPythonCommandObserver (PythonCommandObserver *observer)
 
void RemovePythonCommandObserver (PythonCommandObserver *observer)
 
void NotifyObserver (const std::string &command)
 
bool IsSimpleItkPythonWrappingAvailable ()
 
bool CopyToPythonAsSimpleItkImage (mitk::Image *image, const std::string &varName)
 
mitk::Image::Pointer CopySimpleItkImageFromPython (const std::string &varName)
 
bool IsOpenCvPythonWrappingAvailable ()
 
bool CopyToPythonAsCvImage (mitk::Image *image, const std::string &varName)
 
mitk::Image::Pointer CopyCvImageFromPython (const std::string &varName)
 
bool IsVtkPythonWrappingAvailable ()
 
bool CopyToPythonAsVtkPolyData (mitk::Surface *surface, const std::string &varName)
 
mitk::Surface::Pointer CopyVtkPolyDataFromPython (const std::string &varName)
 
ctkAbstractPythonManager * GetPythonManager ()
 
- Public Member Functions inherited from mitk::IPythonService
virtual ~IPythonService ()
 nothing to do here More...
 

Protected Member Functions

QString GetTempDataFileName (const std::string &ext) const
 

Additional Inherited Members

- Static Public Member Functions inherited from mitk::IPythonService
static std::string ForceLoadModule ()
 
- Static Public Attributes inherited from mitk::IPythonService
static const int SINGLE_LINE_COMMAND
 
static const int MULTI_LINE_COMMAND
 
static const int EVAL_COMMAND
 

Detailed Description

implementation of the IPythonService using ctkabstractpythonmanager

See also
IPythonService

Definition at line 29 of file mitkPythonService.h.

Constructor & Destructor Documentation

mitk::PythonService::PythonService ( )

instantiate python manager here

Definition at line 40 of file mitkPythonService.cpp.

References mitk::IOUtil::GetProgramPath(), MITK_DEBUG, and mitkThrow.

mitk::PythonService::~PythonService ( )

empty implementation...

Definition at line 150 of file mitkPythonService.cpp.

References MITK_DEBUG.

Member Function Documentation

void mitk::PythonService::AddPythonCommandObserver ( mitk::PythonCommandObserver observer)
virtual
mitk::Image::Pointer mitk::PythonService::CopySimpleItkImageFromPython ( const std::string &  varName)
virtual
See also
IPythonService::CopyItkImageFromPython()

Implements mitk::IPythonService.

Definition at line 564 of file mitkPythonService.cpp.

References DeterminePixelType(), MITK_DEBUG, mitk::IPythonService::MULTI_LINE_COMMAND, and mitk::Image::New().

bool mitk::PythonService::CopyToPythonAsCvImage ( mitk::Image image,
const std::string &  varName 
)
virtual
See also
IPythonService::CopyToPythonAsCvImage()

Build a string in the format [1024,1028,1] to describe the dimensionality. This is needed for simple itk to know the dimensions of the image

Implements mitk::IPythonService.

Definition at line 679 of file mitkPythonService.cpp.

References mitk::PixelType::GetComponentType(), mitk::ImageAccessorBase::GetData(), mitk::Image::GetDimensions(), mitk::PixelType::GetNumberOfComponents(), mitk::Image::GetPixelType(), MITK_DEBUG, MITK_WARN, and mitk::IPythonService::MULTI_LINE_COMMAND.

bool mitk::PythonService::CopyToPythonAsSimpleItkImage ( mitk::Image image,
const std::string &  varName 
)
virtual
bool mitk::PythonService::CopyToPythonAsVtkPolyData ( mitk::Surface surface,
const std::string &  varName 
)
virtual
mitk::Surface::Pointer mitk::PythonService::CopyVtkPolyDataFromPython ( const std::string &  varName)
virtual
bool mitk::PythonService::DoesVariableExist ( const std::string &  name) const
virtual
See also
IPythonService::DoesVariableExist()

Implements mitk::IPythonService.

Definition at line 232 of file mitkPythonService.cpp.

std::string mitk::PythonService::Execute ( const std::string &  pythonCommand,
int  commandType = SINGLE_LINE_COMMAND 
)
virtual
void mitk::PythonService::ExecuteScript ( const std::string &  pathToPythonScript)
virtual
See also
IPythonService::ExecuteScript()

Implements mitk::IPythonService.

Definition at line 189 of file mitkPythonService.cpp.

ctkAbstractPythonManager * mitk::PythonService::GetPythonManager ( )
virtual
Returns
the ctk abstract python manager instance

Implements mitk::IPythonService.

Definition at line 843 of file mitkPythonService.cpp.

QString mitk::PythonService::GetTempDataFileName ( const std::string &  ext) const
protected

Definition at line 269 of file mitkPythonService.cpp.

std::vector< mitk::PythonVariable > mitk::PythonService::GetVariableStack ( ) const
virtual
bool mitk::PythonService::IsOpenCvPythonWrappingAvailable ( )
virtual
bool mitk::PythonService::IsSimpleItkPythonWrappingAvailable ( )
virtual
See also
IPythonService::IsItkPythonWrappingAvailable()

Implements mitk::IPythonService.

Definition at line 916 of file mitkPythonService.cpp.

References MITK_ERROR, and mitk::IPythonService::SINGLE_LINE_COMMAND.

bool mitk::PythonService::IsVtkPythonWrappingAvailable ( )
virtual
void mitk::PythonService::NotifyObserver ( const std::string &  command)
virtual
See also
IPythonService::NotifyObserver()

Implements mitk::IPythonService.

Definition at line 260 of file mitkPythonService.cpp.

References MITK_DEBUG.

bool mitk::PythonService::PythonErrorOccured ( ) const
virtual
void mitk::PythonService::RemovePythonCommandObserver ( mitk::PythonCommandObserver observer)
virtual

The documentation for this class was generated from the following files: