Skip to content

Commit a33a7df

Browse files
authored
Update README.md
1 parent 70bc02c commit a33a7df

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This package can readily be used to develop new transducer array designs by spec
2727
- Performant:
2828
- Beamform a 1024 x 1024 image for 256 x 256 transmits/receives in < 2 seconds (RTX 3070)
2929
- Hardware acceleration via CUDA (Nvidia) or OpenCL (AMD, Apple, Intel, Nvidia), or natively via the [Parallel Computing Toolbox](https://www.mathworks.com/products/parallel-computing.html)
30-
- Memory efficient classes and methods minimize data storage and computional load
30+
- Memory efficient classes and methods such as separable beamforming delay and apodization ND-arrays minimize data storage and computational load
3131
- Batch simulations locally via [`parcluster`](https://www.mathworks.com/help/parallel-computing/parcluster.html) or scale to a cluster with the [MATLAB Parallel Server](https://www.mathworks.com/products/matlab-parallel-server.html) (optional) toolbox.
3232

3333
- Modular:
@@ -38,14 +38,14 @@ This package can readily be used to develop new transducer array designs by spec
3838
- Export or import data between [USTB](https://www.ustb.no/) or [Verasonics](https://verasonics.com/vantage-advantage/) data structures
3939

4040
- Intuitive:
41-
- Native MATLAB semantics with tab auto-completion
41+
- Native MATLAB semantics with [argument validation](https://www.mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html) and tab auto-completion
4242
- Overloaded `plot` and `imagesc` functions for data visualization
4343
- Documentation via `help` and `doc`
4444

4545

4646
## Installation
4747
### MATLAB R2023b+ & git
48-
Starting in MATLAB R2023b+, QUPS and most of it's extension packages can be installed within MATLAB via [buildtool](https://www.mathworks.com/help/matlab/ref/buildtool.html) if you have setup [git for MATLAB](https://www.mathworks.com/help/matlab/matlab_prog/set-up-git-source-control.html).
48+
Starting in MATLAB R2023b+, QUPS and most of it's extension packages can be installed from within MATLAB via [buildtool](https://www.mathworks.com/help/matlab/ref/buildtool.html) if you have setup [git for MATLAB](https://www.mathworks.com/help/matlab/matlab_prog/set-up-git-source-control.html).
4949
1. Install qups
5050
```
5151
gitclone("https://github.com/thorstone25/qups.git");
@@ -81,12 +81,12 @@ All extensions to QUPS are optional, but must be installed separately from their
8181

8282
| Extension | Description | Installation Paths | Citation |
8383
| ------ | ------ | ------ | ---------- |
84-
| [FieldII](https://www.field-ii.dk/) | point scatterer simulator | `addpath path/to/fieldII`| [website](https://www.field-ii.dk/?background.html) |
85-
| [k-Wave](http://www.k-wave.org/index.php) | distributed medium simulator | `addpath path/to/kWave` | [website](https://github.com/ucl-bug/k-wave?tab=readme-ov-file#license) |
86-
| [kWaveArray](http://www.k-wave.org/forum/topic/alpha-version-of-kwavearray-off-grid-sources) | k-Wave transducer extension | `addpath path/to/kWaveArray` | [forum](http://www.k-wave.org/forum/topic/alpha-version-of-kwavearray-off-grid-sources), [paper](http://bug.medphys.ucl.ac.uk/papers/2019-Wise-JASA.pdf) |
87-
| [MUST](https://www.biomecardio.com/MUST/documentation.html) | point scatterer simulator | `addpath path/to/MUST`| [website](https://www.biomecardio.com/MUST/documentation.html) |
88-
| [USTB](https://www.ustb.no/) | signal processing library and toolbox | `addpath path/to/USTB` | [website](https://www.ustb.no/citation/) |
89-
| [Matlab-OpenCL](https://github.com/thorstone25/Matlab-OpenCL) | hardware acceleration | (see [README](https://github.com/thorstone25/Matlab-OpenCL/blob/main/README.md))| [website](https://github.com/IANW-Projects/MatCL?tab=readme-ov-file#reference) (via MatCL) |
84+
| [FieldII](https://www.field-ii.dk/) | point scatterer simulator | `addpath /path/to/fieldII`| [website](https://www.field-ii.dk/?background.html) |
85+
| [k-Wave](http://www.k-wave.org/index.php) | distributed medium simulator | `addpath /path/to/kWave` | [website](https://github.com/ucl-bug/k-wave?tab=readme-ov-file#license) |
86+
| [kWaveArray](http://www.k-wave.org/forum/topic/alpha-version-of-kwavearray-off-grid-sources) | k-Wave transducer extension | `addpath /path/to/kWaveArray` | [forum](http://www.k-wave.org/forum/topic/alpha-version-of-kwavearray-off-grid-sources), [paper](http://bug.medphys.ucl.ac.uk/papers/2019-Wise-JASA.pdf) |
87+
| [MUST](https://www.biomecardio.com/MUST/documentation.html) | point scatterer simulator | `addpath /path/to/MUST`| [website](https://www.biomecardio.com/MUST/documentation.html) |
88+
| [USTB](https://www.ustb.no/) | signal processing library and toolbox | `addpath /path/to/USTB` | [website](https://www.ustb.no/citation/) |
89+
| [Matlab-OpenCL](https://github.com/thorstone25/Matlab-OpenCL) | hardware acceleration | (see [README](https://github.com/thorstone25/Matlab-OpenCL/blob/main/README.md)) | [website](https://github.com/IANW-Projects/MatCL?tab=readme-ov-file#reference) (via MatCL) |
9090
| [CUDA](https://docs.nvidia.com/cuda/cuda-quick-start-guide/index.html) | hardware acceleration | (see [CUDA Support](#cuda-support)) | |
9191

9292
## Quick Start
@@ -102,7 +102,7 @@ setup parallel CUDA cache; % setup the environment with any available accelerati
102102
3. Create an ultrasound system and point scatterer to simulate
103103
```
104104
scat = Scatterers('pos', 1e-3*[0 0 30]'); % a single point scatterer at 20mm depth
105-
xdc = TransducerArray.L11_5v(); % simulate a Verasonics L11-5v transducer
105+
xdc = TransducerArray.P4_2v(); % simulate a Verasonics L11-5v transducer
106106
seq = Sequence('type', 'FSA', 'numPulse', xdc.numel); % full synthetic-aperture pulse sequence
107107
scan = ScanCartesian('x', 1e-3*[-10, 10], 'z', 1e-3*[25 35]); % set the image boundaries - we'll set the resolution later
108108
us = UltrasoundSystem('xdc', xdc, 'seq', seq, 'scan', scan, 'fs', 4*xdc.fc); % create a system description
@@ -118,17 +118,16 @@ figure; plot(us); hold on; plot(scat, 'cx'); % plot the ultrasound system and th
118118

119119
5. Simulate channel data
120120
```
121-
chd = greens(us, scat); % create channel data using a shifted Green's function (OpenCL-enabled)
121+
chd = greens(us, scat); % create channel data using a shifted Green's function (CUDA/OpenCL-enabled)
122122
% chd = calc_scat_multi(us, scat); % ... or with FieldII
123123
% chd = kspaceFirstOrder(us, scat); % ... or with k-Wave (CUDA-enabled)
124124
% chd = simus(us, scat); % ... or with MUST (CUDA-enabled)
125125
126126
```
127127
6. Display the channel data
128128
```
129-
figure; imagesc(chd);
130-
colormap jet; colorbar;
131-
animate(chd.data);
129+
figure; imagesc(chd); dbr echo 60;
130+
animate(chd.data, 'loop', false, 'title', "Tx: "+(1:chd.M));
132131
```
133132
![](fig/README/channel_data.gif)
134133

@@ -138,8 +137,7 @@ b = DAS(us, hilbert(chd));
138137
```
139138
8. Display the B-mode image
140139
```
141-
figure; imagesc(us.scan, b); % plot the image (in dB when b is complex)
142-
dbr b-mode 60; % ... with 60dB dynamic range
140+
figure; imagesc(us.scan, b); dbr b-mode 60;
143141
title('B-mode image');
144142
```
145143

@@ -169,17 +167,17 @@ If you use any of the extensions, please see their citation policies:
169167
* [USTB](https://www.ustb.no/citation/)
170168

171169
## Parallel Processing with External Packages
172-
Some QUPS methods, including most simulation and beamforming methods, can be parallelized natively by specifying a `parcluster` or launching a `parallel.ProcessPool` or a `parallel.ThreadPool`. However, restrictions apply.
170+
Some QUPS methods, including most simulation and beamforming methods, can be parallelized natively by specifying a `parcluster` or launching a `parallel.ProcessPool` or ideally a `parallel.ThreadPool`. However, restrictions apply.
173171

174-
Workers in a `parallel.ThreadPool` cannot call mex functions, use GUIs or user inputs, or perform any file operations (reading or writing). Workers in a `parallel.ProcessPool` or `parcluster` do not have these restrictions, but tend to be somewhat slower and require much more memory. All workers are subject to [race conditions](https://en.wikipedia.org/wiki/Race_condition).
172+
Workers in a `parallel.ThreadPool` cannot call mex functions, use GUIs or user inputs, or perform any file operations (reading or writing) [before R2024a](https://www.mathworks.com/help/parallel-computing/release-notes.html#mw_c7230d70-f9e0-4600-8c6b-3e47ed5396c2). Workers in a `parallel.ProcessPool` or `parcluster` do not have these restrictions, but tend to be somewhat slower and require much more memory. All workers are subject to [race conditions](https://en.wikipedia.org/wiki/Race_condition).
175173

176-
Removing race conditions and inaccesible functions in the extension packages will enable native parallelization. The patches described below are applied automatically with the "patch" task via buildtool. Otherwise, you will need to apply the patches manually to enable parallelization.
174+
Removing race conditions and inaccesible functions in the extension packages will enable native parallelization. The patches described below are applied automatically with the "[patch](https://github.com/thorstone25/qups/edit/main/README.md#matlab-r2023b--git)" task via buildtool. Otherwise, you will need to apply the patches manually to enable parallelization.
177175

178176
### [FieldII](https://www.field-ii.dk/)
179177
FieldII uses [mex](https://www.mathworks.com/help/matlab/call-mex-file-functions.html) functions for all calls, which requires file I/O. This **cannot** be used with a `parallel.ThreadPool`, but can easily be used with a `parallel.ProcessPool` or `parcluster`.
180178

181179
### [k-Wave](http://www.k-wave.org/index.php) (with binaries)
182-
To enable simulating multiple transmits simultaneously using k-Wave binaries, the temporary filename race condition in `kspaceFirstOrder3DC.m` must be removed.
180+
To enable simulating multiple transmits simultaneously using k-Wave binaries, the temporary filename race condition in `kspaceFirstOrder3DC.m` must be remedied.
183181
Edit `kspaceFirstOrder3DC.m` and look for an expression setting the temporary folder `data_path = tempdir`. Replace this with `data_path = tempname; mkdir(data_path);` to create a new temporary directory for each worker.
184182
You may also want to delete this folder after the temporary files are deleted. Record a variable `new_path = true;` if a new directory was created, and place `if new_path, rmdir(data_path); end` at the end of the function. Otherwise, the temporary drive is cleared when the system reboots.
185183

0 commit comments

Comments
 (0)