Skip to main content

A comprehensive framework of GPU-accelerated image reconstruction for photoacoustic computed tomography

Project description

A comprehensive framework of GPU-accelerated image reconstruction for photoacoustic computed tomography

The repository provides code of the paper with the same name as this repository.

A comprehensive framework of GPU-accelerated image reconstruction for photoacoustic computed tomography.

Abstract

Significance: Photoacoustic Computed Tomography (PACT) is a promising non-invasive imaging technique for both life science and clinical implementations. To achieve fast imaging speed, modern PACT systems have equipped arrays that have hundreds to thousands of ultrasound transducer (UST) elements, and the element number continues to increase. However, large number of UST elements with parallel data acquisition could generate a massive data size, making it very challenging to realize fast image reconstruction. Although several research groups have developed GPU-accelerated method for PACT, there lacks an explicit and feasible step-by-step description of GPU-based algorithms for various hardware platforms.

Aim: In this study, we propose a comprehensive framework for developing GPU-accelerated PACT image reconstruction (Gpu-Accelerated PhotoAcoustic computed Tomography, GAPAT), helping the research society to grasp this advanced image reconstruction method.

Approach: We leverage widely accessible open-source parallel computing tools, including Python multiprocessing-based parallelism, Taichi Lang for Python, CUDA, and possible other backends. We demonstrate that our framework promotes significant performance of PACT reconstruction, enabling faster analysis and real-time applications. Besides, we also described how to realize parallel computing on various hardware configurations, including multicore CPU, single GPU, and multiple GPUs platform.

Results: Notably, our framework can achieve an effective rate of approximately 871 times when reconstructing extremely large-scale 3D PACT images on a dual-GPU platform compared to a 24-core workstation CPU. Besides this manuscript, we shared example codes in the GitHub.

Conclusions: Our approach allows for easy adoption and adaptation by the research community, fostering implementations of PACT for both life science and medicine.

Keywords: photoacoustic computed tomography, large-scale data size, GPU-accelerated method, Taichi Lang for python, multiple GPU platform.

Documentation

gapat.algorithms

gapat.algorithms.recon(signal_backproj, detector_location, detector_normal, x_range, y_range, z_range, res, vs, fs, delay=0, method="das", device="cpu", num_devices=1, block_dim=512)

Reconstruction of photoacoustic computed tomography.

Warning: When using multi-device reconstruction, the function must be called on the main process.

Parameters

Parameter Type Description
signal_backproj np.ndarray The input signal. Each row is a signal of a detector.
Shape: (num_detectors, num_times). Dtype: np.float32.
detector_location np.ndarray The location of the detectors. Each row is the coordinates of a detector.
Shape: (num_detectors, 3). Dtype: np.float32.
detector_normal np.ndarray The normal of the detectors. Each row is the normal of a detector which points to the volume.
Shape: (num_detectors, 3). Dtype: np.float32.
x_range list The range of the reconstruction volume. The first is the start x and the second is the end x. Example: [0, 1].
Shape: (2,). Dtype: float.
y_range list The range of the reconstruction volume. The first is the start y and the second is the end y. Example: [0, 1].
Shape: (2,). Dtype: float.
z_range list The range of the reconstruction volume. The first is the start z and the second is the end z. Example: [0, 1].
Shape: (2,). Dtype: float.
res float The resolution of the volume.
vs float The speed of sound in the volume.
fs float The sampling frequency.
delay int The delay of the detectors. Default: 0.
method str The method to use. Default: "das". Options: "das", "ubp".
device str The device to use. Default: "gpu". Options: "cpu", "gpu".
num_devices int The number of devices to use. Default: 1.
block_dim int The block dimension. Default: 512.

Returns

Parameter Type Description
signal_recon np.ndarray The reconstructed signal.
Shape: (num_x, num_y, num_z). Dtype: np.float32.

gapat.processings

gapat.processings.bandpass_filter(signal_matrix, fs, band_range, order=2, axis=0)

Bandpass filter the signal matrix.

Parameters

Parameter Type Description
signal_matrix np.ndarray The signal matrix to be filtered.
Shape: (num_detectors, num_times). Dtype: np.float32.
fs float The sampling frequency (Hz).
band_range list The band range to filter (Hz). The first is the low frequency and the second is the high frequency. Example: [10e6, 100e6].
Shape: (2,). Dtype: float.
order int The order of the filter. Default: 2.
axis int The axis to filter. Default: 0. (Which will be applied to each detector.)

Returns

Parameter Type Description
filtered_signal_matrix np.ndarray The filtered signal matrix.
Shape: (num_detectors, num_times). Dtype: np.float32.

gapat.processings.negetive_processing(signal_recon, method="zero", axis=0)

Process the negative signal.

Parameters

Parameter Type Description
signal_recon np.ndarray The reconstructed signal to be processed.
Shape: (num_x, num_y, num_z). Dtype: np.float32.
method str The method to process the negative signal. Default: "zero". Options: "zero", "abs", "hilbert".
"zero": Set the negative signal to zero.
"abs": Take the absolute value of the negative signal.
"hilbert": Use the hilbert transform to get the envelope of the signal.
axis int The axis to process when method is "hilbert". Default: 0.

Returns

Parameter Type Description
processed_signal_recon np.ndarray The processed signal reconstruction.
Shape: (num_x, num_y, num_z). Dtype: np.float32.

gapat.utils

gapat.utils.load_mat(filename)

Load .mat file and return a dictionary with variable names as keys, and loaded matrices as values.

Parameters

Parameter Type Description
filename str The path to the .mat file.

Returns

Parameter Type Description
data dict A dictionary with variable names as keys, and loaded matrices as values.

gapat.utils.save_mat(filename, varname, data)

Save data to .mat file with the given variable name.

Parameters

Parameter Type Description
filename str The path to the .mat file.
varname str The variable name to save the data to.
data np.ndarray The data to save.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gapat-0.0.3.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

gapat-0.0.3-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file gapat-0.0.3.tar.gz.

File metadata

  • Download URL: gapat-0.0.3.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for gapat-0.0.3.tar.gz
Algorithm Hash digest
SHA256 0f04abab655e28e4d10a708f69c92014c4d7479bed28fa16b13521f1f4ee9b4a
MD5 f61beea6f52712afaef781aec9bdef93
BLAKE2b-256 29715e2b4af900e6630bc93a642f99a9744b28a40673338a13b9d3dc4c7a5091

See more details on using hashes here.

File details

Details for the file gapat-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: gapat-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for gapat-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9199294cdf722276299fda5b7034b298f70ffb2cf27d210dd71bd5326682ded9
MD5 1bc3f4b54e0caa7290fbb24ee2d36a43
BLAKE2b-256 98607b4a3cad96b07dd84bcb457c5201710b7c1a286c3a3e975777a3f3e56fdc

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page