mach.io.uff#
Data loader for UFF (ultrasound file format) files.
Usage: pass in a scan-object from: magnusdk/pyuff_ustb
Functions
|
Compute transmit arrival times for plane wave imaging. |
|
Create complete beamforming setup from channel data and scan parameters for all transmits. |
Create beamforming setup for a single transmit (backwards compatibility). |
|
|
Extract delay times from ultrasound sequence. |
|
Extract wave propagation directions from ultrasound sequence. |
|
Preprocess ultrasound signal data for multi-transmit beamforming. |
- mach.io.uff.compute_tx_wave_arrivals_s(
- directions: list,
- scan_coords_m: Array,
- speed_of_sound: float,
- origin: Array | None = None,
- xp=None,
Compute transmit arrival times for plane wave imaging.
- Parameters:
directions – List of wave direction vectors
scan_coords_m – Output positions for beamforming (N, 3) in meters
speed_of_sound – Speed of sound in the medium
origin – Wave origin point, defaults to [0, 0, 0] Can also be parsed from ultrasound_angles_to_cartesian(channel_data.sequence[idx].origin)
xp – Array namespace (optional, will be inferred from scan_coords_m)
- Returns:
Array of transmit arrival times with shape (n_transmits, n_points)
- mach.io.uff.create_beamforming_setup(
- channel_data,
- scan,
- f_number: float = 1.7,
- xp=None,
Create complete beamforming setup from channel data and scan parameters for all transmits.
- Parameters:
channel_data – Channel data object containing signal
scan – Scan object containing spatial parameters
f_number – F-number for beamforming
xp – Array namespace (if None, will use numpy)
- Returns:
Dictionary containing all beamforming parameters for multi-transmit beamforming
- mach.io.uff.create_single_transmit_beamforming_setup( ) dict[str, Any] #
Create beamforming setup for a single transmit (backwards compatibility).
- Parameters:
channel_data – Channel data object containing signal
scan – Scan object containing spatial parameters
wave_index – Index of wave to use for beamforming
f_number – F-number for beamforming
xp – Array namespace (if None, will use numpy)
- Returns:
Dictionary containing beamforming parameters for single transmit
- mach.io.uff.extract_sequence_delays( ) Array #
Extract delay times from ultrasound sequence.
- Parameters:
sequence – List of wave objects
xp – Array namespace (if None, will use numpy)
- Returns:
Array of delay times with shape (n_transmits,)
- mach.io.uff.extract_wave_directions(sequence: list[Any], xp) list #
Extract wave propagation directions from ultrasound sequence.
- Parameters:
sequence – List of wave objects containing source information
xp – Array namespace (numpy, cupy, etc.)
- Returns:
List of direction vectors as arrays
- mach.io.uff.preprocess_signal(
- signal_data: Array,
- modulation_frequency: float,
- xp=None,
Preprocess ultrasound signal data for multi-transmit beamforming.
- Parameters:
signal_data – Raw signal data with shape (n_samples, n_elements, n_waves) or (n_samples, n_elements, n_waves, n_frames)
modulation_frequency – Modulation frequency in Hz
xp – Array namespace (optional, will be inferred from signal_data)
- Returns:
Preprocessed signal array with shape (n_transmits, n_receive_elements, n_samples, n_frames)