Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
The Python Plugin

Available sections:

Overview

The Python view provides the graphical front end to run Python code through the mitkPython module. Furthermore the SimpleITK/VTK/OpenCV Python wrapping can be used. Images and surfaces in the DataManager can be transferred via a drag & drop mechanism into the MITK Python Console.

Transfer data

Images and surfaces can be tranferred from the data manger into the python console. To transfer an image or surface simply drag it from the data manager into the Variable Stack view, as shown in Figure. A new entry will appear in the Variable Stack, as soon as the data is transferred. As soon as the entry is available the object can be accessed and modified in the python console. Three dimensional images will be copied in-memory to python via numpy and a SimpleITK image object is created with the same properties. When a two dimensional image is transferred the user can choose to transfer it as an OpenCV image object. Surfaces are fully memory mapped as a vtkPolyData object. To transfer an image or surface from the python runtime to the data manager just double click on the corresponding entry in the Variable Stack View.

Screenshot of the MITK Python Plugin


Console

The Python console can be used for interactive programming. All items in the data storage can be accessed in the python console. The console can also be used to load python scripts and run them.

Snippets

The python plugin contains some code snippets of SimpleITK/VTK/OpenCV that can be run in the python console. Snippets can be modified and saved by the user.