kwave.ktransducer module#

class NotATransducer[source]#

Bases: kSensor

__init__(transducer, kgrid, active_elements=None, focus_distance=inf, elevation_focus_distance=inf, receive_apodization='Rectangular', transmit_apodization='Rectangular', sound_speed=1540, input_signal=None, steering_angle_max=None, steering_angle=None)[source]#

‘time_reversal_boundary_data’ and ‘record’ fields should not be defined for the objects of this class

Parameters:
  • kgrid (kWaveGrid) – kWaveGrid object

  • active_elements – the transducer elements that are currently active elements

  • elevation_focus_distance – the focus depth in the elevation direction [m]

  • receive_apodization – transmit apodization

  • transmit_apodization – receive apodization

  • sound_speed – sound speed used to calculate beamforming delays [m/s]

  • focus_distance – focus distance used to calculate beamforming delays [m]

  • input_signal

  • steering_angle_max – max steering angle [deg]

  • steering_angle – steering angle [deg]

  • transducer (kWaveTransducerSimple) –

property active_elements_mask#

Returns: A binary mask showing the locations of the active elements

property all_elements_mask#

Returns: A binary mask showing the locations of all the elements (both active and inactive)

property appended_zeros#

Number of zeros appended to input signal to allow a single time series to be used within kspaceFirstOrder3D (either set to ‘auto’ or based on the setting for steering_angle_max)

property beamforming_delays#

calculate the beamforming delays based on the focus and steering settings

property beamforming_delays_offset#

Offset used to make all the delays in the delay_mask positive (either set to ‘auto’ or based on the setting for steering_angle_max)

Returns:

the stored value of the offset used to force the values in delay_mask to be >= 0

combine_sensor_data(sensor_data)[source]#
delay_mask(mode=None)[source]#

mode == 1: both delays mode == 2: elevation only mode == 3: azimuth only

property elevation_beamforming_delays#

Calculate the elevation beamforming delays based on the focus setting

property elevation_beamforming_mask#
expand_grid(expand_size)[source]#

Enlarge the sensor mask (for Cartesian sensor masks and cuboid corners, this has already been converted to a binary mask for display in inputChecking)

Parameters:

expand_size – the number of elements to add in each dimension

Returns:

None

get_receive_apodization()[source]#

Get the current receive apodization setting.

get_transmit_apodization()[source]#
Returns:

return the transmit apodization, converting strings of window type to actual numbers using getWin

property grid_size#

Returns: grid size

property indexed_active_elements_mask#
property indexed_elements_mask#
property input_signal#
static isfield(_)[source]#
property mask#

Allow mask query to allow compatability with regular sensor structure - return the active sensor mask

property number_active_elements#
retract_grid(retract_size)[source]#
scan_line(sensor_data)[source]#

Apply beamforming and apodization to the sensor data.

property steering_angle#
property steering_angle_max#
property transmit_apodization_mask#

convert the transmit wave apodization into the form of a element mask, where the apodization values are placed at the grid points belonging to the active transducer elements. These values are then extracted in the correct order within kspaceFirstOrder_inputChecking using apodization = transmit_apodization_mask(active_elements_mask ~= 0)

class kWaveTransducerSimple[source]#

Bases: object

__init__(kgrid, number_elements=128, element_width=1, element_length=20, element_spacing=0, position=None, radius=inf)[source]#
Parameters:
  • kgrid (kWaveGrid) – kWaveGrid object

  • number_elements – the total number of transducer elements

  • element_width – the width of each element in grid points

  • element_length – the length of each element in grid points

  • element_spacing – the spacing (kerf width) between the transducer elements in grid points

  • position – the position of the corner of the transducer in the grid

  • radius – the radius of curvature of the transducer [m]

property element_pitch#
property transducer_width#

Total width of the transducer in grid points

Returns:

the overall length of the transducer

make_pos_int(val)[source]#