Showing posts with label Tkinter. Show all posts
Showing posts with label Tkinter. Show all posts

Tuesday, September 18, 2012

Servo position control via PC

Image of experimental setup. The PC control panel sends a signal to the micro-controller board and changes the position of the servo
The position of a servo can be controlled with a Micro-Controller (MC) board that recieves singals from the PC. This picture shows an example setup that I created to control the servo position with a PC control panel. When the slider is moved in the control panel, a digital signal is generated and sent to the MC via USB connection. The MC processes the signal and sends an equvalent electronic impulse to the servo. Thus the servo changes position according to the electrical signal. For this example I used Python and the Tkinter (GUI) library to create the control panel and Arduino's sketch tool to program the MC.
A real-time video of the application can be found at: http://www.youtube.com/watch?v=cI-eiEtxchc
The scrip and sketch for the MC data can be found at: https://www.dropbox.com/sh/ip306uavm7jpekg/uiElcgcgWg/Servo%20positioning%20control%20from%20PC

Thursday, September 13, 2012

Tkinter OpenGL application

Screenshot of the Togl application LIMIT. The whole GUI application was written in Python
Togl is a Tk OpenGL widget for GPU rendering. I've read several postings where people ask about Togl and recent 64bit windows versions. People are looking for it due to its compatibility to Python's standard GUI library Tkinter. Most the people responding recommended to switch to a more recent GUI toolkit with OpenGL support such as PyQt or wxpython since Tkinter is too much "old fashion" and Togl is not maintained very well thus kind of dead. I personally disagree that Tkinter is "old fashion" and it almost hurts my feelings because it is such a easy to use library, there are ways to give Tkinter a modern look (e.g. with Tile) and Tkinter with Togl is just a great and powerful visualization tool! Well it is true that Togl for Python might be not a 100% up to date but it is not dead! There is professional software out there that uses Tkinter with Togl for 3D visualization. The image shows a professional OpenGL application entirely written in Python using Tkinter and Togl. This is a software for generating fatigue assessments for mechanical structures. It allows 3D view manipulation and interactions.

Togl 

Monday, September 10, 2012

Patient-specific finite element simulation of radiofrequency ablation

Tetrahedral FE model for patient-specific simulation of radiofrequency ablation in the liver. The model geometry was generated based on patent-specific CT-image data. The image shows liver vasculature tumor, ablation probe, and surrounding bone structure.
Lets get this blog started with one of my favorite images of an python application (http://www.youtube.com/watch?v=jTXbjQ_6RWM) that I created to generate finite element (FE) models for simulation of radiofrequency ablation (RFA). The FE method is an established technique to solve the thermal-electrical differential equations for realistic RFA treatment simulation. Nevertheless, generation of patient-specific FE models is a labor intense task and requires use of multiple software tools. In order to overcome the challenges of modeling I generated a research tool as well as a workflow to generate patient-specific FE models for simulation of RF ablation efficiently. Common techniques of image processing and image meshing are combined with new approaches, such as interactive electrode placement, interfaces to commercial FE software programs including visualization of model results overlaid on imaging data. Such a tool may provide additional information for the treating physician for more effective pre-treatment planning of procedures. Via this tool, I was able to simulate RF ablation based on patient-specific geometry and visualize model results overlaid on CT imaging data. 
To create the application I used: