CUDA 2.1: NVIDIA Releases Notebook Beta Driver

CUDA No Comments »

Getting CUDA to run on your notebook is not always an easy task even if you have a CUDA enabled graphic card. In my Laptop there is a NVIDIA Quadro FX 570M (256 MB). However, the laptops require you to have a vendor-specific driver otherwise you get the nice error message “no supported hardware detected” when trying to install the latest CUDA driver.

However, NVIDIA seems to realize that this situation is not amusing to any Laptop-Programmer (like me). So yesterday I found on the download site the following item:

Beta Notebook Driver for Developers (181.22)

So downloaded, installed, and same error as with the other drivers. Well, at least it is a step into the right direction.  Maybe it works for others.

Standard alternative

However, there is still the option to install a modified driver for your notebook. This worked for me but is not the clean solution. Those drivers can be found at http://www.laptopvideo2go.com/

Fast Uniform Cubic B-Spline Evaluation

CUDA, Programming 1 Comment »

My current work includes the evaluation of a parametric motion field which is based on cubic B-splines. Already some time ago I ported the straight forward B-spline evaluation on the graphic card using CUDA. However, it required the evaluation of multiple nested for loops and took even on the graphic card some time.

So the quest of today was: Find a fast way for cubic B-spline evaluation using CUDA!

Of course Google helped me out and pointed meto the following papers:

Daniel Ruijters, Bart M. ter Haar Romeny, and Paul Suetens, “ Accuracy of GPU-based B-Spline Evaluation,” In Proc. Tenth IASTED International Conference on Computer Graphics and Imaging (CGIM), Innsbruck, Austria, pp. 117-122, February 13-15, 2008.

Christian Sigg and Markus Hadwiger, “ Fast Third-Order Texture Filtering,” In GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation, Matt Pharr (ed.), Addison-Wesley; chapter 20, pp. 313-329, 2005.

They showed that a fast and accurate evaluation of B-splines is possible by replacing the nearest neighbor lookups during the B-spline evaulation by linear interpolation which is hard-wired on the GPU.

Finally the best of all: Daniel Ruijters provides some clean CUDA code for download on a website. It helped me out very well. In overall I gained a speed-up factor of 7 in comparison to my first naive implementation!

Multiline Macro Compilation Errors

C++, Programming No Comments »

Sometimes you just need to write macros in your C/C++ code. And sometimes, they get long and you want to split them on multiple lines for reasons of readibility.

I admit, that I only seldomly use multiline macros. But today something new came to my mind. I created a simple multiline macro, e.g. something similar to this:

  1. #define MYMACRO(a, b) {  
  2.                      a = a+b;  
  3.                      b = b+a; }

Nothing difficult or wrong on the first sight! Right? Okay but I got hundreds of compilation errors!
After trying around some time I noticed that it is not allowed to put a space behind the slash, i.e. ” is okay and ‘ ‘ is not.

So if you encounter the same error - welcome to the club …. tststs one never stops learning :-)

Bye bye Fluoros? Inserting catheters without X-rays

Imaging Devices No Comments »
catheter

Image by: Fraunhofer IPT

At this years JEC trade fair in Paris (Hall 1, Stand T18) from March 24 to 26 a new catheter developed by researchers at the Fraunhofer Institute for Production Technology IPT in Aachen, will be presented. They have developed a guide wire made of glass-fiber-reinforced plastic: Because the guide wire is made of plastic the imaging can be performed by magnetic resonance tomography instead of computer tomography,” says IPT scientist Adrian Schütte.

So will we loose our nice fluoroscopic images from our beloved C-arm systems? We will see …
The complete press release can be found here.

Matlab / C++ Communication

C++, Libraries, Matlab No Comments »

Often one is required to write medical image processing code in C++ for reasons of speed and programming libraries. However, what is missing during the development are nice and interactive calculation, plotting and visualization tools. However, on the contrary these are provided by Matlab. So all we need is an easy link for communicating between Matlab and your C++ program.

An overview of the available methods is provided in the Matlab external interfaces guide. Today I want to provide you with a link to my favorite method for windows C++ programs. It is called MatlabEngine and can be downloaded at CodeProject.

Storing 3-D data in a portable single file DICOM volume format

DICOM, Matlab, Programming No Comments »

Handling of DICOM data is a mandataory but  tricky task in medical image processing. This is especially true when it comes to volumetric 3-D data. The most common and supported format for storing 3-D data using DICOM is to partition the volume into slices and to save each slice as a simple DICOM image. The slices can be distinguished either by a number coding (e.g. slice.001, slice.002,…) in the file name or by specific DICOM tags.

However, this format easily becomes a pain as it requires to store hundreds of single files. The goal of this article is to provide a solution for that problem but still to remain a large compatibility with existing software. The solution: just zip it up! I agree, this sounds simple but provides all the required functionality. It is a single file, zip-files are highly portable and are available on almost all platforms, plus we get a nice compression for free.

Of course we won’t zip our data by hand! In this article I will provide a Matlab routine which allows to store and read volume data using the above technique.  In an upcoming article I will provide C/C++ code, too.  Here we go: The two functions are called dicomreadvolume() and dicomwritevolume(). They require you to have the Matlab image processing toolbox installed. An example session for storing and reading the 3-D Shepp-Logan phantom with an anisotropic voxel size of [0.25mm 0.25mm 0.5mm] could look like this:

  1. % create phantom data
  2. V = phantom3d(128);
  3. V = uint8(255.*V); % convert to uint8
  4.  
  5. % save the dicom volume
  6. dicomwritevolume(shepplogan.zip‘, V, [0.25 0.25 0.5]);
  7.  
  8. % read in the dicom volume again
  9. [V2 VS] = dicomreadvolume(shepplogan.zip);
  10.  
  11. % V2 contains the volume
  12. % VS contains the voxel size

 
I hope this code helps some of you out. It comes in handy for me in an every day usage :-). In an upcoming article I will provide you with some equivalent C++ code. So look out for more!

An up-to-date download is available at MATLAB Central.

Helper functions for reading/writing binary data in Matlab

Matlab, Programming No Comments »

A common task in image processing is reading and writing binary data to files. On the Matlab command line it comes in handy to have a set of helper functions that save one from typing duplicate code over and over again, i.e. the fopen(), fwrite()/fread() and fclose() stuff.

I have created two functions writebinary() and readbinary() for that purpose. A primitive session where we save and load the 2-D Shepp-Logan phantom could look like this:

  1. I = phantom(200) .* 256; % create the phantom
  2. writebinary(img.raw‘, I, ‘uint8); % save it as char
  3. J = readbinary(img.raw‘, [200 200], ‘uint8=>double); % read it in again and cast to double

Its not a big deal - but useful!

The latest version can be downloaded at MATLAB Central.

Matlab 3-D Shepp-Logan Phantom

Matlab, Programming 2 Comments »

The Shepp-Logan phantom is often used in 2-D and 3-D reconstruction literature to present the quality of reconstruction algorithms. In Matlab the 2-D version of the phantom can be used as follows for creating a 200 x 200 image:

  1. I = phantom(200);
  2. figure, imshow(I,[]);

results into the following image:

Matlab 2-D Shepp-Logan Phantom

Matlab 2-D Shepp-Logan Phantom

Read the rest of this entry »

Design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in