pyquantus.utc.analysis module

class pyquantus.utc.analysis.UtcAnalysis

Bases: object

Complete ultrasound tissue characterization (UTC) analysis of an ultrasound image given a corresponding phantom image.

This class supports both scan converted and non-scan converted images. UTC analysis is performed on each window generated by the generateRoiWindows method. Utc analysis corresponds to the computation of tissue characterization-related parameters. The midband fit, spectral slope, and spectral intercept parameters have been validated using the frequency domain of each window. The Nakagami parameters, attenuation coefficient, backscatter coefficient, effective scatterer diameter, and effective scatterer concentration all have been implemented and reviewed, but still have not been validated in practice.

ultrasoundImage

Stores image and RF info for image and phantom.

Type:

UltrasoundImage

config

Stores analysis configuration parameters.

Type:

AnalysisConfig

roiWindows

List of windows generated by generateRoiWindows.

Type:

List[Window]

waveLength

Wavelength of the ultrasound signal in mm.

Type:

float

nakagamiParams

Nakagami parameters (w, u) for the entire ROI.

Type:

Tuple

attenuationCoef

Attenuation coefficient of the entire ROI at the center frequency (dB/cm/MHz).

Type:

float

backScatterCoef

Backscatter coefficient of the entire ROI at the center frequency (1/cm-sr).

Type:

float

effectiveScattererDiameter

Effective scatterer diameter of the entire ROI (µm).

Type:

float

effectiveScattererConcentration

Effective scatterer concentration of the entire ROI (dB/mm^3).

Type:

float

refAttenuation

Total attenuation coefficient of the reference phantom at the center frequency (dB/cm/MHz).

Type:

float

refBackScatterCoef

Backscatter coefficient of the reference phantom at the center frequency (1/cm-sr).

Type:

float

scSplineX

Spline x-coordinates in scan converted coordinates.

Type:

np.ndarray

splineX

Spline x-coordinates in pre-scan converted coordinates.

Type:

np.ndarray

scSplineY

Spline y-coordinates in scan converted coordinates.

Type:

np.ndarray

splineY

Spline y-coordinates in pre-scan converted coordinates.

Type:

np.ndarray

computeAttenuationCoef(rfData: ndarray, refRfData: ndarray, overlap=50, windowDepth=100) float

Compute the local attenuation coefficient of the ROI using the Spectral Difference Method for Local Attenuation Estimation. This method computes the attenuation coefficient for multiple frequencies and returns the slope of the attenuation as a function of frequency. :param rfData: RF data of the ROI (n lines x m samples). :type rfData: np.ndarray :param refRfData: RF data of the phantom (n lines x m samples). :type refRfData: np.ndarray :param overlap: Overlap percentage for analysis windows. :type overlap: float :param windowDepth: Depth of each window in samples. :type windowDepth: int

Returns:

Local attenuation coefficient of the ROI for the central frequency (dB/cm/MHz). Updated and verified : Feb 2025 - IR

Return type:

float

computeBackscatterCoefficient(freqArr: ndarray, scanPs: ndarray, refPs: ndarray, attCoef: float, frequency: int, roiDepth: int) float

Compute the backscatter coefficient of the ROI using the reference phantom method. Assumes instrumentation and beam terms have the same effect on the signal from both image and phantom. source: Yao et al. (1990) : https://doi.org/10.1177/016173469001200105. PMID: 2184569 :param freqArr: Frequency array of power spectra (Hz). :type freqArr: np.ndarray :param scanPs: Power spectrum of the analyzed scan at the current region. :type scanPs: np.ndarray :param refPs: Power spectrum of the reference phantom at the currentn region. :type refPs: np.ndarray :param attCoef: Attenuation coefficient of the current region (dB/cm/MHz). :type attCoef: float :param frequency: Frequency on which to compute backscatter coefficient (should

match frequency of self.refBackScatterCoefficient) (Hz).

Parameters:

roiDepth (int) – Depth of the start of the ROI in samples.

Returns:

Backscatter coefficient of the ROI for the central frequency (1/cm-sr). Updated and verified : Feb 2025 - IR

Return type:

float

computeEsdac(rfData: ndarray, refRfData: ndarray, apertureRadiusCm: float) Tuple[float, float]

Compute the effective scatterer diameter and concentration of the ROI. source: Muleki-Seya et al. https://doi.org/10.1177/0161734617729159

Parameters:
  • rfData (np.ndarray) – RF data of the ROI (n lines x m samples).

  • refRfData (np.ndarray) – RF data of the phantom (n lines x m samples).

  • apertureRadiusCm (float) – Aperture radius in cm.

  • roiDepth (int) – Depth of the start of the ROI in samples.

Returns:

Effective scatterer diameter (µm) and concentration of the ROI (dB/mm^3).

Return type:

Tuple

computeNakagamiParams(rfData: ndarray) Tuple[float, float]

Compute Nakagami parameters for the ROI. source: Tsui, P. H., Wan, Y. L., Huang, C. C. & Wang, M. C. Effect of adaptive threshold filtering on ultrasonic Nakagami parameter to detect variation in scatterer concentration. Ultrason. Imaging 32, 229–242 (2010). https://doi.org/10.1177%2F016173461003200403

Parameters:

rfData (np.ndarray) – RF data of the ROI (n lines x m samples).

Returns:

Nakagami parameters (w, u) for the ROI.

Return type:

Tuple

computeUtcWindows(extraParams=True, bscFreq=None, extraParamapParams=False) int

Compute UTC parameters for each window in the ROI.

extraParams (bool): Flag on whether to compute non-validated parameters. bscFreq (int): Frequency on which to compute backscatter coefficient (MHz).

Returns:

0 if successful, -1 if generateRoiWindows has not been run or if windows are too large for ROI.

Return type:

int

generateRoiWindows()

Generate windows for UTC analysis based on user-defined spline.

initAnalysisConfig()

Compute the wavelength of the ultrasound signal and set default config values if not pre-loaded.

splineToPreSc()

Convert spline coordinates from scan converted to pre-scan converted.