I am trying to port the diagnostic US example and trying to run this using the C++ code. Considering following matlab loop:
% loop through the scan lines
for scan_line_index = 1:number_scan_lines
% load the current section of the medium
medium.sound_speed = sound_speed_map(:, medium_position:medium_position + Ny - 1, :);
medium.density = density_map(:, medium_position:medium_position + Ny - 1, :);
% run the simulation
sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});
% extract the scan line from the sensor data
scan_lines(scan_line_index, :) = transducer.scan_line(sensor_data);
% update medium position
medium_position = medium_position + transducer.element_width;
end
If I understand correctly, if I need to move this to C++, I should basically create HD5 input file for every call to kspaceFirstOrder3D
and them call the C++ application with that input file. So, is it correct that if I want to reproduce this example, I need to create number_scan_lines
HD5 input files and then call the C++ program on each of them?
Assuming this is correct, the next matlab line in the example is:
scan_lines(scan_line_index, :) = transducer.scan_line(sensor_data);
How do I then create the scan lines array from the C++ outputs?