Dear Bradley,Ben, and Jiri
Firstly, thanks for your helpful library.
I am working on using time reversal to reconstructe an ultrasound focus. Because it's difficult to create a focus same as other methods (which are used to compare with time reversal result), I attempt to create a focal point on the sensor position by source points first, then use time reversal emit the signal from sensor to source points. After that, source points receive the signal and use time reversal again to generate the focus on the sensor position.
But as I know, sensor.time_reversal_boundary_data = sensor_data;
only record the sensor data, how can I clear the source.p between the two time reversal?
Code is below:
source.p = Amp_Pa * sin(angular_v * kgrid.t_array + phase);
input_args = {'DisplayMask', source.p_mask, ...
'PMLInside', false, 'PlotPML', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...
'DataCast', 'single', 'CartInterp', 'nearest'};
% run the simulation
sensor_data = kspaceFirstOrder3DG(kgrid, medium, source, sensor, input_args{:});
% reset the initial pressure
source.p = 0;
% assign the time reversal data
sensor.time_reversal_boundary_data = sensor_data;
% run the time-reversal reconstruction
p_recon1 = kspaceFirstOrder3DG(kgrid, medium, source, sensor, input_args{:});
% reset the initial pressure again (as i know the source.p is changed to p_recon1)
source.p = 0;
% assign the time reversal data again
sensor.time_reversal_boundary_data = p_recon1;
% run the time-reversal reconstruction
p_recon2 = kspaceFirstOrder3DG(kgrid, medium, source, sensor, input_args{:});
and the error is: The number of time series in source.p must match the number of source elements in source.p_mask.
If the source.p between the two time reversal hasn't been cleared, I cannot fix it. So can you tell me the way to clear the second time source.p?
Hoping for your reply.
Thank you
Regards