Hello,
First of all, thank you for your efforts to develop and share the k-wave toolbox!
I am working on an iterative reconstruction method for Photoacoustic tomography, and I would like to use k-wave for simulation of forward and adjoint operators. However, I am having trouble with the implementation of adjoint operator. I have read your paper named "On the adjoint operator in photoacoustic tomography" and also looked at the example Matlab file for Iterative Image Reconstruction Using The Adjoint. In the example file and the paper, you state that the adjoint model is just the forward model with the source suitably defined.
I am literally using the code snippet below from the example file. However, when I apply the inner product test to validate the adjoint, the results of the inner products are very different than each others. One inner product is more than three times the other, so I am not talking about a precision error. Could you help me understand more about how to implement the adjoint operator?
% set the source type to act as an adjoint source
source.p_mode = 'additive';
% calculate the difference between the measured and modelled data
difference = modelled_time_series - sensor_data;
% assign the difference time series as an adjoint source
% (see Appendix B in Arridge et al. Inverse Problems 32, 115012 (2016))
time_reversed_data = fliplr(difference);
source.p = [time_reversed_data(:, 1), time_reversed_data(:, 1), time_reversed_data(:, 1:end-1)] + ...
[zeros(size(time_reversed_data(:, 1))), time_reversed_data(:, 1:end-1), 2 * time_reversed_data(:, end)];
Best regards,
Refik Mert Cam