Marching Cubes implementation using OpenCL and OpenGL
3
In a school project I recently created a fast implementation of Marching Cubes that uses OpenCL to extract surfaces from volumetric datasets and OpenGL to render the surfaces on screen. I wrote a paper together with my two supervisors about the implementation and presented it at the Joint Workshop on High Performance and Distributed Computing for Medical Imaging at the MICCAI 2011 conference. Our implementation achieved real-time speeds for volumes of sizes up to 512x512x512 on a standard GPU with 1GB memory. The paper entitled “Fast Surface Extraction and Visualization of Medical Images using OpenCL and GPUs” describing the implementation can be downloaded here. The source code of the implementation can be downloaded from my GitHub page.
OpenCL C++ Utilities
0
I recently created a small utility library for OpenCL with C++. It consists of a set of function based on the OpenCL C++ bindings to help set up an OpenCL context, compiling OpenCL code and viewing error functions. I hope these functions can be useful for others and I’m planning on adding more utility functions in the future. Note that I haven’t tested it on all platforms yet. Feedback and comments are most welcome.
The source code can be downloaded from my GitHub page.
3D Gradient Vector Flow Matlab Implementation
6
Gradient Vector Flow (to the right) calculated on the volume to the left.
Gradient Vector Flow (GVF) is a feature-preserving diffusion of gradient information. It was originally introduced by Xu and Prince to drive snakes, or active contours, towards edges of interest in image segmentation. But GVF is also used for detection of tubular structures and skeletonization. In this post I present a simple Matlab implementation of GVF for 3D images which I made because I could not find any online. The implementation is a simple extension of Xu and Prince original 2D implementation found at their website.
Using the C++ bindings for OpenCL
4
While the OpenCL API is written in C, the OpenCL 1.1 specification also comes with a specification for C++ bindings. In this post I go through how to use the C++ bindings instead of C for the simple example of vector addition from my previous post Getting started with OpenCL and GPU computing.
The Boltzmann machine
0The neural network discussed in this post, called the Boltzmann machine, is a stochastic and recurrent network. This post contains my exam notes for the course TDT4270 Statistical image analysis and learning and explains the network’s properties, activation and learning algorithm.
Getting started with OpenCL and GPU Computing
64
OpenCL (Open Computing Language) is a new framework for writing programs that execute in parallel on different compute devices (such as CPUs and GPUs) from different vendors (AMD, Intel, ATI, Nvidia etc.). The framework defines a language to write “kernels” in. These kernels are the functions which are to run on the different compute devices. In this post I explain how to get started with OpenCL and how to make a small OpenCL program that will compute the sum of two lists in parallel.
Making charts and output them as images to the browser in Django
6
Simple graph made with matplotlib
Lets say you are working on a website made in Django. And you want to make some nice looking graphs real time, as images from dynamic data. This can be done by using the python 2D graph library matplotlib. The library can be found in the debian package python-matplotlib. A simple graph showing a sine curve, seen to the right, can be generated in regular python using the following code(taken from this example):
from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) show()
Output graph to browser from a Django view
If you want to output this graph as a PNG image to the browser from a view in Django, you can store the image in a string buffer and output this buffer using the HttpReponse class in Django and set the mime type to image/png.
from django.http import HttpResponse from matplotlib import pylab from pylab import * import PIL, PIL.Image, StringIO def showimage(request): # Construct the graph t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) plot(t, s, linewidth=1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) # Store image in a string buffer buffer = StringIO.StringIO() canvas = pylab.get_current_fig_manager().canvas canvas.draw() pilImage = PIL.Image.fromstring("RGB", canvas.get_width_height(), canvas.tostring_rgb()) pilImage.save(buffer, "PNG") pylab.cose() # Send buffer in a http response the the browser with the mime type image/png set return HttpResponse(buffer.getvalue(), mimetype="image/png")
Competitive and cooperative interactions in biological inspired AI
0In this essay, written as my final essay in the course IT3708 spring 2010, I discuss two phenomenas that are the driving forces for a lot of the complex biological systems in nature with several simple components that interact with each other. These two phenomenas are competition and cooperation. I will discuss examples from the process of evolution, where competition play a crucial part, to ant colonies, where cooperation between ants enables these simple creatures to do extraordinary things. All of the examples presented here have an inspiration from biology and has been applied successfully to computer AI problems. I start by defining competitive and cooperative interactions among individual components in a broad sense. Then six examples, with competitive and cooperative interactions, are presented. I finished off with a conclusion on the advantages and disadvantages of using these two phenomenas in AI systems.
(more…)
Gjenskapingen av Hamar domkirke – Del 2
3Da var faget Eksperter i Team over og jeg og resten av gruppa mi er stolte over å presentere resultatet av vårt arbeid. Som sagt i et tidligere blogginnlegg gikk oppgaven vår ut på å gjenskape Hamar domkirke i virtuell virkelighet. I den sammenheng har vi laget en film over gamle Hamar domkirke som vi har lagt ut på Youtube, se under. Filmen viser tre ulike byggefaser kirka gikk gjennom.
3D modellene av kirka er laget i programmet 3D studio max 2009, landskapet i Grome 2, teksturene er funnet på cgtextures.com og fantastiske gratis Unreal Development Kit er brukt til å sette det hele sammen med realistisk grafikk.
Gjenskapingen av Hamar domkirke – Del 1
5I det obligatoriske faget Eksperter i Team har jeg og en gruppe på 3 andre valgt oppgaven med å gjenskape Hamar domkirke i virtuell virkelighet. Det vil si at vi skal modellere den i 3D på datamaskiner og så plassere den i et 3D landskap. Kirken ble bygget rundt år 1200 og ble rasert i 1567 av svenskene under den nordiske 7 års krigen.
Etter andre dag med jobbing har gruppa fått modellert hovedtrekkene til både fase 1 og 2.
Neste steg er å legge mer detaljer til modellene. Som f.eks. dører, vinduer, takpynt o.l.




Recent Comments