effusive.sequences¶
sequences.* ¶
Functions:
-
addUpdateAndRunCommand–Update a structure in the runAcq environment.
-
calculateApertureApodization–Calculate a Tukey-windowed aperture apodization vector.
-
configureMiniProbeTransducer–Configure mini probe transducer
Transstructure. -
configurePowerDopplerEvents–Configure an event sequence for power Doppler imaging.
-
configurePowerDopplerSequence–Configure a Power Doppler plane wave sequence for a given transducer.
-
configureReceive–Configure the Verasonics receive structure array.
-
configureReceiveSpec–Configure the EchoFrame receive specification struct.
-
configureResource–Configure the Verasonics Resource structure.
-
configureTGC–Configure the Verasonics time gain compensation structure.
-
configureTGCVector–Configure the TGC compensation vector for EchoFrame reconstruction.
-
configureTPC–Configure the transmit power controller (TPC) Verasonics structure.
-
configureTransmitBeams–Configure the Verasonics transmit beam steering structure.
-
configureTransmitSpec–Configure the EchoFrame transmit specification struct.
-
configureTransmitWaveform–Configure the Verasonics transmit waveform structure.
-
getCommonProcessFunctions–Configure standard external processing functions.
-
getCommonSequenceControl–Get standard sequence control commands.
-
setTriggerOutEnabled–Enable or disable trigger-out on the trigger-out events.
addUpdateAndRunCommand ¶
Update a structure in the runAcq environment.
When updating a VSX structure (e.g., Events) in an external process
function, it then needs to be updated in the runAcq environment via a
control command. This function handles this update by automatically
adding a new update&Run command to the Control structure.
Input arguments:
calculateApertureApodization ¶
Calculate a Tukey-windowed aperture apodization vector.
Input arguments:
-
(numElements¶int) –Total number of transducer elements.
-
(aperturePercentage¶float) –Active aperture as a percentage of total elements (0-100).
-
(taperRatio¶float) –Tukey window taper ratio passed to
tukeywin. Transmit and receive apertures traditionally use different tapers (e.g.0.1and0.2).
Output arguments:
-
(apodization¶double(1, numElements)) –Per-element apodization weights. Inactive elements are zero.
configureMiniProbeTransducer ¶
configurePowerDopplerEvents ¶
Configure an event sequence for power Doppler imaging.
Input arguments:
-
(nBuffers¶int) –Number of receive buffers.
-
(nRepeats¶int) –Ensemble size for Power Doppler calculation.
-
(nTransmissions¶int) –Number of plane wave angles for compounding.
-
(SeqControl¶struct) –Pre-existing sequence control structure to extend with additional
transferToHost,waitForTransferComplete, andmarkTransferProcessedcommands.
Output arguments:
configurePowerDopplerSequence ¶
(probeName: char, txrxFrameRate: double = 15e3, transmitPulseLength: double = 3, transmitFrequency: double = NaN, maxHighVoltage: double = NaN, transmitAperturePercentage: double = 100, receiveAperturePercentage: double = 100, startDepthMm: double = 0, desiredEndDepthMm: double = 12, nTransmissions: double = 30, nRepeats: double = 300, planewaveOpeningAngle: double = 20, c0: double = 1510, samplingMode: char = 'BS100BW', tgcGain: double = 900, tgcControlPoints: double = nan(1, 8), extraVoxelsX: double = 128, extraVoxelsZ: double = 0, svdRejectHighPercentage: double = 40, svdRejectLowPercentage: double = 1, initialTransmitVoltage: double = 1.6, zerosEndWavelengths: double = 3)
Configure a Power Doppler plane wave sequence for a given transducer.
This function configures all Verasonics and EchoFrame structures needed for Power Doppler imaging. It automatically sets up the transducer based on the probe name using VSX's computeTrans function.
Input arguments:
-
(probeName¶('L22-14v', 'L35-16vX', 'MiniProbe'), default:'L22-14v') –Probe identifier. Must be one of: -
'L22-14v': L22-14v linear array (15.625 MHz default) -'L35-16vX': L35-16vX linear array (28 MHz default) -'MiniProbe': Custom Cortexlab mini probe -
(txrxFrameRate¶float, default:15e3) –Acquisition frame rate before angle compounding [Hz].
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(transmitPulseLength¶int, default:3) –Pulse length in half cycles.
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(transmitFrequency¶float, default:NaN) –Transmit frequency [MHz]. Set to NaN to use probe-specific default from VSX (15.625 MHz for L22-14v, 28 MHz for L35-16vX).
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(maxHighVoltage¶float, default:NaN) –Maximum high voltage [V]. Set to NaN to use probe-specific default from VSX (25 V for L22-14v/L35-16vX, 15 V for MiniProbe).
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(transmitAperturePercentage¶float, default:100) –Transmit aperture percentage (0-100).
Danger
This parameter affects acoustic safety. Reducing aperture reduces output power but changing it requires acoustic safety assessment.
-
(receiveAperturePercentage¶float, default:100) –Receive aperture percentage (0-100). Less critical for acoustic safety than transmit aperture.
-
(startDepthMm¶float, default:0) –Starting imaging depth [mm].
-
(desiredEndDepthMm¶float, default:12) –Desired end imaging depth [mm].
-
(nTransmissions¶int, default:30) –Number of plane wave angles for compounding.
-
(nRepeats¶int, default:300) –Ensemble size for Power Doppler calculation.
-
(planewaveOpeningAngle¶float, default:20) –Total steering angle range for plane waves [degrees].
-
(c0¶float, default:1510) –Speed of sound assumption [m/s].
-
(samplingMode¶char, default:'BS100BW') –Sampling mode. Must be one of:
'BS50BW': 50% bandwidth of the demodulation frequency'BS67BW': 67% bandwidth.'BS100BW': 100% bandwidth.'NS200BW': 200% bandwidth.
-
(tgcGain¶float, default:900) –Time gain compensation gain.
-
(extraVoxelsX¶int, default:128) –Extra voxels in X dimension for reconstruction. Should ideally be a power of two.
-
(extraVoxelsZ¶int, default:0) –Extra voxels in Z dimension for reconstruction. Should ideally be a power of two.
-
(svdRejectHighPercentage¶float, default:40) –Percentage of singular vectors from tissue subspace to remove.
-
(svdRejectLowPercentage¶float, default:1) –Percentage of singular vectors from noise subspace to remove.
-
(initialTransmitVoltage¶float, default:1.6) –Initial transmit voltage [V].
-
(zerosEndWavelengths¶float, default:3) –Number of wavelengths to zero at the end of the TGC vector.
Output arguments:
-
(sequence¶struct) –Complete sequence configuration containing all Verasononics and EchoFrame structures: - Trans : Transducer configuration - Resource : System resource configuration - TX : Transmit beamforming structures - TW : Transmit waveform - Receive : Receive beamforming structures - TGC : Time gain compensation - SeqControl : Sequence control commands - Event : Event sequence definition - Process : External processing functions - RcvProfile : Receive profile settings - TPC : Transmit power control - ProbeSpec : EchoFrame probe specifications - TransmitSpec : EchoFrame transmit specifications - ReceiveSpec : EchoFrame receive specifications - ReconSpec : EchoFrame reconstruction specifications
configureReceive ¶
configureReceiveSpec ¶
(numElements: double, numRcvChannels: double, transFrequencyMHz: double, lensCorrection: double, c0: double, samplingMode: char, aperturePercentage: double, startDepthMm: double, desiredEndDepthMm: double, nTransmissions: double, nRepeats: double, txrxFrameRate: double, tgcGain: double, tgcControlPoints: double, nBuffers: double)
Configure the EchoFrame receive specification struct.
Input arguments:
-
(numElements¶int) –Number of transducer elements.
-
(numRcvChannels¶int) –Number of hardware receive channels.
-
(transFrequencyMHz¶float) –Transducer center frequency [MHz].
-
(lensCorrection¶float) –Lens correction depth offset [wavelengths].
-
(c0¶float) –Speed of sound [m/s].
-
(samplingMode¶('BS50BW', 'BS67BW', 'BS100BW', 'NS200BW'), default:'BS50BW') –IQ sampling bandwidth mode.
-
(aperturePercentage¶float) –Receive aperture percentage (0-100).
-
(startDepthMm¶float) –Start imaging depth [mm].
-
(desiredEndDepthMm¶float) –Desired end imaging depth [mm]. Actual end depth is rounded up to the nearest multiple of 128 samples.
-
(nTransmissions¶int) –Number of plane-wave transmit angles per ensemble.
-
(nRepeats¶int) –Ensemble size (number of full angle sweeps).
-
(txrxFrameRate¶float) –TX/RX frame rate [Hz].
-
(tgcGain¶float) –TGC gain applied uniformly when tgcControlPoints contains NaN.
-
(tgcControlPoints¶double(1, 8)) –TGC control points. Set to nan(1, 8) to use uniform tgcGain.
-
(nBuffers¶int) –Number of receive ping-pong buffers.
Output arguments:
configureResource ¶
(ReceiveSpec: struct, c0: double)
configureTGC ¶
(ReceiveSpec: struct, Trans: struct)
Configure the Verasonics time gain compensation structure.
Input arguments:
-
(ReceiveSpec¶struct) –EchoFrame receive specification; tgcGain and endDepthWavelengths used.
-
(Trans¶struct) –Verasonics transducer structure. Not directly referenced in this function, but must be present in the workspace for
computeTGCWaveformto accessTrans.frequencyviaevalin('caller', ...).
Output arguments:
configureTGCVector ¶
(ReconSpec: struct, ReceiveSpec: struct, zerosEndWavelengths: double = 3)
Configure the TGC compensation vector for EchoFrame reconstruction.
Input arguments:
-
(ReconSpec¶struct) –EchoFrame reconstruction specification; tgcVector field is set.
-
(ReceiveSpec¶struct) –EchoFrame receive specification; samples_per_wavelength and nSamplesIQ used.
-
–options¶Number of wavelengths to zero at the end of the TGC vector.
Output arguments:
configureTPC ¶
configureTransmitBeams ¶
(TransmitSpec: struct, Trans: struct, Resource: struct, ReceiveSpec: struct)
Configure the Verasonics transmit beam steering structure.
Input arguments:
-
(TransmitSpec¶struct) –EchoFrame transmit specification; apodization and planewaveOpeningAngle used.
-
(Trans¶struct) –Verasonics transducer structure.
-
(Resource¶struct) –Verasonics resource structure.
-
(ReceiveSpec¶struct) –EchoFrame receive specification; nTransmissions used.
Output arguments:
Notes
Base workspace variables:
Resource(struct, write): Temporarily written to the base workspace forcomputeTXDelays, then cleared.Trans(struct, write): Temporarily written to the base workspace forcomputeTXDelays, then cleared.
configureTransmitSpec ¶
(numElements: double, txrxFrameRate: double, transmitPulseLength: double, aperturePercentage: double, planewaveOpeningAngle: double, c0: double)
Configure the EchoFrame transmit specification struct.
Input arguments:
-
(numElements¶int) –Number of transducer elements.
-
(txrxFrameRate¶float) –TX/RX frame rate [Hz].
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(transmitPulseLength¶int) –Transmit pulse length [half cycles].
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(aperturePercentage¶float) –Transmit aperture percentage (0-100).
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(planewaveOpeningAngle¶float) –Total steering angle range for plane waves [degrees].
Danger
This parameter affects acoustic safety. Do not change without understanding the acoustic safety implications.
-
(c0¶float) –Speed of sound [m/s].
Output arguments:
configureTransmitWaveform ¶
getCommonProcessFunctions ¶
Configure standard external processing functions.
This function initializes a Process structure with four external
processing functions used in most sequences:
Process(1) = effusive.vantage.enableRFTimeTaggingshould be used as the very first Event in the sequence and will enable RF time tagging.Process(2) = effusive.rf.processRFEnsembleBlockruns echoframe_mex and writes results into FrameRuntimeState.Process(3) = effusive.control.processRuntimeControldecodes napari commands and applies hardware/storage mutations.Process(4) = effusive.rf.publishProcessedFramewrites display data to shared memory and emits timing reports.
Output arguments:
getCommonSequenceControl ¶
Get standard sequence control commands.
This function initializes a SeqControl structure with four sequence
control commands used in most sequences:
SeqControl(1):triggerOut.SeqControl(2):timeToNextAcq, with argumenttransmitReceiveTimeMus.SeqControl(3):returnToMatlab.SeqControl(4):jumpto firstEvent.
Input arguments:
-
(transmitReceiveTimeMus¶integer) –Time between two acquisition events, in microseconds ranging from 0 to 4190000.
Output arguments: