Skip to content

Examples

Worked examples that progressively introduce eSDIva's features — from basic transducer geometry to pulse-echo imaging, brain-atlas integration and STL mesh simulation.

Run any example directly:

uv run examples/exampleN_name.py

Output figures are controlled by examples/config.py. Set FIG_FOLDER to choose where images are saved and toggle SAVE_FIG (or set ESDIVA_SAVE_FIG=1) to switch between saving and interactive display.


Transducers & Emission

  • 1. Transducer Gallery


    Every transducer type in one script: linear, convex, matrix arrays and all four circular mono-element geometries, plus a custom TUS helmet.

  • 2. Mono-element Fields


    Monochromatic CW pressure fields for all four circular types: flat piston, concave bowl, cylindrical line-focus, and convex dome.

  • 3. Multi-element 3-D


    Focused field for a linear and matrix array rendered in 3-D with PyVista. Transducer geometry and pressure volume in one scene.

  • 4. Diverging Wave (Transient)


    Pulsed diverging-wave emission with a virtual source behind the array. Animated GIF of the propagating wavefront.

  • 5. Steered Plane Wave (3-D)


    Matrix-array plane wave steered off-axis; transient field animated in 3-D on two orthogonal planes with the transducer mesh.

Reception & Imaging

  • 6. Concave Pulse-Echo PSF


    Point spread function of a focused single-element transducer; conventional vs PE-SDI backends agree to a fraction of a percent.

  • 7. Focused TX, All-RX


    Single-line B-mode acquisition: focused transmit, all channels receive. Includes the sim.show() 3-D setup preview.

  • 8. Full Matrix Capture


    Every TX element fires individually while all RX record — the dataset behind synthetic aperture and TFM imaging.

  • 9. B-mode PSF Image


    The classic Field II PSF phantom imaged line by line with scan_focusline and log-compressed to a B-mode image.

Attenuation & Safety Metrics

  • 10. Peak Pressure & Ispta


    On-axis peak pressure and Ispta vs depth, with and without tissue attenuation — the quantities behind acoustic-output safety metrics.

  • 11. CW Field with Attenuation


    Water vs brain tissue: causal power-law attenuation with Kramers–Kronig dispersion reshaping a 10 MHz focused beam.

Applications

  • 12. Mouse Brain Atlas


    Concave bowl with focal spot overlaid on a BrainGlobe mouse atlas. Anatomy, transducer, and pressure in one frame.

  • 13. Rat Brain Targeting


    FUS targeting of motor and somatosensory regions. Atlas scaling by lambda–bregma distance and registration to the transducer frame.

  • 14. STL Meshes


    Loading and visualising STL files of experimental components. Transforms, multiple objects in one scene, and custom lighting.

  • 15. STL + Simulation


    End-to-end: concave bowl transducer, pressure field, and petri-dish STL composed in a single PyVista 3-D scene.

  • 16. Surface Subdivision


    Direct use of subdivide_parametric_surface on an ellipsoidal cap. Patch distribution, coverage, and flat-patch accuracy.

  • 17. Import a Field II Probe


    One-line MATLAB export → from_fieldii_rect_data → a native eSDIva transducer with the original delays and apodization.

  • 18. Custom Sparse Array


    64-element spiral array assembled with CustomTransducer, repositioned with transform(), and visualised on 3-D plane slices.

  • 19. Dual-Probe Pulse-Echo


    Pitch-catch: a second array tilted 30° with transform() receives from an oblique angle. Setup previewed with sim.show().

  • 20. Speckle Phantom B-mode


    make_phantom cyst phantom, piezo impulse response set, focused B-mode line-by-line with scan_focusline.

  • 21. Volumetric Case Study


    Full pipeline: shared phantom, diverging-wave sequence, checkpointed sequence_rf acquisition, das_volume IQ compounding, honest metrics.


Prerequisites

Examples Requirements
1–11, 16–21 Core eSDIva installation
12–13 brainglobe-atlasapi (atlas data downloaded on first run)
14–15 Petri_dish.stl placed in examples/