- execute Field II in Python;
- support parallel simulation;
- support config files;
- support delay-and-sum and synthetic aperture algorithm.
- make sure that MATLAB R2015b or later has been installed;
- install Python 3.4 or 3.5;
- install requirements
pip3 install -r requirements.txt
; - install MATLAB engines;
- open several MATLAB sessions and share them;
- run unittest
python3 -m pytest
.
- cd MATLAB path, for me it's
/Applications/MATLAB_R2016b.app/
; - cd
./extern/engines/python
; - run
python3 setup.py install
,sudo
if need; - run
python3 -c "import matlab.engine"
for test.
Run this command several times, change MATLAB path if need.
nohup /Applications/MATLAB_R2016b.app/bin/matlab &
disown
python3 simu.py configs/multi_scat.json
Default config files are in configs
folder. And the final signal result will be stored in save_path configured in config file, filename is signal
.
multi_scat.json config:
{
"save_path": "data/multi_scat",
"worker": "MultiScat",
"transducer_frequency": 5e6,
"sampling_frequency": 4e7,
"element_count": 128,
"element_width": 2.798e-4,
"element_height": 4e-3,
"kerf": 2.5e-05,
"focus": [0.0, 0.0, 3.3e-2],
"line_count": 64,
"row_count": 1024,
"data_length": 2048,
"dynamic_range": 20,
"z_start": 5e-3,
"z_size": 40e-3,
"point_count": 6,
"light_points": [
[-2e-3, 0e-3, 15e-3],
[ 2e-3, 0e-3, 15e-3],
[-4e-4, 0e-3, 25e-3],
[ 4e-4, 0e-3, 25e-3],
[-2e-3, 0e-3, 35e-3],
[ 2e-3, 0e-3, 35e-3]
]
}
Firstly, make sure the cpp_method has been built successfully.
cd cpp_method
make
cd .. # return repo root path
Execute beamforming of C++ version:
cpp_method/bin/beamforming -c configs/multi_scat.json -m synthetic_aperture -t 5
- -c: config file path
- -m: calculation method
- -t: running times
There is also another C++ version without console output to improve accuracy of time measuring: cpp_method/bin/measure
.
The final image data will be stored in save_path configured in config file, filename is image.{method}
.
python3 show.py configs/multi_scat.json delay_and_sum
- Store in JSON
- Render
- Lateral Resolution Implementation
- Contrast Implementation
- SINE: Method Learning & Implementation
- Simulation
- Run & Collect Result
- Render