diff --git a/CMake/PackageDepends/MITK_PythonLibs_Config.cmake b/CMake/PackageDepends/MITK_PythonLibs_Config.cmake
new file mode 100644
index 0000000000..11fb617c3e
--- /dev/null
+++ b/CMake/PackageDepends/MITK_PythonLibs_Config.cmake
@@ -0,0 +1,5 @@
+FIND_PACKAGE(PythonLibs REQUIRED)
+list(APPEND ALL_LIBRARIES ${PYTHON_LIBRARIES})
+#include_directories(${PYTHON_INCLUDE_DIRS})
+list(APPEND ALL_INCLUDE_DIRECTORIES ${PYTHON_INCLUDE_DIRS})
+#link_directories(${PYTHON_LIBRARIES})
diff --git a/Modules/MitkExt/Controllers/mitkIPythonService.h b/Modules/MitkExt/Controllers/mitkIPythonService.h
index bba15edce5..a99caa5cad 100644
--- a/Modules/MitkExt/Controllers/mitkIPythonService.h
+++ b/Modules/MitkExt/Controllers/mitkIPythonService.h
@@ -1,132 +1,135 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 #ifndef mitkIPythonService_h
 #define mitkIPythonService_h
 
 // mitk
 #include "MitkExtExports.h"
 #include "mitkImage.h"
 //for microservices
 #include <usServiceInterface.h>
 #include "mitkSurface.h"
 #include <vector>
 
 namespace mitk
 {
     ///
     /// describes a python variable (data container)
     /// \see IPythonService::GetVariableStack()
     ///
     struct PythonVariable
     {
       std::string m_Name;
       std::string m_Type;
       std::string m_Value;
     };
 
     ///
     /// a PythonCommandObserver gets informed as soon as a python command was issued
     /// \see IPythonService::AddPythonCommandObserver()
     ///
     class PythonCommandObserver
     {
     public:
       virtual void CommandExecuted(const std::string& pythonCommand) = 0;
     };
 
     ///
     /// The central service for issuing Python Code
     /// The class also enables to transfer mitk images to python as itk::Image and vice versa
     /// \see IPythonService::GetVariableStack()
     ///
     class MitkExt_EXPORT IPythonService
     {
     public:
         ///
         /// Constant representing a single line command
         /// \see IPythonService::Execute()
         static const int SINGLE_LINE_COMMAND = 0;
         ///
         /// Constant representing a command in which the commands are seperated by new lines, i.e. "\\n"
         /// \see IPythonService::Execute()
         static const int MULTI_LINE_COMMAND = 1;
         ///
         /// Constant representing a single line command x which is run as "eval(x)"
         /// \see IPythonService::Execute()
         static const int EVAL_COMMAND = 2;
 
         ///
         /// Executes a python command.
         /// \return A variant containing the return value as string of the python code (if any)
         virtual std::string Execute( const std::string& pythonCommand, int commandType = SINGLE_LINE_COMMAND ) = 0;
         ///
+        /// Executes a python script.
+        virtual void ExecuteScript( const std::string& pathToPythonScript ) = 0;
+        ///
         /// \return The list of variables in the __main__ namespace
         virtual std::vector<PythonVariable> GetVariableStack() const = 0;
         ///
         /// adds a command observer which is informed after a command was issued with "Execute"
         virtual void AddPythonCommandObserver( PythonCommandObserver* observer ) = 0;
         ///
         /// removes a specific command observer
         virtual void RemovePythonCommandObserver( PythonCommandObserver* observer ) = 0;
         ///
         /// notify all observer. this should only be used if it can be garantueed that the
         /// current python interpreter instance got another command from anywhere else
         /// the the Execute() method of this service, e.g. the shell widget uses this function
         /// since it does not use Execute()
         virtual void NotifyObserver( const std::string& command ) = 0;
 
         ///
         /// \return true, if itk wrapping is available, false otherwise
         virtual bool IsItkPythonWrappingAvailable() = 0;
         ///
         /// copies an mitk image as itk image into the python interpreter process
         /// the image will be available as "varName" in python if everythin worked
         /// \return true if image was copied, else false
         virtual bool CopyToPythonAsItkImage( mitk::Image* image, const std::string& varName ) = 0;
         ///
         /// copies an itk image from the python process that is named "varName"
         /// \return the image or 0 if copying was not possible
         virtual mitk::Image::Pointer CopyItkImageFromPython( const std::string& varName ) = 0;
 
         ///
         /// \return true, if OpenCv wrapping is available, false otherwise
         virtual bool IsOpenCvPythonWrappingAvailable() = 0;
         ///
         /// \see CopyToPythonAsItkImage()
         virtual bool CopyToPythonAsCvImage( mitk::Image* image, const std::string& varName ) = 0;
         ///
         /// \see CopyCvImageFromPython()
         virtual mitk::Image::Pointer CopyCvImageFromPython( const std::string& varName ) = 0;
 
         ///
         /// \return true, if vtk wrapping is available, false otherwise
         virtual bool IsVtkPythonWrappingAvailable() = 0;
         ///
         /// \see CopyToPythonAsItkImage()
         virtual bool CopyToPythonAsVtkPolyData( mitk::Surface* surface, const std::string& varName ) = 0;
         ///
         /// \see CopyCvImageFromPython()
         virtual mitk::Surface::Pointer CopyVtkPolyDataFromPython( const std::string& varName ) = 0;
 
         ///
         /// nothing to do here
         virtual ~IPythonService(); // leer in mitkIPythonService.cpp implementieren
     };
 }
 
 US_DECLARE_SERVICE_INTERFACE(mitk::IPythonService, "org.mitk.services.IPythonService")
 
 #endif
diff --git a/Modules/Python/mitkPythonService.cpp b/Modules/Python/mitkPythonService.cpp
index 8fe3dc225f..b2a08fc8b8 100644
--- a/Modules/Python/mitkPythonService.cpp
+++ b/Modules/Python/mitkPythonService.cpp
@@ -1,431 +1,445 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 
 #include "mitkPythonService.h"
 #include <Python.h>
 #include <mitkIOUtil.h>
 #include <QFile>
 #include <QDir>
 #include <PythonQt.h>
 #include "PythonPath.h"
 
 const QString mitk::PythonService::m_TmpImageName("temp_mitk_image");
 
 mitk::PythonService::PythonService()
   : m_ItkWrappingAvailable( true ), m_OpenCVWrappingAvailable( true ), m_VtkWrappingAvailable( true )
 {
   if( !m_PythonManager.isPythonInitialized() )
   {
+    //system("export LD_LIBRARY_PATH=/local/muellerm/mitk/bugsquashing/bin-debug/VTK-build/bin:$LD_LIBRARY_PATH");
+
     MITK_DEBUG("PythonService") << "initialize python";
     m_PythonManager.setInitializationFlags(PythonQt::RedirectStdOut);
     m_PythonManager.initialize();
 
-    //std::string result = m_PythonManager.executeString( "sys.path", ctkAbstractPythonManager::EvalInput );
+    //m_PythonManager.executeString( "print sys.path", ctkAbstractPythonManager::SingleInput );
     //MITK_DEBUG("mitk::PythonService") << "result of 'sys.path': " << result.toString().toStdString();
 
+    m_PythonManager.executeString( "sys.path.append('/usr/share/pyshared/numpy')", ctkAbstractPythonManager::SingleInput );
+    m_PythonManager.executeString( "import numpy", ctkAbstractPythonManager::SingleInput );
+
     QString pythonCommand(PYTHONPATH_COMMAND);
     MITK_DEBUG("PythonService") << "registering python paths" << PYTHONPATH_COMMAND;
     m_PythonManager.executeString( pythonCommand, ctkAbstractPythonManager::FileInput );
 
     MITK_DEBUG("mitk::PythonService") << "Trying to import ITK";
     m_PythonManager.executeString( "import itk", ctkAbstractPythonManager::SingleInput );
     m_ItkWrappingAvailable = !m_PythonManager.pythonErrorOccured();
     MITK_DEBUG("mitk::PythonService") << "m_ItkWrappingAvailable: " << (m_ItkWrappingAvailable? "yes": "no");
     if( !m_ItkWrappingAvailable )
     {
       MITK_WARN << "ITK Python wrapping not available. Please check build settings or PYTHON_PATH settings.";
     }
 
     MITK_DEBUG("mitk::PythonService") << "Trying to import OpenCv";
     m_PythonManager.executeString( "import cv2", ctkAbstractPythonManager::SingleInput );
     m_OpenCVWrappingAvailable = !m_PythonManager.pythonErrorOccured();
     MITK_DEBUG("mitk::PythonService") << "m_OpenCVWrappingAvailable: " << (m_OpenCVWrappingAvailable? "yes": "no");
     if( !m_OpenCVWrappingAvailable )
     {
       MITK_WARN << "OpenCV Python wrapping not available. Please check build settings or PYTHON_PATH settings.";
     }
 
     MITK_DEBUG("mitk::PythonService") << "Trying to import VTK";
     m_PythonManager.executeString( "import vtk", ctkAbstractPythonManager::SingleInput );
     m_VtkWrappingAvailable = !m_PythonManager.pythonErrorOccured();
     MITK_DEBUG("mitk::PythonService") << "m_VtkWrappingAvailable: " << (m_VtkWrappingAvailable? "yes": "no");
     if( !m_VtkWrappingAvailable )
     {
       MITK_WARN << "VTK Python wrapping not available. Please check build settings or PYTHON_PATH settings.";
     }
 
+    //m_PythonManager.executeString( "for path in sys.path:\n  print path\n", ctkAbstractPythonManager::SingleInput );
+    //m_PythonManager.executeString( "for k, v in os.environ.items():\n  print \"%s=%s\" % (k, v)", ctkAbstractPythonManager::SingleInput );
+    //m_PythonManager.executeFile("/local/muellerm/Dropbox/13-02-11-python-wrapping/interpreterInfo.py");
+
   }
   //std::string result = m_PythonManager.executeString( "5+5", ctkAbstractPythonManager::EvalInput );
   //MITK_DEBUG("mitk::PythonService") << "result of '5+5': " << result.toString().toStdString();
 }
 
 mitk::PythonService::~PythonService()
 {
 }
 
 std::string mitk::PythonService::Execute(const std::string &stdpythonCommand, int commandType)
 {
   QString pythonCommand = QString::fromStdString(stdpythonCommand);
 
     {
         MITK_DEBUG("mitk::PythonService") << "pythonCommand = " << pythonCommand.toStdString();
         MITK_DEBUG("mitk::PythonService") << "commandType = " << commandType;
     }
 
     QVariant result;
     bool commandIssued = true;
 
     if(commandType == IPythonService::SINGLE_LINE_COMMAND )
         result = m_PythonManager.executeString(pythonCommand, ctkAbstractPythonManager::SingleInput );
     else if(commandType == IPythonService::MULTI_LINE_COMMAND )
         result = m_PythonManager.executeString(pythonCommand, ctkAbstractPythonManager::FileInput );
     else if(commandType == IPythonService::EVAL_COMMAND )
         result = m_PythonManager.executeString(pythonCommand, ctkAbstractPythonManager::EvalInput );
     else
         commandIssued = false;
 
     if(commandIssued)
         this->NotifyObserver(pythonCommand.toStdString());
 
     return result.toString().toStdString();
 }
 
+void mitk::PythonService::ExecuteScript( const std::string& pythonScript )
+{
+  m_PythonManager.executeFile(QString::fromStdString(pythonScript));
+}
+
 std::vector<mitk::PythonVariable> mitk::PythonService::GetVariableStack() const
 {
     std::vector<mitk::PythonVariable> list;
 
     PyObject* dict = PyImport_GetModuleDict();
     PyObject* object = PyDict_GetItemString(dict, "__main__");
     PyObject* dirMain = PyObject_Dir(object);
     PyObject* tempObject;
 
     if(dirMain)
     {
       std::string attr, attrValue, attrType;
 
       for(int i = 0; i<PyList_Size(dirMain); i++)
       {
         tempObject = PyList_GetItem(dirMain, i);
         attr = PyString_AsString(tempObject);
         tempObject = PyObject_GetAttrString(object, attr.c_str());
         attrType = tempObject->ob_type->tp_name;
         if(PyUnicode_Check(tempObject) || PyString_Check(tempObject))
           attrValue = PyString_AsString(tempObject);
         else
           attrValue = "";
         mitk::PythonVariable var;
         var.m_Name = attr;
         var.m_Value = attrValue;
         var.m_Type = attrType;
         list.push_back(var);
       }
     }
 
     return list;
 }
 
 void mitk::PythonService::AddPythonCommandObserver(mitk::PythonCommandObserver *observer)
 {
     if(!m_Observer.contains(observer))
         m_Observer.append(observer);
 }
 
 void mitk::PythonService::RemovePythonCommandObserver(mitk::PythonCommandObserver *observer)
 {
     m_Observer.removeOne(observer);
 }
 
 void mitk::PythonService::NotifyObserver(const std::string &command)
 {
   MITK_DEBUG("mitk::PythonService") << "number of observer " << m_Observer.size();
     for( size_t i=0; i< m_Observer.size(); ++i )
     {
         m_Observer.at(i)->CommandExecuted(command);
     }
 }
 
 QString mitk::PythonService::GetTempImageName(const std::string& ext) const
 {
     QString tmpFolder = QDir::tempPath();
     QString fileName = tmpFolder + QDir::separator() + m_TmpImageName + QString::fromStdString(ext);
     return fileName;
 }
 
 bool mitk::PythonService::CopyToPythonAsItkImage(mitk::Image *image, const std::string &stdvarName)
 {
   QString varName = QString::fromStdString( stdvarName );
     // save image
     QString fileName = this->GetTempImageName( mitk::IOUtil::DEFAULTIMAGEEXTENSION );
 
     MITK_DEBUG("PythonService") << "Saving temporary file " << fileName.toStdString();
     if( !mitk::IOUtil::SaveImage(image, fileName.toStdString()) )
     {
         MITK_ERROR << "Temporary file could not be created.";
     }
     else
     {
         // TODO CORRECT TYPE SETUP, MAKE MITK_DEBUG("PythonService") MITK_DEBUG("PythonService")
         int dim = image->GetDimension();
         mitk::PixelType pixelType = image->GetPixelType();
         itk::ImageIOBase::IOPixelType ioPixelType = image->GetPixelType().GetPixelTypeId();
 
         // default pixeltype: unsigned short
         QString type = "US";
         if( ioPixelType == itk::ImageIOBase::SCALAR )
         {
           if( pixelType.GetTypeId() == typeid(double) )
             type = "D";
           else if( pixelType.GetTypeId() == typeid(float) )
             type = "F";
           if( pixelType.GetTypeId() == typeid(long double) )
             type = "LD";
           else if( pixelType.GetTypeId() == typeid(short) )
             type = "SS";
           else if( pixelType.GetTypeId() == typeid(signed char) )
             type = "SC";
           else if( pixelType.GetTypeId() == typeid(signed int) )
             type = "SI";
           else if( pixelType.GetTypeId() == typeid(signed long) )
             type = "SL";
           else if( pixelType.GetTypeId() == typeid(signed short) )
             type = "SS";
           else if( pixelType.GetTypeId() == typeid(unsigned char) )
             type = "UC";
           else if( pixelType.GetTypeId() == typeid(unsigned int) )
             type = "UI";
           else if( pixelType.GetTypeId() == typeid(unsigned long) )
             type = "UL";
           else if( pixelType.GetTypeId() == typeid(unsigned short) )
             type = "US";
         }
 
         MITK_DEBUG("PythonService") << "Got mitk image with type " << type.toStdString() << " and dim " << dim;
 
         QString command;
 
         command.append( QString("imageType = itk.Image[itk.%1, %2]\n") .arg( type ).arg( dim ) );
 
         command.append( QString("readerType = itk.ImageFileReader[imageType]\n") );
         command.append( QString("reader = readerType.New()\n") );
         command.append( QString("reader.SetFileName( \"%1\" )\n") .arg(fileName) );
         command.append( QString("reader.Update()\n") );
         command.append( QString("%1 = reader.GetOutput()\n").arg( varName ) );
 
         MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
         this->Execute( command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
         QFile file( fileName );
         MITK_DEBUG("PythonService") << "Removing file " << fileName.toStdString();
         file.remove();
         return true;
     }
 
     return false;
 }
 
 mitk::Image::Pointer mitk::PythonService::CopyItkImageFromPython(const std::string &stdvarName)
 {
   QString varName = QString::fromStdString( stdvarName );
     mitk::Image::Pointer mitkImage;
     QString command;
     QString fileName = GetTempImageName( mitk::IOUtil::DEFAULTIMAGEEXTENSION );
 
     MITK_DEBUG("PythonService") << "Saving temporary file with python itk code " << fileName.toStdString();
 
     command.append( QString( "writer = itk.ImageFileWriter[ %1 ].New()\n").arg( varName ) );
     command.append( QString( "writer.SetFileName( \"%1\" )\n").arg(fileName) );
     command.append( QString( "writer.SetInput( %1 )\n").arg(varName) );
     command.append( QString( "writer.Update()\n" ) );
 
     MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
     this->Execute(command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
     try
     {
         MITK_DEBUG("PythonService") << "Loading temporary file " << fileName.toStdString() << " as MITK image";
         mitkImage = mitk::IOUtil::LoadImage( fileName.toStdString() );
     }
     catch(std::exception& e)
     {
       MITK_ERROR << e.what();
     }
 
     QFile file(fileName);
     if( file.exists() )
     {
         MITK_DEBUG("PythonService") << "Removing temporary file " << fileName.toStdString();
         file.remove();
     }
 
     return mitkImage;
 }
 
 bool mitk::PythonService::CopyToPythonAsCvImage( mitk::Image* image, const std::string& stdvarName )
 {
   QString varName = QString::fromStdString( stdvarName );
 
   bool convert = false;
   if(image->GetDimension() != 2)
   {
     MITK_ERROR << "Only 2D images allowed for OpenCV images";
     return convert;
   }
 
   // try to save mitk image
   QString fileName = this->GetTempImageName( ".bmp" );
   MITK_DEBUG("PythonService") << "Saving temporary file " << fileName.toStdString();
   if( !mitk::IOUtil::SaveImage(image, fileName.toStdString()) )
   {
     MITK_ERROR << "Temporary file " << fileName.toStdString() << " could not be created.";
     return convert;
   }
 
   QString command;
 
   command.append( QString("%1 = cv.LoadImage(\"%2\")\n") .arg( varName ).arg( fileName ) );
   MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
   this->Execute(command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
   MITK_DEBUG("PythonService") << "Removing file " << fileName.toStdString();
   QFile file(fileName);
   file.remove();
   convert = true;
   return convert;
 }
 
 mitk::Image::Pointer mitk::PythonService::CopyCvImageFromPython( const std::string& stdvarName )
 {
   QString varName = QString::fromStdString( stdvarName );
 
   mitk::Image::Pointer mitkImage;
   QString command;
   QString fileName = GetTempImageName( ".bmp" );
 
   MITK_DEBUG("PythonService") << "run python command to save image with opencv to " << fileName.toStdString();
 
   command.append( QString( "cv.SaveImage(\"%1\", %2)\n").arg( fileName ).arg( varName ) );
 
   MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
   this->Execute(command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
   try
   {
       MITK_DEBUG("PythonService") << "Loading temporary file " << fileName.toStdString() << " as MITK image";
       mitkImage = mitk::IOUtil::LoadImage( fileName.toStdString() );
   }
   catch(std::exception& e)
   {
     MITK_ERROR << e.what();
   }
 
   QFile file(fileName);
   if( file.exists() )
   {
       MITK_DEBUG("PythonService") << "Removing temporary file " << fileName.toStdString();
       file.remove();
   }
 
   return mitkImage;
 }
 
 ctkAbstractPythonManager *mitk::PythonService::GetPythonManager()
 {
   return &m_PythonManager;
 }
 
 mitk::Surface::Pointer mitk::PythonService::CopyVtkPolyDataFromPython( const std::string& stdvarName )
 {
   QString varName = QString::fromStdString( stdvarName );
   mitk::Surface::Pointer newSurface;
 
   QString command;
   QString fileName = GetTempImageName( ".stl" );
 
   MITK_DEBUG("PythonService") << "run python command to save polydata with vtk to " << fileName.toStdString();
   command = QString (
     "vtkStlWriter = vtk.vtkSTLWriter()\n"
     "vtkStlWriter.SetInput(%1)\n"
     "vtkStlWriter.SetFileName(\"%2\")\n"
     "vtkStlWriter.Write()\n").arg(varName).arg(fileName);
 
   MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
   this->Execute(command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
   try
   {
     MITK_DEBUG("PythonService") << "Loading temporary file " << fileName.toStdString() << " as MITK Surface";
     newSurface = mitk::IOUtil::LoadSurface( fileName.toStdString() );
   }
   catch(std::exception& e)
   {
     MITK_ERROR << e.what();
   }
 
   QFile file(fileName);
   if( file.exists() )
   {
     MITK_DEBUG("PythonService") << "Removing temporary file " << fileName.toStdString();
     file.remove();
   }
 
   return newSurface;
 }
 
 bool mitk::PythonService::CopyToPythonAsVtkPolyData( mitk::Surface* surface, const std::string& stdvarName )
 {
   QString varName = QString::fromStdString( stdvarName );
   bool convert = false;
 
   // try to save mitk image
   QString fileName = this->GetTempImageName( ".stl" );
   MITK_DEBUG("PythonService") << "Saving temporary file " << fileName.toStdString();
   if( !mitk::IOUtil::SaveSurface( surface, fileName.toStdString() ) )
   {
     MITK_ERROR << "Temporary file " << fileName.toStdString() << " could not be created.";
     return convert;
   }
 
   QString command;
 
   command.append( QString("vtkStlReader = vtk.vtkSTLReader()\n") );
   command.append( QString("vtkStlReader.SetFileName(\"%1\")\n").arg( fileName ) );
   command.append( QString("%1 = vtkStlReader.GetOutput()").arg( fileName ) );
   MITK_DEBUG("PythonService") << "Issuing python command " << command.toStdString();
   this->Execute(command.toStdString(), IPythonService::MULTI_LINE_COMMAND );
 
   MITK_DEBUG("PythonService") << "Removing file " << fileName.toStdString();
   QFile file(fileName);
   file.remove();
   convert = true;
   return convert;
 }
 
 bool mitk::PythonService::IsItkPythonWrappingAvailable()
 {
   return m_ItkWrappingAvailable;
 }
 
 bool mitk::PythonService::IsOpenCvPythonWrappingAvailable()
 {
   return m_OpenCVWrappingAvailable;
 }
 
 bool mitk::PythonService::IsVtkPythonWrappingAvailable()
 {
 
   return m_VtkWrappingAvailable;
 }
 
diff --git a/Modules/Python/mitkPythonService.h b/Modules/Python/mitkPythonService.h
index f0f6ef525b..a724ace3c9 100644
--- a/Modules/Python/mitkPythonService.h
+++ b/Modules/Python/mitkPythonService.h
@@ -1,95 +1,98 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 #ifndef mitkPythonService_h
 #define mitkPythonService_h
 
 #include "mitkIPythonService.h"
 #include <itkLightObject.h>
 #include <ctkAbstractPythonManager.h>
 #include "mitkSurface.h"
 #include "mitkPythonExports.h"
 
 namespace mitk
 {
   ///
   /// implementation of the IPythonService using ctkabstractpythonmanager
   /// \see IPythonService
   class MITK_PYTHON_EXPORT PythonService: public itk::LightObject, public mitk::IPythonService
   {
   public:
       ///
       /// instantiate python manager here
       PythonService();
       ///
       /// empty implementation...
       ~PythonService();
       ///
       /// \see IPythonService::Execute()
       std::string Execute( const std::string& pythonCommand, int commandType = SINGLE_LINE_COMMAND );
       ///
+      /// \see IPythonService::ExecuteScript()
+      void ExecuteScript(const std::string &pathToPythonScript);
+      ///
       /// \see IPythonService::GetVariableStack()
       std::vector<PythonVariable> GetVariableStack() const;
       ///
       /// \see IPythonService::AddPythonCommandObserver()
       void AddPythonCommandObserver( PythonCommandObserver* observer );
       ///
       /// \see IPythonService::RemovePythonCommandObserver()
       void RemovePythonCommandObserver( PythonCommandObserver* observer );
       ///
       /// \see IPythonService::NotifyObserver()
       void NotifyObserver( const std::string& command );
       ///
       /// \see IPythonService::IsItkPythonWrappingAvailable()
       bool IsItkPythonWrappingAvailable();
       ///
       /// \see IPythonService::CopyToPythonAsItkImage()
       bool CopyToPythonAsItkImage( mitk::Image* image, const std::string& varName );
       ///
       /// \see IPythonService::CopyItkImageFromPython()
       mitk::Image::Pointer CopyItkImageFromPython( const std::string& varName );
       ///
       /// \see IPythonService::IsOpenCvPythonWrappingAvailable()
       bool IsOpenCvPythonWrappingAvailable();
       ///
       /// \see IPythonService::CopyToPythonAsCvImage()
       bool CopyToPythonAsCvImage( mitk::Image* image, const std::string& varName );
       ///
       /// \see IPythonService::CopyCvImageFromPython()
       mitk::Image::Pointer CopyCvImageFromPython( const std::string& varName );
       ///
       /// \see IPythonService::IsVtkPythonWrappingAvailable()
       bool IsVtkPythonWrappingAvailable();
       ///
       /// \see IPythonService::CopyToPythonAsVtkPolyData()
       bool CopyToPythonAsVtkPolyData( mitk::Surface* surface, const std::string& varName );
       ///
       /// \see IPythonService::CopyVtkPolyDataFromPython()
       mitk::Surface::Pointer CopyVtkPolyDataFromPython( const std::string& varName );
       ///
       /// \return the ctk abstract python manager instance
       ctkAbstractPythonManager* GetPythonManager();
   protected:
       QString GetTempImageName(const std::string &ext) const;
   private:
       QList<PythonCommandObserver*> m_Observer;
       ctkAbstractPythonManager m_PythonManager;
       static const QString m_TmpImageName;
       bool m_ItkWrappingAvailable;
       bool m_OpenCVWrappingAvailable;
       bool m_VtkWrappingAvailable;
   };
 }
 #endif
diff --git a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.cpp b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.cpp
index 3e78a732a0..8b7e1e5308 100644
--- a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.cpp
+++ b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.cpp
@@ -1,93 +1,93 @@
 /*===================================================================
 
 The Medical Imaging Interaction Toolkit (MITK)
 
 Copyright (c) German Cancer Research Center,
 Division of Medical and Biological Informatics.
 All rights reserved.
 
 This software is distributed WITHOUT ANY WARRANTY; without
 even the implied warranty of MERCHANTABILITY or FITNESS FOR
 A PARTICULAR PURPOSE.
 
 See LICENSE.txt or http://www.mitk.org for details.
 
 ===================================================================*/
 
 #include "QmitkPythonView.h"
 #include <QtGui>
 #include <QmitkCtkPythonShell.h>
 #include "mitkPluginActivator.h"
 #include <QmitkPythonVariableStackTableView.h>
 #include <QmitkPythonTextEditor.h>
 #include <QmitkPythonSnippets.h>
 
 const std::string QmitkPythonView::VIEW_ID = "org.mitk.views.python";
 
 struct QmitkPythonViewData
 {
     // widget
     QmitkPythonVariableStackTableView* m_PythonVariableStackTableView;
     QmitkPythonSnippets* m_PythonSnippets;
 
     QmitkCtkPythonShell* m_PythonShell;
     QmitkPythonTextEditor* m_TextEditor;
 };
 
 QmitkPythonView::QmitkPythonView()
     : d( new QmitkPythonViewData )
 {
     d->m_PythonVariableStackTableView = 0;
     d->m_PythonShell = 0;
 }
 
 QmitkPythonView::~QmitkPythonView()
 {
     delete d;
 }
 
 void QmitkPythonView::CreateQtPartControl(QWidget* parent)
 {
     d->m_PythonVariableStackTableView = new QmitkPythonVariableStackTableView;
     d->m_PythonVariableStackTableView->SetDataStorage(this->GetDataStorage());
-    d->m_PythonVariableStackTableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
+    d->m_PythonVariableStackTableView->horizontalHeader()->setResizeMode(QHeaderView::Interactive);
 
     QString snippetsFilePath = mitk::PluginActivator::m_XmlFilePath;
     MITK_DEBUG("QmitkPythonView") << "got snippetsFilePath " << snippetsFilePath.toStdString();
 
     d->m_PythonSnippets = new QmitkPythonSnippets(snippetsFilePath);
 
     QTabWidget* varStackSnippetsTab = new QTabWidget;
     varStackSnippetsTab->addTab( d->m_PythonVariableStackTableView, "Variable Stack" );
     varStackSnippetsTab->addTab( d->m_PythonSnippets, "Snippets" );
     varStackSnippetsTab->setTabPosition( QTabWidget::South );
 
     d->m_PythonShell = new QmitkCtkPythonShell;
 
     d->m_TextEditor = new QmitkPythonTextEditor;
 
     QTabWidget* tabWidgetConsoleEditor = new QTabWidget;
     tabWidgetConsoleEditor->addTab( d->m_PythonShell, "Console" );
     tabWidgetConsoleEditor->addTab( d->m_TextEditor, "Text Editor" );
     tabWidgetConsoleEditor->setTabPosition( QTabWidget::South );
 
     QList<int> sizes;
     sizes << 1 << 3;
     QSplitter* splitter = new QSplitter;
     splitter->addWidget(varStackSnippetsTab);
     splitter->addWidget(tabWidgetConsoleEditor);
     splitter->setStretchFactor ( 0, 1 );
     splitter->setStretchFactor ( 1, 3 );
 
     QGridLayout* layout = new QGridLayout;
     layout->addWidget( splitter, 0, 0 );
     parent->setLayout(layout);
 
     connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_PythonShell, SLOT(Paste(QString)) );
     connect( d->m_PythonSnippets, SIGNAL(PasteCommandRequested(QString)), d->m_TextEditor, SLOT(Paste(QString)) );
 }
 
 void QmitkPythonView::SetFocus()
 {
     d->m_PythonShell->setFocus();
 }