Skip to content

Commit 357e208

Browse files
authored
Merge pull request creatis-ULTIM#40 from dribalta/annotations
Fixed and added annotations
2 parents 9569bbb + 6271b02 commit 357e208

19 files changed

+50
-50
lines changed

src/pymust/bmode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np
22
from . import utils
3-
def bmode(IQ : np.ndarray, DR: float= 40) -> np.ndarray:
3+
def bmode(IQ: np.ndarray, DR: float = 40) -> np.ndarray:
44

55
"""
66
%BMODE B-mode image from I/Q signals

src/pymust/dasmtx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from . import utils
66

77

8-
def dasmtx(SIG : np.ndarray, x: np.ndarray, z: np.ndarray, *varargin) -> scipy.sparse.spmatrix:
8+
def dasmtx(SIG: np.ndarray, x: np.ndarray, z: np.ndarray, *varargin) -> scipy.sparse.spmatrix:
99
"""
1010
%DASMTX Delay-and-sum matrix
1111
% M = DASMTX(SIG,X,Z,DELAYS,PARAM) returns the numel(X)-by-numel(SIG)

src/pymust/dasmtx3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import scipy, scipy.interpolate
33
from . import utils
44

5-
def dasmtx3(SIG : np.ndarray, x: np.ndarray, y: np.ndarray, z: np.ndarray, *varargin) -> scipy.sparse.spmatrix:
5+
def dasmtx3(SIG: np.ndarray, x: np.ndarray, y: np.ndarray, z: np.ndarray, *varargin) -> scipy.sparse.spmatrix:
66
"""
77
DASMTX3 Delay-and-sum matrix for 3-D imaging with a matrix array
88
M = DASMTX3(SIG,X,Y,Z,DELAYS,PARAM) returns the numel(X)-by-numel(SIG)

src/pymust/genscat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from . import utils
55
import numpy as np
66

7-
def genscat(roidim : np.ndarray, meandist: np.ndarray ,I : Union[np.ndarray, None] = None, g: Union[np.ndarray, float] = None) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
7+
def genscat(roidim: np.ndarray, meandist: np.ndarray ,I: Union[np.ndarray, None] = None, g: Union[np.ndarray, float] = None) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
88
"""
99
%GENSCAT Generate a distribution of scatterers
1010
% [XS,YS,ZS] = GENSCAT([WIDTH HEIGHT],MEANDIST) generates a 2-D

src/pymust/getparam.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
from . import utils
33

44

5-
def getparam(probe : str) -> utils.Param:
5+
def getparam(probe: str) -> utils.Param:
66
#GETPARAM Get parameters of a uniform linear or convex array
77
# PARAM = GETPARAM opens a dialog box which allows you to select a
88
# transducer whose parameters are returned in PARAM.
9-
9+
1010
# PARAM = GETPARAM(PROBE), where PROBE is a string, returns the prameters
1111
# of the transducer given by PROBE.
12-
12+
1313
# The structure PARAM is used in several functions of MUST (Matlab
1414
# UltraSound Toolbox). The structure returned by GETPARAM contains only
1515
# the fields that describe a transducer. Other fields may be required in
1616
# some MUST functions.
17-
17+
1818
# PROBE can be one of the following:
1919
# ---------------------------------
2020
# 1) 'L11-5v' (128-element, 7.6-MHz linear array)
2121
# 2) 'L12-3v' (192-element, 7.5-MHz linear array)
2222
# 3) 'C5-2v' (128-element, 3.6-MHz convex array)
2323
# 4) 'P4-2v' (64-element, 2.7-MHz phased array)
24-
24+
2525
# These are the <a
2626
# href="matlab:web('https://verasonics.com/verasonics-transducers/')">Verasonics' transducers</a>.
2727
# Feel free to complete this list for your own use.
28-
28+
2929
# PARAM is a structure that contains the following fields:
3030
# --------------------------------------------------------
3131
# 1) PARAM.Nelements: number of elements in the transducer array
@@ -37,8 +37,8 @@ def getparam(probe : str) -> utils.Param:
3737
# 7) PARAM.radius: radius of curvature (in m, Inf for a linear array)
3838
# 8) PARAM.focus: elevation focus (in m)
3939
# 9) PARAM.height: element height (in m)
40-
41-
40+
41+
4242
# Example:
4343
# -------
4444
# #-- Generate a focused pressure field with a phased-array transducer
@@ -62,21 +62,21 @@ def getparam(probe : str) -> utils.Param:
6262
# c = colorbar;
6363
# c.YTickLabel{end} = '0 dB';
6464
# xlabel('[cm]')
65-
66-
65+
66+
6767
# This function is part of <a
6868
# href="matlab:web('https://www.biomecardio.com/MUST')">MUST</a> (Matlab UltraSound Toolbox).
6969
# MUST (c) 2020 Damien Garcia, LGPL-3.0-or-later
70-
70+
7171
# See also TXDELAY, PFIELD, SIMUS, GETPULSE.
72-
72+
7373
# -- Damien Garcia -- 2015/03, last update: 2020/07
7474
# website: <a
7575
# href="matlab:web('https://www.biomecardio.com')">www.BiomeCardio.com</a>
7676
param = utils.Param()
7777
probe = probe.upper()
78-
79-
78+
79+
8080
# from computeTrans.m (Verasonics, version post Aug 2019)
8181
if 'L11-5V' == probe:
8282
# --- L11-5v (Verasonics) ---
@@ -173,4 +173,4 @@ def getparam(probe : str) -> utils.Param:
173173
else:
174174
raise Exception(np.array(['The probe ',probe,' is unknown. Should be one of [L11-5V, L12-3V, C5-2V, P4-2V, PA4-2/20, L9-4/38, LA530, L14-5/38, L14-5W/60, P6-3]']))
175175

