Skip to content

Implement Pulseq-style sequence construction and export parity#804

Open
cncastillo wants to merge 13 commits into
masterfrom
codex/pulse-designer-rework
Open

Implement Pulseq-style sequence construction and export parity#804
cncastillo wants to merge 13 commits into
masterfrom
codex/pulse-designer-rework

Conversation

@cncastillo

Copy link
Copy Markdown
Member

Summary

This PR implements most Pulseq-style event constructors in KomaMRIBase.PulseDesigner, adds Pulseq read/write parity handling, and introduces MATLAB Pulseq parity tests/CI.

The new constructors return native Koma objects, so the same sequence can be plotted, simulated, checked, and exported to .seq.

Implemented Pulseq-style constructors

Pulseq MATLAB Koma event constructor Koma sequence constructor
mr.makeTrapezoid make_trapezoid build_trapezoid
mr.makeExtendedTrapezoid make_extended_trapezoid build_extended_trapezoid
mr.makeExtendedTrapezoidArea make_extended_trapezoid_area build_extended_trapezoid_area
mr.makeArbitraryGrad make_arbitrary_grad build_arbitrary_grad
mr.makeBlockPulse make_block_pulse build_block_pulse
mr.makeSincPulse make_sinc_pulse build_sinc_pulse
mr.makeGaussPulse make_gauss_pulse build_gauss_pulse
mr.makeArbitraryRf make_arbitrary_rf build_arbitrary_rf
mr.makeAdiabaticPulse make_adiabatic_pulse build_adiabatic_pulse
mr.makeAdc make_adc build_adc
mr.makeDelay make_delay build_delay
mr.makeLabel make_label build_label
mr.makeRotation make_rotation build_rotation
mr.makeTrigger make_trigger build_trigger
mr.makeDigitalOutputPulse make_digital_output_pulse build_digital_output_pulse

Other changes

  • Adds Unitful support for PulseDesigner scanner/event inputs.
  • Adds event area(...) and RF timing/frequency primitives used by PulseDesigner and Pulseq IO.
  • Updates Pulseq read/write behavior for MATLAB parity, including explicit gradient timing compaction and configurable writer precision.
  • Clarifies write_seq timing and hardware checks and the values used for those checks.
  • Adds MATLAB Pulseq parity tests and a Pulseq parity CI workflow for relevant path changes.
  • Adds plot_kspace(...; view_2d=true) and bumps KomaMRIPlots to 0.11.1.
  • Adds a Pulseq GRE tutorial showing native Koma construction, plotting, export, and readback.
  • Bumps KomaMRIBase and KomaMRIFiles for the new non-breaking functionality.

Testing

  • Pkg.test("KomaMRIBase")
  • Pkg.test("KomaMRIFiles")
  • MATLAB Pulseq parity test
  • Regenerated the Pulseq GRE Literate notebook output

@cncastillo cncastillo added documentation Improvements to docs., it also triggers doc preview pulseq-parity Run Pulseq MATLAB parity CI labels Jun 22, 2026
@cncastillo cncastillo force-pushed the codex/pulse-designer-rework branch 2 times, most recently from 8929914 to a49c1be Compare June 22, 2026 18:01
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.89066% with 159 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.68%. Comparing base (6476e2b) to head (5f305ec).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...rc/sequences/PulseDesigner/make_adiabatic_pulse.jl 60.22% 35 Missing ⚠️
...omaMRIBase/src/sequences/PulseDesigner/make_adc.jl 0.00% 24 Missing ⚠️
...src/sequences/PulseDesigner/make_arbitrary_grad.jl 0.00% 21 Missing ⚠️
...sequences/PulseDesigner/make_extended_trapezoid.jl 61.29% 12 Missing ⚠️
...Base/src/sequences/PulseDesigner/make_trapezoid.jl 85.71% 11 Missing ⚠️
KomaMRIBase/src/timing/KeyValuesCalculation.jl 90.66% 7 Missing ⚠️
...aMRIBase/src/sequences/PulseDesigner/deprecated.jl 94.23% 6 Missing ⚠️
...e/src/sequences/PulseDesigner/make_arbitrary_rf.jl 84.61% 6 Missing ⚠️
...quences/PulseDesigner/make_digital_output_pulse.jl 60.00% 6 Missing ⚠️
KomaMRIFiles/src/Sequence/pulseq/ReadPulseq.jl 64.70% 6 Missing ⚠️
... and 9 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #804      +/-   ##
==========================================
- Coverage   90.06%   87.68%   -2.39%     
==========================================
  Files          76       93      +17     
  Lines        5397     6067     +670     
==========================================
+ Hits         4861     5320     +459     
- Misses        536      747     +211     
Flag Coverage Δ
base 84.77% <81.91%> (-1.74%) ⬇️
core 81.66% <ø> (-10.16%) ⬇️
files 94.96% <84.09%> (-0.30%) ⬇️
komamri 88.00% <ø> (ø)
plots 90.26% <70.00%> (-0.63%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
KomaMRIBase/src/KomaMRIBase.jl 100.00% <ø> (+14.28%) ⬆️
KomaMRIBase/src/datatypes/Scanner.jl 100.00% <100.00%> (ø)
KomaMRIBase/src/datatypes/Sequence.jl 91.09% <100.00%> (ø)
KomaMRIBase/src/datatypes/sequence/Grad.jl 92.24% <100.00%> (ø)
KomaMRIBase/src/datatypes/sequence/TimingChecks.jl 60.45% <100.00%> (+1.12%) ⬆️
KomaMRIBase/src/sequences/PulseDesigner.jl 100.00% <100.00%> (+5.76%) ⬆️
...se/src/sequences/PulseDesigner/make_block_pulse.jl 100.00% <100.00%> (ø)
...aMRIBase/src/sequences/PulseDesigner/make_delay.jl 100.00% <100.00%> (ø)
...nces/PulseDesigner/make_extended_trapezoid_area.jl 100.00% <100.00%> (ø)
KomaMRIBase/src/timing/TrapezoidalIntegration.jl 100.00% <100.00%> (ø)
... and 20 more

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cncastillo cncastillo force-pushed the codex/pulse-designer-rework branch 2 times, most recently from fd8f0a4 to 2b2cc8c Compare June 22, 2026 18:22
@cncastillo cncastillo force-pushed the codex/pulse-designer-rework branch from 2b2cc8c to 882fe9d Compare June 22, 2026 18:33
@github-actions

Copy link
Copy Markdown
Contributor

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

Labels

documentation Improvements to docs., it also triggers doc preview pulseq-parity Run Pulseq MATLAB parity CI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant