ultrasound_metrics.metrics.sll#
Side Lobe Level (SLL) measurement for point targets in ultrasound images.
Attributes#
Functions#
|
Compute the side lobe level (SLL) of a point target. |
|
Find the side lobe amplitude on one side of the main lobe. |
|
Measure half-width at half-maximum of a 1D array. |
|
Measure the side lobe level (SLL) of the input pixel array. |
Measure side lobe level across all dimensions of the target. |
Module Contents#
- ultrasound_metrics.metrics.sll.compute_sll(
- img: numpy.typing.NDArray[numpy.floating],
- roi_indices: numpy.typing.NDArray[numpy.integer] | None = None,
- dims_to_measure: numpy.typing.NDArray[numpy.integer] | None = None,
- target_radius: int | None = None,
- show_plot: bool = False,
Compute the side lobe level (SLL) of a point target.
- Parameters:
img – The input image.
roi_indices – Region of interest in the form of array indices.
dims_to_measure – List of dimensions across which to measure the SLL. If None, then the default space dimensions of the bmode image are used (dimensions [1,2,3]). If any of these dimensions are singleton, then they are excluded from consideration.
target_radius – Expected radius of the target used to find max point around the max detected within the ROI. This is used in case the target is registered but the position of the max value is not located within the ROI. If None, then then no search for the max value outside the roi is performed.
show_plot – Whether to display plots for visualization.
- Returns:
The side lobe level of the point target over all input and non-singleton dimensions. The side lobe level is calculated as sll = 10*log10((side lobe peak amplitude)/(main lobe peak amplitude)).
- Return type:
- ultrasound_metrics.metrics.sll.find_one_side_side_lobe_amplitude(
- pixel_array: numpy.typing.NDArray[numpy.floating],
Find the side lobe amplitude on one side of the main lobe.
- Parameters:
pixel_array – 1D pixel array.
- Returns:
Amplitude of the first detected side lobe peak.
- Return type:
- ultrasound_metrics.metrics.sll.measure_half_width_half_max(
- pixel_array: numpy.typing.NDArray[numpy.floating],
- max_val: float,
- use_interp: bool,
Measure half-width at half-maximum of a 1D array.
- Parameters:
pixel_array – 1D pixel array.
max_val – Maximum value in the array.
use_interp – Whether to use linear interpolation for sub-pixel precision.
- Returns:
Half-width at half-maximum.
- Return type:
- ultrasound_metrics.metrics.sll.measure_sll(
- im_line: numpy.typing.NDArray[numpy.floating],
- max_idx: int,
- max_val: float,
- use_interp: bool = True,
Measure the side lobe level (SLL) of the input pixel array.
The half-max point is detected and used as a starting index for detecting the next occurring peak in the line. This way, sub-peaks within the main lobe will not be accidentally counted as the side lobe. The side lobe peak is measured on each side of the PSF and then the maximum one is used for computing the SLL.
- Parameters:
im_line – The 1-D orthogonal line across the target.
max_idx – The index of the maximum position in the ROI.
max_val – The value of the maximum position in the ROI.
use_interp – Whether to use linear interpolation to obtain sub-pixel precision for detection of the half-max point.
- Returns:
The side lobe level is calculated as sll = 10*log10((side lobe peak amplitude)/(main lobe peak amplitude)).
- Return type:
- ultrasound_metrics.metrics.sll.measure_sll_of_target(
- img: numpy.typing.NDArray[numpy.floating],
- img_max_idx: tuple[int, Ellipsis],
- show_plot: bool,
Measure side lobe level across all dimensions of the target.
- Parameters:
img – Input image array.
img_max_idx – Index of the maximum value in the image.
show_plot – Whether to display plots for visualization.
- Returns:
Side lobe level for each dimension.
- Return type:
ndarray