Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/DW_echo_demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
"metadata": {},
"outputs": [],
"source": [
"xi,zi = pymust.impolgrid(np.array([256, 128]),15e-2,np.deg2rad(80), param)"
"xi,zi = pymust.impolgrid(np.array([256, 128]),15e-2,np.deg2rad(80), param)\n"
]
},
{
Expand Down
3 changes: 3 additions & 0 deletions src/pymust/dasmtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ def dasmtx(SIG: np.ndarray, x: np.ndarray, z: np.ndarray, *varargin) -> scipy.sp


#%-- Number of elements
assert isinstance(delaysTX,np.ndarray), 'delaysTX must be a numpy array.'
if len(delaysTX.shape) == 1:
delaysTX = delaysTX.reshape((1, -1))
if delaysTX.shape[0] == nc and delaysTX.shape[1] != nc:
delaysTX = delaysTX.T

Expand Down
1 change: 1 addition & 0 deletions src/pymust/dasmtx3.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from __future__ import annotations
import numpy as np
import scipy, scipy.interpolate
from . import utils
Expand Down
2 changes: 1 addition & 1 deletion src/pymust/pfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def pfield(x: np.ndarray, y: np.ndarray, z: np.ndarray, delaysTX: np.ndarray, pa
isMKMOVIE = options.CallFun == 'mkmovie'

#GB: TODO: do parallelism
#GB TODO: For txhe moment no statistics.
#GB TODO: For the moment no statistics of usage.


#%---------------------------%
Expand Down
Binary file modified tutorials/Figures/s1_ex1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 35 additions & 12 deletions tutorials/P1_radiofrequency.ipynb

Large diffs are not rendered by default.

28 changes: 21 additions & 7 deletions tutorials/P2_several_elements_new.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 13,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -56,13 +56,22 @@
"\n",
"### Execise 2.1: Pressure field\n",
"\n",
"1. Execute the code to generate the pressure field for a linear wave without a tilt. Place two points at regions which are at the same distance but the center of the probe, but recieve different energy.\n",
"1. Execute the code to generate the pressure field for a linear wave without a tilt. Place two points at regions which are at the same distance to the center of the probe, but receive different energy.\n",
"\n",
"1. Use two times simus in order to get the RF associated to each point chosen in the previous exercise. What do you observe? [Note: now the probe involves many piezoelectrical elements, and as such the RF signal will have a channel for each. Now you can use the center element (channel #31)]\n",
"\n",
"1. Add attenuation of 0.5dB/cm. What do you observe in the pressure field and why?"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!pip install pymust --upgrade"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -99,7 +108,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -131,7 +140,7 @@
}
],
"source": [
"plt.imshow(20*np.log10(P.T/np.max(P)),\n",
"plt.imshow(20*np.log10(P/np.max(P)),\n",
" cmap='hot',\n",
" extent=[xGrid[0,0]*1e2,xGrid[0,-1]*1e2,zGrid[-1,0]*1e2,zGrid[0,0]*1e2],aspect='auto')\n",
"plt.colorbar()\n",
Expand Down Expand Up @@ -279,13 +288,18 @@
" param.width *= factor\n",
" param.pitch *= factor\n",
" param.kerf *= factor\n",
" if 'TXapodization' in param:\n",
" del param['TXapodization']\n",
" return param\n",
"\n",
"def changeNumberOfElements(param, factor):\n",
" \"\"\"\n",
" Scale the number of piezoelectrical elements to 1\n",
" \"\"\"\n",
" param.Nelements *= int(factor)\n",
" param.Nelements = int(param.Nelements*factor)\n",
" if 'TXapodization' in param:\n",
" del param['TXapodization']\n",
"\n",
" return param\n",
"\n",
"\n",
Expand Down Expand Up @@ -350,7 +364,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "pymust",
"display_name": "pymust-test",
"language": "python",
"name": "python3"
},
Expand All @@ -364,7 +378,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.12.3"
},
"orig_nbformat": 4
},
Expand Down
177 changes: 65 additions & 112 deletions tutorials/P3_bmode.ipynb

Large diffs are not rendered by default.

206 changes: 129 additions & 77 deletions tutorials/P4_different_probes.ipynb

Large diffs are not rendered by default.

76 changes: 53 additions & 23 deletions tutorials/P5_Doppler.ipynb

Large diffs are not rendered by default.

45 changes: 19 additions & 26 deletions tutorials/P6_spectralDoppler.ipynb

Large diffs are not rendered by default.