ultraspy core methods

The main methods in ultraspy are defined both in GPU and in CPU, and are stored within the dedicated repositories gpu/ and cpu/. The GPU version are highlighted, so those can be called directly from the ultraspy module. Their CPU alternatives, however, need to be called using the ultraspy.cpu module. For example:

import ultraspy as us

# Call the GPU method, input / output are on the GPU device
d_out = us.some_method(d_input, ...)

# Call the CPU alternative
out = us.cpu.some_method(input, ...)

Displaying methods

The detailed description can be found in the API reference.

  • to_b_mode: Computes the B-Mode of our beamformed data. Simply returns 20 * log10(data).

  • get_spectrum: Returns the spectrum of a data signal.

  • get_doppler_colormap: Returns a color map proposition for Doppler, based on typical echographs, from blue (flow going away from the probe), to red (going toward to).

Post-processing methods

The detailed description can be found in the API reference.

  • distort_dynamic: Post-processing method to distort the dynamic of a B-Mode image (already in dB). This is applying a mathematical function, either curved or sigmoid to distort the values of the image.

Metrics methods

The detailed description can be found in the API reference.

  • metrics.signal_noise_ratio: Returns the Signal to Noise ratio of the sample, based on the location of both the pulse and the noise.

  • metrics.get_full_width_at_half_maximum: Returns the Full-Width at Half Maximum of a signal, given a focus index. It is basically the width of the focused lobe at -6dB.

  • metrics.get_peak_side_lobe: Returns the Peak Side Lobe of a signal, given a focus index. It is basically the difference in dB between the focused lobe and its closest neighbor.

  • metrics.get_contrat_noise_ratio: Returns the Contrast to Noise ratio of the data, using two masks, one for the position of the signal, the other one for the noise.