Running PAM
scripts/run_pam.jl simulates passive acoustic emissions and reconstructs source activity from receiver RF data. It supports 2D and 3D domains, homogeneous water controls, CT-backed skull media, sparse point sources, and generated vascular activity.
Homogeneous Point Source
Use this when checking the installation or testing reconstruction behavior without CT data:
julia --project=. scripts/run_pam.jl \
--source-model=point \
--sources-mm=30:0 \
--aberrator=none \
--recon-use-gpu=falseFor multiple 2D point emitters:
julia --project=. scripts/run_pam.jl \
--source-model=point \
--sources-mm=25:-6,32:0,40:8 \
--phases-deg=0,90,180 \
--delays-us=0,2,4 \
--aberrator=none3D Point Source
3D reconstruction currently uses the CUDA backend:
julia --project=. scripts/run_pam.jl \
--dimension=3 \
--source-model=point \
--sources-mm=30:2:-1 \
--aberrator=none \
--recon-use-gpu=trueSquiggle Activity
--source-model=squiggle expands each anchor into a generated vascular centerline and samples bubble emitters along it. In --recon-mode=auto, squiggle runs use windowed incoherent reconstruction.
julia --project=. scripts/run_pam.jl \
--source-model=squiggle \
--anchors-mm=45:0 \
--aberrator=skull \
--skull-transducer-distance-mm=30 \
--slice-index=250 \
--source-phase-mode=random_phase_per_window \
--frequency-jitter-percent=1 \
--recon-bandwidth-khz=500 \
--recon-window-us=20 \
--recon-hop-us=10 \
--recon-progress=true3D Network Activity
--source-model=network creates a random branching 3D centerline structure around each anchor and samples emitters inside an ellipsoid.
julia --project=. scripts/run_pam.jl \
--dimension=3 \
--source-model=network \
--anchors-mm=45:0:0 \
--network-root-count=12 \
--network-generations=3 \
--aberrator=skull \
--skull-transducer-distance-mm=20 \
--slice-index=250 \
--recon-bandwidth-khz=40 \
--recon-window-us=40 \
--recon-hop-us=20 \
--recon-use-gpu=true \
--recon-progress=trueReconstruction-Only Mode
For 2D runs, --from-run-dir reuses a previous result.jld2 and reruns reconstruction and analysis without rerunning k-Wave:
julia --project=. scripts/run_pam.jl \
--from-run-dir=outputs/previous_pam_run \
--recon-bandwidth-khz=20 \
--recon-use-gpu=trueIn this mode, simulation-specific options such as source locations, medium/skull settings, grid size, and time step are rejected. Reconstruction and analysis options remain adjustable.
Choosing Important Parameters
Start with the source model and medium:
- Use
--source-model=pointfor localization tests. - Use
--source-model=squigglefor generated vascular activity. - Use
--source-model=networkfor 3D branching activity. - Use
--aberrator=nonefor homogeneous controls. - Use
--aberrator=skullwith--ct-path,--slice-index, and--skull-transducer-distance-mmfor CT-backed transcranial cases.
Then tune reconstruction:
--recon-mode=autois usually the right default.--recon-bandwidth-khzis a major runtime/accuracy knob.--recon-window-usand--recon-hop-uscontrol windowed incoherent reconstruction.--window-batchcan improve GPU throughput for windowed reconstruction.
See PAM CLI Parameters for the generated option reference.