Search This Blog

TopMeny

Thursday, December 13, 2007

Level Set Framework

A study of .NET as a platform for computational intensive applications.
levelseteditorGUI.jpg
Level Set Editor GUI - Built on top of the level set framework (C#, .NET, DirectX).

Keywords: level sets, framework, .NET, C#, marching cubes, visualization, 3D, computer graphics

Authors: Anders Bursjöö and Hannes Larsson
Supervisor: Ken Museth, Professor Linköpings Universitet
Download report: LevelSetFramework_Thesis_Report_v2.0.pdf

Level set is a mathematical technique for tracking surfaces. It is used in 3D-computer graphics for organic simulations such as water and smoke. It is pretty hard to understand so we wanted to create a framework that a user could use in level set operations. The framework should apply to a novice user as well as a professional user that want to extend the framework.

The framework is written in .NET 2.0 and contains two different data structures from level sets and some basic operations for scalar field manipulations and advection. The framework is built with interfaces to be extendible.

LS_GUI.png

A GUI has been created on top of the framework (see the image above). The program uses marching cubes to generate the mesh and is rendered in DirectX. The marching cubes algorithm is general and could be plugged into OpenGL or some other graphics library.

The colors indicate the normal direction. Several layers (levels) have been rendered to display the structure of level sets. Each level represents a constant value.
utha_1.jpg
Utah teapot level set,
full volume.
utha_2.jpg
Utah teapot level set,
cross section.
utha_4.jpg
Utah teapot level set,
cross section.

bunny_erosion.jpg
Eroded bunny
bunny_erosion.jpg
Original bunny
bunny_erosion.jpg
Dilated bunny

View demo movies:
levelseterosion.jpg
Dilation

levelsetmean.jpg
Mean curvature flow

levelsetmorph.jpg
Morph

DirectX as UserControl in a Windows Form

How to insert a DirectX render-window into a Windows Form application using the DirectX sample framework.
Keywords: DirectX, sample framework, windows form, UserControl.
Download source code and executable
directxasusercontrol.jpg
I found it very hard to find a good example of how to have a DirectX window inside a Windows Form application and still have standard Windows Form controls without making DirectX lock the GUI. I also wanted to use a sample framework application from the DirectX samples.
There is a very good example (CML viewer) of using a DirectX sample framework in a WinForm and I have looked at it a lot when creating this example. Anyway, I wanted to do it my way so I did my own version of it. I also wanted the rendering-loop to be optimal and it actually is in the later versions of the sample framework. It is using the ApplicationIdle-event to render, read more about optimal rendering-loops at Tom Millers blog.
Note that the sample framework is not created to be used like this so you may want to consider creating the DirectX-stuff yourself without the sample framework.
Sometimes the applications has problems at start up, maybe because of the LoaderLock turned off, does anyone have a solution? For LoaderLock problems, see this thread.
I have not put much effort in documentation and super pretty code (all my time goes to my master thesis projekt) but it is an implementation that work and I don´t think it is that hard to understand.

Level set viewer and cloth simulation

Level set viewer, cloth simulation with collision detection against a level set model and a ply-model viewer.

levelseteditor.jpg
This was a project and lab exercises in a course held by Professor Ken Museth. The result of my and my partners work is a Ply-model/Level set/Cloth simulation viewer. In other words, you can open and view ply-models and also save level sets to a ply format. The level set part also gives opportunity to modify the model a little bit (basic boolean operations) as well as viewing different levels, view different resolutions of the model and more. The cloth simulation is a piece of fabric that is created by a transmission line matrix with spring connected to the nodes in different ways. The project is written in C#, .NET 2.0 and DirectX. Please take some time to view the demo videos or download and run the executable.
Note: You must have .NET 2.0 and DirectX 9.0c installed to run the demo executable.

Download demo executable (56 MB)
Download demo video 1 - Ply model (30 MB)
Download demo video 2 - Level set (67 MB)
Download demo video 3 - Cloth simulation on level set model (34 MB)

Unstructured Light Fields

3D representation of real objects using pictures and unstructured Light Fields.

lightfields.jpg
This project is a result from a course at school. Our first goal was to create an unstructured Light Field system where you could take some pictures of an object (using markers for tracking) and then create novel views of the object from a small set of images. By doing this you do not need to create a whole 3D environment and 3D models. You can "simulate" 3D by interpolating between a set of images. The result of the project is a Light Field program that can create these novel views; we did however use images from a 3D program since we did not get the tracking to work 100%. Please view the demo movie, read the report or download the executable.
Note: You need .NET 2.0 to run the exe-file.
Download demo video (6 MB)
Download executable (0.5 MB)
Download report (4 MB)

Data Exploration

Data exploration of house prize data in the Boston region.

infoviz.jpg
This project is created using C#, DirectX and OpenViz. The program shows an information visualization tool that can help the user to explore large amount of data. Normally it can be very hard to understand and find relations in a large data set. By using an information visualization tool the user can confirm relation between variables and also discover new ones. This program uses a scatter chart in a linked combination with a parallel chart and also a 3D parallel chart to view one to one relations between the data set variables. Please view the demo movie or download the project report.
Download demo movie (160 MB)
Download project report (1.5 MB)

Web File/Directory Browser using AJAX

A very simple web based file browser using AJAX and PHP.

filebrowser.jpg
This is a project that has been created to demonstrate the power of AJAX and XML. I did this project with a friend, Mattias Arrelid. We were tired of the standard web file browsers that just took too long time. We wanted to try and use AJAX to speed up the process. By using AJAX just a part of the data needed to be requested instead of the whole page beeing sent back and forth. We also wanted to be able to view the content of several directories at the same time. Please download the demo project or report.
Note: You need to put the files on a server that handles PHP and the browser only works with Firefox (css-problems with Internet Explorer).
Download source code (28 KB)
Download project report (140 KB)

Medical visualization

Visualization of medical data.

sciviz.jpg
Scientific visualization is a process where scientific information is presented in images in some way. The information has a connection to the real physical data in abstract to information visualization where the data does not need to have a real world relation. This project demonstrates visualization of medical data retrieved from an x-ray scanner. The input data is combined into a 3D model. This project is written in C++ using VTK.
Download demo movie (20 MB)