Beamformers
Beamformer class
- class ultraspy.beamformers.beamformer.Beamformer(is_iq=False, on_gpu=True)
Beamformer class to handle the beamforming parameters.
- Variables:
name (str) – The name of the Beamforming method
is_iq (bool) – If set to True, will perform the beamforming expecting I/Qs
on_gpu (bool) – If set to True, will perform the beamforming on GPU
is_same_probe (bool) – If set to True, the emission sequences and the reception sequences are the same (mostly standard plane waves), else case, both sequences are different (mostly STA)
setups (dict) – The characteristics of the beamformer, see the getter to have the list of the parameters
options (dict) – The options of the beamformer, see the getter to have the list of the parameters
delays (numpy.ndarray) – The delays applied to each element, for each transmission, of shape (nb_transmission, nb_emitted_elements)
emitted_probe (numpy.ndarray) – The 3D position of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements)
received_probe (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements)
emitted_thetas (numpy.ndarray) – The thetas of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements). Only used for convex probes
received_thetas (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements). Only used for convex probes
Initialization for the Beamformer. Just initializes both the setups and options dictionaries with the default values.
- Parameters:
is_iq (bool) – If True, the beamforming is expecting I/Qs, the input data should be RFs else case
on_gpu (bool) – If True, all the setups are defined on GPU
- automatic_setup(acquisition_info, probe)
Loads the setups using a data file. It is the ‘old’ way for faked streamer, this might change in the future, or even be removed as it is very high level (expects data of given format, no control of what’s been read, etc.). However, it is supposedly more flexible to new data… Need to find a trade-off here. The new setups are updated in the setup parameter of the class.
- Parameters:
acquisition_info (dict) – The setup of the acquisition system, see the Reader class to learn about the expected format
probe (Probe) – The probe class, see the Reader class to check how it’s been built
- beamform(data, scan, *args, **kwargs)
The factory for beamforming method, based on GPU mode.
- beamform_cpu(*args, **kwargs)
The beamform method (on CPU) should be implemented in child classes.
- beamform_gpu(*args, **kwargs)
The beamform method (on GPU) should be implemented in child classes.
- beamform_packet(data, scan, *args, **kwargs)
The factory for beamform_packet method, based on GPU mode.
- beamform_packet_cpu(*args, **kwargs)
The beamform_packet method (on CPU) should be implemented in child classes.
- beamform_packet_gpu(*args, **kwargs)
The beamform_packet method (on GPU) should be implemented in child classes.
- compute_envelope(data, scan, method='demodulation', axis=-1, bf_f0_ratio=1.0)
Computes the envelope of our beamformed signal, on GPU or CPU based on the beamformer status. It is flexible to RFs or I/Qs, and can be performed using two methods (demodulation or hilbert) for RFs. The envelope is computed along the last axis.
- Parameters:
data (numpy.ndarray, cupy.array) – The beamformed array (either numpy array on CPU or a GPUArray on GPU)
scan (Scan) – The scan used for the beamforming, mandatory to know the axial step
method (str) – The method to use for the envelope computation (only on RFs, as envelope for I/Qs is only the modulo of the data). These could be demodulation (default) or hilbert.
axis (int) – The axis on which to perform the envelope
bf_f0_ratio (float) – Sometimes the beamformed signals are shifted to bf_f0_ratio x f0 (by 2 in FDMAS for example)
- Returns:
The envelope of the beamformed data (floats)
- Return type:
numpy.ndarray, cupy.array
- property delays
Get the delays based on the transmissions to pick.
- Returns:
The delays of the sequence
- Return type:
numpy.ndarray
- property emitted_probe
Get the probe used for the emission based on the transmissions to pick.
- Returns:
The emitted probe elements
- Return type:
numpy.ndarray
- property emitted_thetas
Get the thetas used for the emission based on the transmissions to pick.
- Returns:
The emitted thetas elements
- Return type:
numpy.ndarray
- get_focused_data(pixel)
Computes the indices of the delays at a given position for a linear probe.
- Parameters:
pixel (tuple) – The position of the pixel to observe, it can be either in 2D or 3D
- Returns:
The indices of the delays for each transmission and each element of the probe
- Return type:
numpy.ndarray
- init_from_beamformer(beamformer)
Updates the setups and options using a previously initialized beamformer.
- Parameters:
beamformer (Beamformer) – Init the setups / options from another already initialized beamformer
- property received_probe
Get the probe used for the reception based on the transmissions to pick.
- Returns:
The reception probe elements
- Return type:
numpy.ndarray
- property received_thetas
Get the thetas used for the reception based on the transmissions to pick.
- Returns:
The reception thetas elements
- Return type:
numpy.ndarray
- set_is_iq(is_iq)
Updates the is_iq attribute if requested, useful to process beamforming / envelope the proper way.
- Parameters:
is_iq (bool) – True if is I/Q
- set_on_gpu(on_gpu)
Updates the on_gpu attribute if requested, will change the format of the setups / options data.
- Parameters:
on_gpu (bool) – True if is on GPU
- property t0
Get the initial time t0, based on the option ‘fix_to’. If set to True, returns t0 - (sig_duration / 2).
- Returns:
The fixed t0 or t0
- Return type:
float
- update_option(name, value)
Set the ‘name’ parameter in self.options to the value ‘value’ given its type defined in bf_options.INFO. This is also sending it to GPU if we are on GPU mode.
- Parameters:
name (str) – The name of the parameter
value (float, str) – The value to attribute
- update_setup(name, value)
Set the ‘name’ parameter in self.setups to the value ‘value’ given its type defined in setups.py. This is also sending it to GPU if we are on GPU mode.
- Parameters:
name (str) – The name of the parameter
value (int, float, list, numpy.ndarray) – The value to attribute
Delay And Sum
- class ultraspy.beamformers.das.DelayAndSum(is_iq=False, on_gpu=True)
The DelayAndSum class, inherit from the Beamformer class (which deals with the beamforming setups) and performs the beamforming itself. The class is working on either Cupy (CUDA, GPU) or Numpy / Numba (CPU) depending on the selected mode (check the doc and the ULTRASPY_CPU_LIB environment variable for more information).
- Variables:
name (str) – The name of the Beamforming method
is_iq (bool) – If set to True, will perform the beamforming expecting I/Qs
on_gpu (bool) – If set to True, will perform the beamforming on GPU
is_same_probe (bool) – If set to True, the emission sequences and the reception sequences are the same (mostly standard plane waves), else case, both sequences are different (mostly STA)
transmissions_indices (list) – The list of the transmissions indices to select
setup (dict) – The characteristics of the beamformer, see the getter to have the list of the parameters
options (dict) – The options of the beamformer, see the getter to have the list of the parameters
delays (numpy.ndarray) – The delays applied to each element, for each transmission, of shape (nb_transmission, nb_emitted_elements)
emitted_probe (numpy.ndarray) – The 3D position of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements)
received_probe (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements)
emitted_thetas (numpy.ndarray) – The thetas of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements). Only used for convex probes
received_thetas (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements). Only used for convex probes
Initialization for the DAS beamformer.
- Parameters:
is_iq (bool) – If set to True, the beamformer expects to process I/Q data
on_gpu (bool) – If True, all the setups are defined on GPU
- beamform_cpu(data, scan)
Runs the DAS beamformer using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster).
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If reduce option is set to False, it will also preserve the delays per elements (nb_received_elements, *scan.shape). If compound is set to False, it will also preserve the transmissions and look like (nb_transmissions, nb_received_elements, *scan.shape)
- Return type:
numpy.ndarray
- beamform_gpu(d_data, scan)
Runs the DAS beamformer using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If reduce option is set to False, it will also preserve the delays per elements (nb_received_elements, *scan.shape). If compound is set to False, it will also preserve the transmissions and look like (nb_transmissions, nb_received_elements, *scan.shape)
- Return type:
cupy.array
- beamform_packet_cpu(data, scan)
Runs the DAS beamformer on a packet of data using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster).
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If reduce or compound are set to False, their respective dimensions will be preserved in the first dimensions as for the ::code::beamform method above
- Return type:
numpy.ndarray
- beamform_packet_gpu(d_data, scan)
Runs the DAS beamformer on a packet of data using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If reduce or compound are set to False, their respective dimensions will be preserved in the first dimensions as for the ::code::beamform method above
- Return type:
cupy.array
Filtered Delay Multiply And Sum
- class ultraspy.beamformers.fdmas.FilteredDelayMultiplyAndSum(is_iq=False, on_gpu=True, oversample=2)
The FilteredDelayMultiplyAndSum class, inherit from the Beamformer class (which deals with the beamforming setups) and performs the beamforming itself. The class is working on Cupy (CUDA, GPU) or Numpy / Numba (CPU) depending on the selected mode (check the doc and the ULTRASPY_CPU_LIB environment variable for more information).
- Variables:
name (str) – The name of the Beamforming method
is_iq (bool) – If set to True, will perform the beamforming expecting I/Qs
on_gpu (bool) – If set to True, will perform the beamforming on GPU
is_same_probe (bool) – If set to True, the emission sequences and the reception sequences are the same (mostly standard plane waves), else case, both sequences are different (mostly STA)
transmissions_indices (list) – The list of the transmissions indices to select
setup (dict) – The characteristics of the beamformer, see the getter to have the list of the parameters
options (dict) – The options of the beamformer, see the getter to have the list of the parameters
delays (numpy.ndarray) – The delays applied to each element, for each transmission, of shape (nb_transmission, nb_emitted_elements)
emitted_probe (numpy.ndarray) – The 3D position of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements)
received_probe (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements)
emitted_thetas (numpy.ndarray) – The thetas of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements). Only used for convex probes
received_thetas (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements). Only used for convex probes
oversample (int) – The oversampling factor to apply to the axial axis
Initializes the Beamformer parent first, then set the options for FDMAS.
- Parameters:
is_iq (bool) – If set to True, the beamformer expects to process I/Q data
on_gpu (bool) – If True, all the setups are defined on GPU
oversample (int) – Since, in F-DMAS, we multiply two signals roughly similar, we get resulting spectrum moved to both DC and 2xf0. To fix this, we can simply filter the beamformed signal in a band around 2xf0, but we need to make sure the axial resolution is good enough. A good practice is to oversample the axial axis to overcome this. If you’ve done it already, set oversample to 1.
- beamform_cpu(data, scan)
Runs the FDMAS beamformer using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster). Note that if oversample is set to fix aliasing caused by FDMAS (on RFs only), the beamformed array won’t have the requested shape and the scan object will be changed. The down-sampling will be performed after computing the envelope, which will restore the scan to its original dimensions.
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
numpy.ndarray
- beamform_gpu(d_data, scan)
Runs the Filtered Delay Multiply And Sum beamformer using cupy (CUDA kernel on GPU). Note that if oversample is set to fix aliasing caused by FDMAS (on RFs only), the beamformed array won’t have the requested shape and the scan object will be changed. The down-sampling will be performed after computing the envelope, which will restore the scan to its original dimensions.
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
cupy.array
- beamform_packet_cpu(data, scan)
Runs the FDMAS beamformer on a packet of data using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster). Note that if oversample is set to fix aliasing caused by FDMAS (on RFs only), the beamformed array won’t have the requested shape and the scan object will be changed. The down-sampling will be performed after computing the envelope, which will restore the scan to its original dimensions.
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If compound is set to False, the transmissions will be preserved in the first dimension as for the ::code::beamform method above
- Return type:
numpy.ndarray
- beamform_packet_gpu(d_data, scan)
Runs the FDMAS beamformer on a packet of data using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If reduce or compound are set to False, their respective dimensions will be preserved in the first dimensions as for the ::code::beamform method above
- Return type:
cupy.array
- compute_envelope(data, scan, method='demodulation', axis=-1, down_sample=True)
The envelope process is the same as usual, so we call the parent method. However, if we up-sampled the axial axis due to aliasing caused by FDMAS, we need to restore it here in order to return an envelope of the requested shape.
- Parameters:
data (numpy.ndarray, cupy.array) – The beamformed array (either numpy array on CPU or a GPUArray on GPU)
scan (Scan) – The scan used for the beamforming, mandatory to know the axial step
method (str) – The method to use for the envelope computation (only on RFs, as envelope for I/Qs is only the modulo of the data). These could be demodulation (default) or hilbert
axis (int) – The axis on which to compute the envelope
down_sample (bool) – If set to True, we restore the shape of the beamformed data to the original requested shape
- Returns:
The envelope of the beamformed data (floats)
- Return type:
numpy.ndarray, cupy.array
- property oversample
Get the oversampling value.
- set_oversample(oversample)
Updates the oversampling value.
- Parameters:
oversample (int) – The new factor for oversampling
p-DAS
- class ultraspy.beamformers.pdas.PDelayAndSum(is_iq=False, on_gpu=True, p=2, use_shen_version=False)
The PDelayAndSum class, inherit from the Beamformer class (which deals with the beamforming setups) and performs the beamforming itself. The class is working on either Cupy (CUDA, GPU) or Numpy / Numba (CPU) depending on the selected mode (check the doc and the ULTRASPY_CPU_LIB environment variable for more information).
- Variables:
name (str) – The name of the Beamforming method
is_iq (bool) – If set to True, will perform the beamforming expecting I/Qs
on_gpu (bool) – If set to True, will perform the beamforming on GPU
is_same_probe (bool) – If set to True, the emission sequences and the reception sequences are the same (mostly standard plane waves), else case, both sequences are different (mostly STA)
transmissions_indices (list) – The list of the transmissions indices to select
setup (dict) – The characteristics of the beamformer, see the getter to have the list of the parameters
options (dict) – The options of the beamformer, see the getter to have the list of the parameters
delays (numpy.ndarray) – The delays applied to each element, for each transmission, of shape (nb_transmission, nb_emitted_elements)
emitted_probe (numpy.ndarray) – The 3D position of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements)
received_probe (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements)
emitted_thetas (numpy.ndarray) – The thetas of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements). Only used for convex probes
received_thetas (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements). Only used for convex probes
- Parameters:
p (float) – The p factor for non-linear operations in p-DAS
use_shen_version (bool) – If set to True, the I/Qs version of the beamformer will be the one from Shen et al. (BB p-DMAS), which causes a phase_shift, leading to aliasing in Doppler. Else case, will perform BB p-DAS to preserve the spectrum at f0 (Ecarlat et al., 2022)
Initializes the Beamformer parent first, then set the options for p-DAS.
- Parameters:
is_iq (bool) – If set to True, the beamformer expects to process I/Qs data
on_gpu (bool) – If True, all the setups are defined on GPU
p (float) – The p factor for non-linear operations in p-DAS
use_shen_version (bool) – If set to True, the I/Qs version of the beamformer will be the one from Shen et al. (BB p-DMAS), which causes a phase_shift, leading to aliasing in Doppler. Else case, will perform BB p-DAS to preserve the spectrum at f0 (Ecarlat et al., 2022)
- beamform_cpu(data, scan)
Runs the p-DAS beamformer using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster).
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
numpy.ndarray
- beamform_gpu(d_data, scan)
Runs the p-DAS beamformer using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
cupy.array
- beamform_packet_cpu(data, scan)
Runs the p-DAS beamformer on a packet of data using either Numpy (matricial operations) or the no-python iterative mode of Numba (faster).
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If compound is set to False, the transmissions will be preserved in the first dimension as for the ::code::beamform method above
- Return type:
numpy.ndarray
- beamform_packet_gpu(d_data, scan)
Runs the p-DAS beamformer on a packet of data using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If reduce or compound are set to False, their respective dimensions will be preserved in the first dimensions as for the ::code::beamform method above
- Return type:
cupy.array
- property p
Get the p value.
- set_p(p)
Updates the p value.
- Parameters:
p (float) – The new p factor
- set_use_shen_version(use_shen_version)
Updates the baseband mode.
- Parameters:
use_shen_version (bool) – If set to True, use the version of Shen et al. (BB p-DMAS)
- property use_shen_version
Get the Shen mode.
Capon
- class ultraspy.beamformers.capon.Capon(is_iq=False, on_gpu=True, diagonal_loading_mode=False, l_prop=0.2, delta_l=100)
The Capon class, inherit from the Beamformer class (which deals with the beamforming setups) and performs the beamforming itself. The class is working on either Cupy (CUDA, GPU) or Numba (CPU) depending on the selected mode (check the doc and the ULTRASPY_CPU_LIB environment variable for more information).
- Variables:
name (str) – The name of the Beamforming method
is_iq (bool) – If set to True, will perform the beamforming expecting I/Qs
on_gpu (bool) – If set to True, will perform the beamforming on GPU
is_same_probe (bool) – If set to True, the emission sequences and the reception sequences are the same (mostly standard plane waves), else case, both sequences are different (mostly STA)
transmissions_indices (list) – The list of the transmissions indices to select
setup (dict) – The characteristics of the beamformer, see the getter to have the list of the parameters
options (dict) – The options of the beamformer, see the getter to have the list of the parameters
delays (numpy.ndarray) – The delays applied to each element, for each transmission, of shape (nb_transmission, nb_emitted_elements)
emitted_probe (numpy.ndarray) – The 3D position of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements)
received_probe (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements)
emitted_thetas (numpy.ndarray) – The thetas of each of the element of the emitted probe, per transmission, of shape (nb_transmission, nb_emitted_elements). Only used for convex probes
received_thetas (numpy.ndarray) – The 3D position of each of the element of the received probe, per transmission, of shape (nb_transmission, nb_received_elements). Only used for convex probes
- Parameters:
diagonal_loading_mode (bool) – If set to True, will perform the diagonal loading mode instead of standard (default) forward / backward
l_prop (float) – The proportion of the delays to use to constitute one window, should be ]0, 0.5]
delta_l (float) – The delta factor to enhance the diagonal loading, should be [1, 1000]
Initializes the Beamformer parent first, then set the options for Capon.
- Parameters:
is_iq (bool) – If set to True, the beamformer expects to process I/Qs data
on_gpu (bool) – If True, all the setups are defined on GPU
diagonal_loading_mode (bool) – If set to True, will perform the diagonal loading mode instead of standard (default) forward / backward
l_prop (float) – The proportion of the delays to use to constitute one window, should be ]0, 0.5]
delta_l (float) – The delta factor to enhance the diagonal loading, should be [1, 1000]
- beamform_cpu(data, scan)
Runs the Capon beamformer using the no-python iterative mode of Numba.
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
numpy.ndarray
- beamform_gpu(d_data, scan)
Runs the Capon beamformer using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but its last dimensions will be the one requested in scan.shape. If compound option is set to False, it will preserve the transmissions and look like (nb_transmissions, *scan.shape)
- Return type:
cupy.array
- beamform_packet_cpu(data, scan)
Runs the Capon beamformer on a packet of data using the no-python iterative mode of Numba.
- Parameters:
data (numpy.ndarray) – the data to beamform, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – the scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If compound is set to False, the transmissions will be preserved in the first dimension as for the ::code::beamform method above
- Return type:
numpy.ndarray
- beamform_packet_gpu(d_data, scan)
Runs the Capon beamformer on a packet of data using cupy (CUDA kernel on GPU).
- Parameters:
d_data (cupy.array) – The cupy.array data to beamform, stored on GPU, either in float or complex, based on the beamforming mode. The shape should be (nb_frames, nb_transmissions, nb_emitted_elements, nb_time_samples)
scan (Scan) – The scan to beamform, with the pixels we are willing to process
- Returns:
The beamformed data. Its shape depends on the beamforming options, but if compound and reduce are set to True, its shape would be (*scan.shape, nb_frames). If reduce or compound are set to False, their respective dimensions will be preserved in the first dimensions as for the ::code::beamform method above
- Return type:
cupy.array
- property delta_l
Get the delta to use to enhance the diagonal loading.
- property diagonal_loading_mode
Get the Capon mode.
- property l_prop
Get the proportion of the elements to use as a window.
- set_delta_l(delta_l)
Updates the delta_l value.
- Parameters:
delta_l (float) – The new delta_l
- set_diagonal_loading_mode(diagonal_loading_mode)
Updates the diagonal_loading_mode value.
- Parameters:
diagonal_loading_mode (bool) – The new Capon mode
- set_l_prop(l_prop)
Updates the l_prop value.
- Parameters:
l_prop (float) – The new l_prop