176-
return param
176+
return param

src/pymust/getpulse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
22
import numpy as np
3-
from . import utils
3+
from . import utils
44

5-
def getpulse(param: utils.Param, way :int = 2, PreVel : str = 'pressure', dt : float = 1e-09) -> tuple[np.ndarray, np.ndarray]:
5+
def getpulse(param: utils.Param, way: int = 2, PreVel: str = 'pressure', dt: float = 1e-09) -> tuple[np.ndarray, np.ndarray]:
66
#GETPULSE Get the transmit pulse
77
# PULSE = GETPULSE(PARAM,WAY) returns the one-way or two-way transmit
88
# pulse with a time sampling of 1 nanosecond. Use WAY = 1 to get the

src/pymust/impolgrid.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import numpy as np, logging, typing
22
from . import utils
3-
def impolgrid(siz : typing.Union[int, np.ndarray, list ], zmax : float, width:float, param : utils.Param =None):
3+
def impolgrid(siz: typing.Union[int, np.ndarray, list], zmax: float, width: float, param: utils.Param = None):
44
"""
55
%IMPOLGRID Polar-type grid for ultrasound images
66
% IMPOLGRID returns a polar-type (fan-type) grid expressed in Cartesian
@@ -111,7 +111,7 @@ def impolgrid(siz : typing.Union[int, np.ndarray, list ], zmax : float, width:fl
111111
isLINEAR = np.isinf(R)
112112

113113
if not isLINEAR and not noWidth:
114-
logging.warning('MUST:impolgrid', 'The parameter WIDTH is ignored with a convex array.')
114+
logging.warning('MUST:impolgrid', 'The parameter WIDTH is ignored with a convex array.')
115115

116116
#%-- Origo (x0,z0)
117117
#% x0 = 0;
@@ -143,4 +143,4 @@ def impolgrid(siz : typing.Union[int, np.ndarray, list ], zmax : float, width:fl
143143
return x, z
144144

145145
def pol2cart(th, r):
146-
return r*np.cos(th), r*np.sin(th)
146+
return r*np.cos(th), r*np.sin(th)

src/pymust/iq2doppler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22
import numpy as np,scipy, scipy.signal, typing
33
from . import utils
4-
def iq2doppler(IQ:np.ndarray, param: utils.Param, M: typing.Union[int,np.ndarray ]= 1,lag :int=1) -> tuple[np.ndarray, np.ndarray]:
4+
def iq2doppler(IQ: np.ndarray, param: utils.Param, M: typing.Union[int,np.ndarray] = 1, lag: int = 1) -> tuple[np.ndarray, np.ndarray]:
55
"""
66
%IQ2DOPPLER Convert I/Q data to color Doppler
77
% VD = IQ2DOPPLER(IQ,PARAM) returns the Doppler velocities from the I/Q

src/pymust/pfield.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def average_over_last_axis(X):
2929
#GB TODO: add wait bar
3030
#GB TODO: allow parallelization
3131

32-
def pfield(x : np.ndarray,y : np.ndarray, z: np.ndarray, delaysTX : np.ndarray, param: utils.Param, isQuick : bool = False, options : utils.Options = None):
32+
def pfield(x: np.ndarray, y: np.ndarray, z: np.ndarray, delaysTX: np.ndarray, param: utils.Param, isQuick: bool = False, options: utils.Options = None):
3333
#PFIELD RMS acoustic pressure field of a linear or convex array
3434
# RP = PFIELD(X,Y,Z,DELAYS,PARAM) returns the radiation pattern of a
3535
# uniform LINEAR or CONVEX array whose elements are excited at different

src/pymust/pfield3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def average_over_last_axis(X):
2525
eps = np.finfo(np.float32).eps
2626
mysinc = lambda x = None: np.sin(np.abs(x) + eps)/ (np.abs(x) + eps) # [note: In MATLAB/numpy, sinc is sin(pi*x)/(pi*x)]
2727

28-
def pfield3(x : np.ndarray, y : np.ndarray, z: np.ndarray, delaysTX : np.ndarray, param: utils.Param, isQuick : bool = False, options : utils.Options = None):
28+
def pfield3(x: np.ndarray, y: np.ndarray, z: np.ndarray, delaysTX: np.ndarray, param: utils.Param, isQuick: bool = False, options: utils.Options = None):
2929
"""
3030
PFIELD3 3-D RMS acoustic pressure field of a planar 2-D array
3131
RP = PFIELD3(X,Y,Z,DELAYS,PARAM) returns the three-dimensional

0 commit comments

Comments
 (0)