Talk Using Python to generate Finite Element Models from Medical Imaging Data

Presented by Christian Rossmann in Scientific Applications 2009 on 2009/07/25 from 14:15 to 15:00

Since medical imaging data is used to generate realistic Finite Element (FE) models, former simplified model geometries have been replaced by complex ones considering detailed and patient specific anatomic characteristics. Generation of simulation models directly from imaging data can be divided in two steps. In a first step visualization tools are used to explore data and isolate surfaces (iso-surfaces) representing the Region of Interest (ROI). In a second step FE tools are used to rediscretize the iso-surfaces for further usages within FE analysis tools. Although there are many similarities between these two steps, they are still treated as separate processes with different software tools. At present communication between the software tools is carried out by the use of standard interfaces (e.g. 'stl'). Python is probably not a programmer's 'First Choice' to develop an application which covers the ability to visualize and manipulate large data since it is often associated with low performance on large data sets. Furthermore existing Python extension modules for visualization and operating on medical imaging data use their own storage scheme which complicates an access from other modules.

The current work deals with the development of a Python application to generate FE models from medical imaging data. A visualization framework was created with Tkinter module and Togl to visualize medical imaging data. With the use of OpenGL's functionality via PyOpenGL planes were created to display volume data in axial, sagittal and coronal views with interactive slicing (3DTexture). To improve data visualization and support identifying ROIs a transfer function module was implemented based on OpenGL shading language (GLSL). Since large data sets are hard to handle on older video cards a module was implemented to generate and save sub volumes in respect to reduce data size. For generating iso-surfaces Visualization Tool Kit (VTK) extension module was used. The visualization of VTK's surface data in the Python application required porting data to Numpy since PyOpenGL is strictly coupled to Numpy data types (ctypes). Several ways to access and handle data between VTK and Numpy were examined in the current study. The usage of VTK's ExportToVoidPointer was the one which showed the best performance. The investigation of different visualization methods showed that the use of Vertex Buffer Objects (VBO) was the most suitable to visualize iso-surfaces in this application. To generate FE models from surface data a further data manipulation was required to transform triangulated surface data to FE formulation. This was realized using a subroutine written in Fortran and generating a module with F2PY.

This project showed that it is efficient and expedient to develop an application to generate FE models from medical imaging data with Python. The reason for that are the useful extension modules which support a fast development in the field of biomechanical engineering. Although these modules have optimized methods to operate on large data sets data handling between the modules can be very slow. To guarantee a fast data transfer coping data has to be avoided by using pointers. If data must be reorganized integration of compiled languages e.g. Fortran is necessary.
tagged by
no related entity