This package is intended to make it easy to carry out intensity scans using a sensor and a translation stage. It's first implementation is for ultrasound intensity scans using a hydrophone and three Thorlabs LTS stages, but this can be expanded upon.
Author Orchard-Ultrasound-Innovation
1 Star
Updated Last
1 Year Ago
Started In
March 2021


Stable Dev Build Status Build Status codecov Code Style: Blue ColPrac: Contributor's Guide on Collaborative Practices for Community Packages


This package relies on the following packages. To learn more about configuring and using these packages:

using Pkg; Pkg.activate(".")
using IntensityScans
using IntensityScans.ThorlabsLTStage
using IntensityScans.TcpInstruments
using IntensityScans.Unitful
using Plots

# setup the positioner system and oscilloscope
ps = initialize(PositionerSystem)
scope = initialize(AgilentDSOX4034A)

scanner = IntensityScan(
    xyz = ps, 
    scope = scope, 
    channel = 1, 
    post_move_delay = 0ms,
    precapture_delay = 0µs,

params = ScanParameters(
    medium = Medium(),
    excitation = Excitation(),
    f0 = 5u"MHz",
    hydrophone_id = :Onda_HGL0200_2322,
    preamp_id = :Onda_AH_2020_100_1238_20dB,

set_upper_limit(ps.z, get_pos(ps.z))
move_z_rel(ps, -5mm)

# perform raster scans
wave_x = scan_x(scanner, [-10mm, 10mm], 5)
wave_xy = scan_xy(scanner, [-5mm, 5mm], 3, [-5mm, 5mm], 7)
wave_xyz = scan_xyz(scanner, [-5mm, 5mm], 3, [-5mm, 5mm], 3, [-5mm, 5mm], 3)

# save the data
@save "test_data.jld2" wave_xy params
saved_wave_xy, saved_params = IntensityScans.JLD2.load("test_data.jld2", "wave_xy", "params");

# calculate ultrasound metrics
metrics_xy = compute_metrics(saved_wave_xy, saved_params)
metrics_xyz = compute_metrics(wave_xyz, params)

# plot the data
plot(metrics_xy; isppa=true, ispta=true, mi=true)
plot(metrics_xyz; xslice=0mm, ispta=true, mi=true)

# teardown

Used By Packages

No packages found.