k-Wave Toolbox |

## 2D Time Reversal Reconstruction For A Line Sensor Example

On this page…
Overview Performing the time-reversal reconstruction Comparison with the FFT reconstruction

### Overview

This example demonstrates the use of k-Wave for the time-reversal reconstruction of a two-dimensional photoacoustic wave-field recorded over a linear sensor array. The sensor data is simulated and then time-reversed using `kspaceFirstOrder2D`. It builds on the 2D FFT Reconstruction For A Line Sensor Example.

- open the file in the MATLAB Editor
- run the file in MATLAB

Back to Top

### Performing the time-reversal reconstruction

The first-order k-space functions already used for the simulation of photoacoustic wave propagation can also be used for photoacoustic image reconstruction by setting the optional input parameter `'TimeRev'` to `true`. Instead of the initial pressure distribution, the time varying pressure recorded over the sensor array is given as `p0`. This pressure is then enforced over the given sensor mask as a time-varying Dirichlet boundary condition. By passing the `sensor_data` returned from a k-space simulation directly to `kspaceFirstOrder2D` with `'TimeRev'` set to `true`, it is straightforward to compute a time-reversal reconstruction via the inverse crime.

    % run the simulation
    sensor_data = kspaceFirstOrder2D(p0, kgrid, c, rho, t_array, sensor_mask, input_args{:});

    % add time-reversal flag to the input options
    input_args = [input_args, {'TimeRev', true}];

    % run the time-reversal reconstruction
    p0_recon = kspaceFirstOrder2D(sensor_data, kgrid, c, rho, t_array, sensor_mask, input_args{:});

The initial photoacoustic pressure distribution used in the simulation, and the reconstructed initial pressure distribution using time-reversal are shown below.

Back to Top

### Comparison with the FFT reconstruction

It is useful to compare the performance of the time-reversal and FFT reconstruction algorithms. The command line output of the two functions are given below. It is clear that the time-reversal reconstruction takes significantly longer to compute; more than an order of magnitude for this example, even using the slower `'*cubic'` interpolation and a non 2^N grid size for the FFT comparison. However, in contrast to the one-step FFT reconstruction, time-reversal can account for a heterogeneous propagation medium and a sensor mask of arbitrary shape.

    Running k-space time reversal...
      dt: 20ns, t_end: 15.54us, time steps: 778
      input grid size: 216 by 88 pixels (21.6 by 8.8mm)
      expanding computational grid...
      computation grid size: 256 by 128 pixels
      precomputation completed in 0.26306s
      starting time loop...
      computation completed in 11.7251s
    Running k-space line reconstruction...
      grid size: 216 by 778 pixels
      interpolation mode: *cubic
      applying positivity condition...
      computation completed in 0.5837s

The time-reversed initial pressure distribution with a positivity condition is shown below. A profile through the larger disc, including a comparison with the analogous FFT reconstruction, is also given. The time-reversal reconstruction has a slightly improved signal to noise ratio, although, it is important to note that the inverse crime has been commited.

Back to Top

© 2009 Bradley Treeby and Ben Cox.