Friedrich-Alexander-Universität
Friedrich-Alexander-Universität
Stanford Radiology

Step-by-Step Mode

In step-by-step mode, we provide API calls for simple implementation of custom reconstruction algorithms. Note that most steps are also provided as OpenCL implementations which enable fast execution on graphics hardware. As the code should also be suited to learn reconstruction methods, we put a lot of emphasis on simple structure and extensive comments.

Parallel-Beam

The parallel-beam reconstruction code is found in the package edu.stanford.rsl.tutorial.parallel. In the following, we describe the parallel reconstruction example that is implemented in ParallelReconstructionExample.java.

All code is embedded into the main method of the class. First, we create an ImageJ instance that will allow us to manipulate the images we create at a later stage:

new ImageJ();

Next, we create a slice image (called phantom) that will be used as test object for reconstruction:

Phantom phan = new DotsGrid2D(x, y);

In our case, the phantom will display a random pattern of circles. We display it by calling:

phan.show("The Phantom");

Next, we want to create a set of parallel-beam projection images, i.e. a sinogram. Therefore, we instantiate a new projector:

ParallelProjector2D projector = new ParallelProjector2D(Math.PI, Math.PI/180.0, 400, 1);

Then the slice image is projected and displayedc:

Grid2D sinogram = projector.projectRayDriven(phan);
sinogram.show("The Sinogram");

In order to filter the sinogram, we create a copy and instantiate a new filter instance:

RamLakKernel ramLak = new RamLakKernel(400, 1);
Grid2D filteredSinogram = new Grid2D(sinogram);

Next, we apply the Ram-Lak filter to each linear detector array:

for (int theta = 0; theta < sinogram.getSize()[1]; ++theta) {
    ramLak.applyToGrid(filteredSinogram.getSubGrid(theta));
}

The reconstruction is finalized using back-projection:

ParallelBackprojector2D backproj = new ParallelBackprojector2D(200, 200, 1, 1);
backproj.backprojectPixelDriven(filteredSinogram).show("The Reconstruction");

Fan-Beam

The step-by-step code for fan-beam reconstruction is found in the package edu.stanford.rsl.tutorial.fan. In the FanBeamReconstructionExample different phantoms are supported. Furthermore, the code allows to inspect short-scans and different implementations of redundancy weights. Lastly, the fan-beam case requires a cosine weight before the filtering and an adopted projection and back-projection implementations of which both are available as OpenCL implementations.

Cone-beam

The cone-beam step-by-step code is found in the package edu.stanford.rsl.tutorial.cone. The ConeBeamReconstructionExample reads all geometry configuration from the global configuration. Thus, the Opens internal link in current windowtrajectory and the volume needs to be correctly configured in order to run the example. The rest of the example follows the structure of the parallel- and fan-beam examples. A virtual test object is created and projected. Then, the projections are processed. In this case, cosine weights and the Ram-Lak filter are applied. Finally the reconstruction is generated using back-projection.

Note that a OpenCL compatible graphics card is highly recommended to run this example. Furthermore, in the example short scans are not supported. Reconstructions need to be performed along a 360 degree trajectory to obtain correct reconstructions.

 

 

Memory Trouble

Please refer to the Opens internal link in current windowmemory trouble tutorial if the software complains about insufficient memory. This is often related to 32-bit Java VMs.