k-Wave Toolbox |
![]() ![]() |
On this page… |
---|
This example demonstrates the use of k-Wave for the reconstruction of a three-dimensional photoacoustic wave-field recorded over a planar sensor array. The sensor data is simulated using kspaceFirstOrder3D
and reconstructed using kspacePlaneRecon
. It builds on the Simulations In Three Dimensions and 2D FFT Reconstruction For A Line Sensor examples.
The sensor data is simulated using kspaceFirstOrder3D
in the same way as in the preceeding simulation examples. The initial pressure is created using makeBall
and is again smoothed prior to invoking the simulation. The sensor mask is defined to be a planar sensor array (over a plane z = const) with the size of the mask offset so it is not within the PML. A visualisation of the initial pressure distribution and the sensor mask is given below.
% smooth the initial pressure distribution and restore the magnitude source.p0 = smooth(kgrid, source.p0, true); % define a binary planar sensor sensor.mask = zeros(kgrid.Nz, kgrid.Nx, kgrid.Ny); sensor.mask(1+PML_size, 1+PML_size:end-PML_size, 1+PML_size:end-PML_size) = 1;
The reconstruction is invoked by calling kspacePlaneRecon
with the time-series data (recorded over a planar sensor array), as well as the properties of the acoustic medium and the sampling parameters. The time-series data input must be indexed as p_txy(time step, sensor x position, sensor y position)
so the simulated sensor_data
returned by kspaceFirstOrder3D
must first be reshaped and reordered.
% reshape sensor data to x, y, t [Np Nt] = size(sensor_data); sensor_data_rs = reshape(sensor_data, sqrt(Np), sqrt(Np), Nt); % reorder to t, x, y sensor_data_rs = permute(sensor_data_rs, [3 1 2]); % reconstruct the initial pressure p_zxy = kspacePlaneRecon(sensor_data_rs, kgrid.dx, kgrid.dy, dt, medium.sound_speed, 'PosCond', true);
The size of the recorded data and the time to compute the reconstruction are both printed to the command line.
Running k-space planar reconstruction... grid size: 112 by 112 by 641 pixels interpolation mode: *nearest applying positivity condition... computation completed in 10.5369s
A plot of the initial pressure distribution (removing the width of the PML) and the reconstructed initial pressure distribution with a positivity condition (interpolated onto a k-space grid with the same dimensions) are shown below. The three displayed image planes intersect at the centre of ball shown above.
Initial pressure distribution:
Reconstructed initial pressure distribution:
The effective visualisation of three-dimensional matrix data remains an important part of data exploration and presentation. An animated slice-by-slice visualisation of the reconstructed initial pressure distribution can be viewed using flyThrough
.
% view reconstruction slice by slice flyThrough(p_zxy_rs);
![]() |
2D FFT Reconstruction For A Line Sensor | 2D Time Reversal Reconstruction For A Line Sensor | ![]() |
© 2009, 2010 Bradley Treeby and Ben Cox.