Skip to content

Commit

Permalink
Moved scanline location to the center of aperture, when it has even e…
Browse files Browse the repository at this point in the history
…lements.
  • Loading branch information
pjarosik committed Mar 23, 2021
1 parent 28992d0 commit fb3eceb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.17.0)
project(arrus LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
# Version
set(PROJECT_VERSION 0.5.10)
set(PROJECT_VERSION 0.5.11)

option(ARRUS_DEVELOP_VERSION "Build develop version." ON)
if(ARRUS_DEVELOP_VERSION)
Expand Down Expand Up @@ -87,7 +87,7 @@ set(ARRUS_DOCS_INSTALL_DIR docs)
# Common dependencies
################################################################################
if(ARRUS_BUILD_SWIG)
find_package(Us4 0.5.3 EXACT REQUIRED US4OEM HV256 DBARLite)
find_package(Us4 0.5.5 EXACT REQUIRED US4OEM HV256 DBARLite)
endif()
find_package(Boost REQUIRED)
set(Boost_USE_STATIC_LIBS ON)
Expand Down
5 changes: 5 additions & 0 deletions api/python/arrus/kernels/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ def get_tx_aperture_center_coords(sequence, probe):
pitch = probe.pitch
curvature_radius = probe.curvature_radius
tx_aperture_center_element = sequence.tx_aperture_center_element
tx_aperture_size = sequence.tx_aperture_size
if tx_aperture_size % 2 == 0:
# For aperture with even number of elements, move center between
# elements tx_aperture_center_element and tx_aperture_center_element+1
tx_aperture_center_element = tx_aperture_center_element+0.5

element_position = np.arange(-(n_elements - 1) / 2,
n_elements / 2)*pitch
Expand Down
5 changes: 4 additions & 1 deletion api/python/arrus/utils/imaging.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def _prepare(self, const_metadata: arrus.metadata.ConstMetadata):
c = seq.speed_of_sound
else:
c = medium.speed_of_sound
tx_angle = 0 # TODO use appropriate tx angle
tx_angle = 0
start_sample = seq.rx_sample_range[0]
rx_aperture_origin = _get_rx_aperture_origin(seq)

Expand Down Expand Up @@ -351,6 +351,7 @@ def _prepare(self, const_metadata: arrus.metadata.ConstMetadata):
np.cos(element_angle) - 1)

tx_distance = radial_distance
print(element_x)
rx_distance = np.sqrt(
(x_distance - element_x) ** 2 + (z_distance - element_z) ** 2)

Expand Down Expand Up @@ -582,6 +583,8 @@ def _get_rx_aperture_origin(sequence):
rx_aperture_center_element = np.array(sequence.rx_aperture_center_element)
rx_aperture_origin = np.round(rx_aperture_center_element -
(rx_aperture_size - 1) / 2 + 1e-9)
if rx_aperture_size % 2 == 0:
rx_aperture_origin = rx_aperture_origin-0.5
return rx_aperture_origin


0 comments on commit fb3eceb

Please sign in to comment.