effusive.rf¶
rf.* ¶
Functions:
-
inactiveStorageSpecs–Build placeholder storage specs for re-init calls without file creation.
-
processRFEnsembleBlock–Process an ensemble block of RF data and populate FrameRuntimeState.
-
publishProcessedFrame–Write processed frame data to shared memory and emit periodic timing reports.
-
reinitEchoFrameStorage–Re-initialize EchoFrame storage for a MEX command, choosing active or inactive specs.
inactiveStorageSpecs ¶
Build placeholder storage specs for re-init calls without file creation.
These specs keep EchoFrame re-init paths happy when saving is disabled, while avoiding folder creation and file allocation.
Input arguments:
-
(ReconSpec¶struct) –EchoFrame reconstruction specification; crop state and BF datatype are propagated into the placeholder BF storage spec.
-
(PDISpec¶struct) –EchoFrame PDI specification; crop state is propagated into the placeholder PDI storage spec.
Output arguments:
-
(BFStorageSpec¶struct) –Disabled BF storage spec compatible with
echoframe_mexre-init. -
(PDIStorageSpec¶struct) –Disabled PDI storage spec compatible with
echoframe_mexre-init. -
(RFTimeTagStorageSpec¶struct) –Disabled RF time-tag storage spec compatible with
echoframe_mexre-init. -
(RFStorageSpec¶struct) –Disabled raw RF storage spec compatible with
echoframe_mexre-init.
processRFEnsembleBlock ¶
(RF)
Process an ensemble block of RF data and populate FrameRuntimeState.
Input arguments:
Notes
This is Process(2) in the Verasonics event sequence. It handles four
exclusive processing branches (SVD update, crop re-init, experiment
re-init, and normal processing) and writes the results into the
FrameRuntimeState base workspace struct for downstream callbacks.
Base workspace variables (read):
ExperimentSpec(struct): updateExperiment flag checked every frame.storeEchoFrameOutput(logical): controls whether echoframe_mex saves.svdThreshold(single): current SVD rejection threshold.svdUpdateFlag(logical): set by processRuntimeControl; reset here.updateCropping(logical): set by processRuntimeControl; reset here.ReconSpec(struct): reconstruction spec; read in re-init branches.StorageSpec(struct): storage spec; read in re-init branches.ReceiveSpec(struct): receive spec; read in re-init branches.PDISpec(struct): PDI spec; read in re-init branches.TransmitSpec(struct): transmit spec; read in re-init branches.ProbeSpec(struct): probe spec; read in re-init branches.storageConfigApplied(struct): determines re-init path in branches.FrameRuntimeState(struct): read for timing fields; written back.
Base workspace variables (written):
svdUpdateFlag: reset to 0 after SVD branch.updateCropping: reset to 0 after crop branch.ExperimentSpec: updateExperiment reset to false after experiment branch.FrameRuntimeState: updated every frame with processing results and timing fields.
publishProcessedFrame ¶
Write processed frame data to shared memory and emit periodic timing reports.
Notes
This is Process(4) in the Verasonics event sequence, running after processRuntimeControl and before the returnToMatlab sync event. It is skipped silently when FrameRuntimeState.frameReady is false (e.g. the svdUpdateFlag branch ran in processRFEnsembleBlock).
Timing is measured across three quantities per frame (accumulated over TIMING_PRINT_INTERVAL frames):
- VSX acq loop: time from end of previous publishProcessedFrame to start of processRFEnsembleBlock (i.e. time spent in hardware acquisition). Set by processRFEnsembleBlock into FrameRuntimeState.t_vsx_wait_s.
- Callback: toc(FrameRuntimeState.t_frame_start_tic) measured here at end of publish -- covers RF proc + control + publish.
- Total period: VSX + callback; reciprocal gives FPS.
Base workspace variables (read):
FrameRuntimeState(struct): Bmode, PDI (raw, un-normalized -- the napari viewer log-compresses each to dB relative to its own per-frame peak), RF (raw ensemble, sliced into an RF snapshot only when publishRfSnapshot is true), ensemble_time_s, publishRfSnapshot, frameReady, t_frame_start_tic, t_vsx_wait_s.storeEchoFrameOutput(logical): current save state for runtime flags.- Shared memory names (char): read once on first call.
Base workspace variables (written):
FrameRuntimeState: publishRfSnapshot reset to false after RF write; t_last_publish_end_tic updated at end of each call.
reinitEchoFrameStorage ¶
(mexCommand: char, useActiveStorage: logical, StorageSpec: struct, ReceiveSpec: struct, ReconSpec: struct, PDISpec: struct, ExperimentSpec: struct, TransmitSpec: struct, ProbeSpec: struct)
Re-initialize EchoFrame storage for a MEX command, choosing active or inactive specs.
Input arguments:
-
(mexCommand¶char) –EchoFrame MEX re-init command, e.g.
're-init storage'or're-init experiment'. -
(useActiveStorage¶logical) –When
true, build storage specs fromStorageSpecviaeffusive.echoframe.configureEchoFrameStorageSpecs. Whenfalse, build placeholder specs viaeffusive.rf.inactiveStorageSpecs. -
(StorageSpec¶struct) –EchoFrame storage specification; only read when
useActiveStorage. -
(ReceiveSpec¶struct) –EchoFrame receive specification.
-
(ReconSpec¶struct) –EchoFrame reconstruction specification.
-
(PDISpec¶struct) –EchoFrame PDI specification.
-
(ExperimentSpec¶struct) –Experiment specification; only read when
useActiveStorage. -
(TransmitSpec¶struct) –Transmit specification; only read when
useActiveStorage. -
(ProbeSpec¶struct) –Probe specification; only read when
useActiveStorage.