Skip to content

Added pre- and post-sampling dependent on ADC dead time#149

Open
schote wants to merge 12 commits intomainfrom
adc-presampling
Open

Added pre- and post-sampling dependent on ADC dead time#149
schote wants to merge 12 commits intomainfrom
adc-presampling

Conversation

@schote
Copy link
Owner

@schote schote commented Feb 3, 2026

So far, the console does not sample data during ADC delay and dead time. The dead time symmetrically adds time at the beginning and the end of an ADC event, but the ADC gate signal is off during that time.

This PR changes the interpretation of the ADC dead time in the sense, that the dead time is now considered as sampling time. The number of extra samples acquired before and after the true ADC event is stored in RxData.
Note that the dead time samples are added as a multiple of the adc dwell time defined in an ADC block:

num_samples_discard = round(dead_time / adc_dwell_time)
...
total_gate_duration = (num_samples + 2*num_samples_discard) * adc_dwell_time

This means:

  • If the adc dead time is smaller than the adc dwell time, the dead time does not contribute to the sampling time and is symmetrically distributed around the ADC gate
  • If the adc dead time is a multiple of the adc dwell time, the dead time symmetrically adds samples to the adc gate, no left over
  • If the adc dead time is > adc dwell time but not a multiple, the dead time symmetrically adds samples and the "left-over" time is at the end of the adc block

The RxData instance of an ADC event keeps all the acquired samples (in the unprocessed data and in the processed data) so the truncation of pre and post samples needs to be done by post-processing.

The number of pre and post samples to be discarded is written to the acquisition header of the generated ISMRMRD file, to be considered during reconstruction.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/console
   __init__.py10190%11
src/console/interfaces
   acquisition_data.py1232580%96–99, 110–111, 129–130, 145–148, 158–159, 188–189, 193–199, 215–216, 227, 231, 249
   acquisition_parameter.py107496%126, 163, 178, 213
   device_configuration.py721086%34–36, 38, 46–47, 55–56, 83–85, 87
   dimensions.py962277%45–46, 67–68, 71, 79, 89, 95, 101, 107, 113–115, 125–127, 137–139, 149–151
   rx_data.py791482%67–71, 79, 91, 95, 97, 105, 116, 124, 127, 130
src/console/pulseq_interpreter
   sequence_provider.py2915083%164, 169, 183–185, 328–329, 416–417, 496–539, 572, 622–623, 692, 717–718, 734, 743, 747
src/console/spcm_control
   abstract_device.py79790%2–149
   acquisition_control.py1461460%3–342
   rx_device.py2052050%2–484
   tx_device.py1791790%2–468
src/console/spcm_control/spcm
   pyspcm.py1611610%3–295
   tools.py54540%3–128
src/console/utilities
   json_encoder.py8362%22–24
   load_configuration.py20670%18–20, 28–30
   plot.py17170%2–26
src/console/utilities/data
   mrd_helper.py43881%37, 43, 49, 52, 60, 63, 68, 71
   write_acquisition_to_mrd.py49590%43–44, 68, 86, 91
src/console/utilities/sequences/calibration
   fid_tx_adjust.py22195%66
   se_tx_adjust.py29293%62–64
src/console/utilities/sequences/spectrometry
   fid.py15150%2–75
   se_spectrum.py25292%51, 85
src/console/utilities/sequences/tse
   tse_3d.py2417569%108–109, 111–112, 114–115, 122–123, 125–127, 129–132, 143–146, 151–154, 161–172, 189, 211–218, 224, 255, 318–335, 342–343, 410, 413–425, 533–544
TOTAL5323108480% 

Tests Skipped Failures Errors Time
192 0 💤 0 ❌ 0 🔥 15.340s ⏱️

@schote schote requested a review from ckolbPTB February 4, 2026 11:31
Copy link
Collaborator

@ckolbPTB ckolbPTB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe specify the delay in the sequence_tests to avoid the warning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants