pyquantus.utc.transforms module

pyquantus.utc.transforms.computeHanningPowerSpec(rfData: ndarray, startFrequency: int, endFrequency: int, samplingFrequency: int) Tuple[ndarray, ndarray]

Compute the power spectrum of the RF data using a Hanning window.

Parameters:
  • rfData (np.ndarray) – RF data from the ultrasound image (n lines x m samples).

  • startFrequency (int) – lower bound of the frequency range (Hz).

  • endFrequency (int) – upper bound of the frequency range (Hz).

  • samplingFrequency (int) – sampling frequency of the RF data (Hz).

Returns:

frequency range and power spectrum.

Return type:

Tuple

pyquantus.utc.transforms.computeSpectralParams(nps: ndarray, f: ndarray, lowF: int, highF: int) Tuple[float, ndarray, ndarray, ndarray]

Perform spectral analysis on the normalized power spectrum. source: Lizzi et al. https://doi.org/10.1016/j.ultrasmedbio.2006.09.002

Parameters:
  • nps (np.ndarray) – normalized power spectrum.

  • f (np.ndarray) – frequency array (Hz).

  • lowF (int) – lower bound of the frequency window for analysis (Hz).

  • highF (int) – upper bound of the frequency window for analysis (Hz).

Returns:

midband fit, frequency range, linear fit, and linear regression coefficients.

Return type:

Tuple

pyquantus.utc.transforms.condenseArr(image: ndarray) ndarray

Condense (M,N,3) arr to (M,N) with uint32 data to preserve info

pyquantus.utc.transforms.expandArr(image: ndarray) ndarray

Inverse of condenseArr

pyquantus.utc.transforms.int32torgb(color)

Convert int32 to rgb tuple