Hi,
It seems that the time-reversal reconstruction is not available in the current release of the C++ code. Is this right? I just want to confirm.
Thanks,
Chao
Hi,
It seems that the time-reversal reconstruction is not available in the current release of the C++ code. Is this right? I just want to confirm.
Thanks,
Chao
Hi Chao,
The original method of using time-reversal (i.e., setting sensor.time_reversal_boundary_data
) is not included in the C++ code. However, you can use time-reversal in the more general way of reversing the recorded boundary data and applying it as a Dirichlet boundary condition. If you look inside the function kspaceFirstOrder3DC
, you can see an example of how this is done. The net result is the same via both methods.
Brad.
Hi,
I would like to use k-wave's C++ code on a compute cluster without matlab via the command line and to do time-reversal reconstruction instead of FFT, but I am not able to create the HDF5 files using kspaceFirstOrder3D(kgrid, medium, source, sensor, 'SaveToDisk', filename);
When looking at kspaceFirstOrder3DC.m
time_rev
is set to true if the sensor has a time_reversal_boundary_data
field -- however, when calling the kspaceFirstOrder3D function, an error is raised with the message "The optional input 'SaveToDisk' is currently only compatible with forward simulations using a non-zero binary sensor mask", but the sensor mask is non-zero.
Could you explain in more detail how to use the C++ for time-reversal reconstruction instead of FFT? An example script would be fantastic (I was using the example_pr_3D_TR_planar_sensor.m
as starting point so far).
Many thanks in advance and best regards,
Bernhard Kaplan
Hi Bernhard,
As mentioned above, you can use the C++ code directly for time reversal, but you need to manually reverse your recorded boundary data, and then use this as a Dirichlet source in your simulation. In steps:
(1) Instead of assigning your boundary data to sensor.time_reversal_boundary_data
, reverse it in time and assign to source.p
, i.e.,
source.p = flipdim(boundary_data, 2);
(2) Set the source to be a Dirichlet boundary condition
source.p_mode = 'dirichlet';
(3) Instead of assigning the position of your detectors to sensor.mask
, assign it to source.p_mask
(4) Set sensor.record = {'p_final'}
to record the final (i.e., reconstructed) pressure field. The sensor mask isn't used in this case, so anything will do. Your reconstructed image will be contained in the field sensor_data.p_final
If you are stuck on how to get started with time-reversal using the normal syntax, there are several examples included in the toolbox.
Hope that helps,
Brad.
You must log in to post.