Skip to main content

Parallel beamforming wrapper for native code

Project description

fast-DAS

Parallel delay-and-sum implementation wrapping native CUDA from python

About

To take advantage of native code multi-threading libraries, use CalculateIn.CUDA or CalculateIn.CPP

  • Supports windows and unix
  • Cross-compiled on windows using WSL and CMake

Otherwise, you can use the slow python version with CalculateIn.PYTHON

Usage

fast-DAS is a python wrapper and native code implementation for the delay-and-sum algorithm pre-compiled in C++ (CPU version) and CUDA (GPU version).
The goal is to boost the digital beamforming process for ultrasound acquisitions.

Installation

pip install fast-das

Note on Windows/CPU usage

In Windows, you may encounter the following error when trying to use the C++ code:

FileNotFoundError: Could not find module '..\lib\site-packages\fastDAS\bin\libdas.dll' (or one of its dependencies). Try using the full path with constructor syntax.

This is because multi-threading is performed with the pthreads library, which is not natively included in Windows. pthreads is included in MinGW, so adding gcc to your conda environment will resolve this issue (for example from here).

Input format

To beamform with fast-DAS, initialize a DAS object based on your compute preference (CPU/GPU):

    import fastDAS as fd
    das = fd.DAS(target=fd.CalculateIn.CUDA)
    us_im = das.beamform(RF, del_Tx, del_Rx)

For out-of-the-box usage with Verasonics Vantage systems, save the MATLAB workspace after collecting an RF acquisition.
The workspace file should contain at least the following variables as a .mat file:

    {
        'NA': {'NA_tot':_, 'NA':_},
        'PData': {
            'Size': _,
            'PDelta': _,
            'Origin': _,
        },
        'Trans': {
            'lensCorrection': _,
            'ElementPos': _,
            'WavelenToMm': _,
        },
        'TX': {
            'Steer': _,
            'Delay': _,
        },
        'TW': {
            'Peak': _
        },
        'Receive': {
            'SamplesPerWave': _,
            'StartDepth': _,
            'StartSample': _,
            'EndSample': _
        }
    }

In a plane wave compounding acqusition, the vsx.py is a basic example for how to calculate the Tx and Rx delay map based on a workspace like the one above.
Otherwise, you can implement the del_Tx and del_Rx variables yourself.
Note that the units of these delay maps are not [usec] but rather [samples].

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

fast-das-1.2.0.tar.gz (738.3 kB view details)

Uploaded Source

Built Distribution

fast_das-1.2.0-py3-none-any.whl (740.9 kB view details)

Uploaded Python 3

File details

Details for the file fast-das-1.2.0.tar.gz.

File metadata

  • Download URL: fast-das-1.2.0.tar.gz
  • Upload date:
  • Size: 738.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.12

File hashes

Hashes for fast-das-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f659266752a368037044a4e7337a679c5a47e4b2433aa139f7a050572c409815
MD5 d4d7d218470afed5fe74acef20b5718e
BLAKE2b-256 f3dc3481e16e57cc50e2e7511c7d5e3d23835cd771b4e8f9580e4f33db6cffd6

See more details on using hashes here.

File details

Details for the file fast_das-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: fast_das-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 740.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.12

File hashes

Hashes for fast_das-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f935f8b09fe36bbdb3487c5da86e0f6dd3cfb0f214ac9d41941ba9192ba371de
MD5 82f1528df57bd370fdd32fc26d8a9e0a
BLAKE2b-256 6ff3b56c7aee1b10bcf32c4488967845c63277036f3d4b779583940bd8021753

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