|
||
Step-by-Step ModeIn 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-BeamThe 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); In order to filter the sinogram, we create a copy and instantiate a new filter instance: RamLakKernel ramLak = new RamLakKernel(400, 1); Next, we apply the Ram-Lak filter to each linear detector array: for (int theta = 0; theta < sinogram.getSize()[1]; ++theta) { The reconstruction is finalized using back-projection: ParallelBackprojector2D backproj = new ParallelBackprojector2D(200, 200, 1, 1); Fan-BeamThe 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-beamThe 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 trajectory 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 memory trouble tutorial if the software complains about insufficient memory. This is often related to 32-bit Java VMs. |