Repository navigation
Speed up pulseq_rs import by integrating gradient moments in NumPy. - #194
Merged
Merged
Conversation
The parser was already fast. The conversion called PyGradient.integrate once per event. Moments now come from one cumulative piecewise-linear integral per gradient, which covers trapezoids, extended trapezoids, and arbitrary shapes. Results match the old importer. exact_trajectories=True (default): | File | Old | New | |---|---:|---:| | pp_mprage.seq | 26 s | 3.6 s | | pp_radial.seq | 0.80 s | 0.22 s | | mrseq_spiral.seq | 5.6 s | 0.43 s | | pp_tse.seq | 0.41 s | 0.10 s | | mrseq_radial_1_5.seq | 3.0 s | 0.24 s | | mrseq_spiral_1.5.seq | 3.0 s | 0.23 s |
Closed
Simulation test: main (before) vs. this PR (after)
|
J-Endres
approved these changes
Oct 19, 2026
J-Endres
left a comment
Collaborator
There was a problem hiding this comment.
The python side of the importer already was AI-generated; if the results are identical I trust this to work as expected.
J-Endres
added a commit
that referenced
this pull request
Oct 19, 2026
* fix: Match unit convention of pulse.freq_offset between pydissect and import_pulseq_rs to Hz (#197) * Speed up pulseq_rs import by integrating gradient moments in NumPy. (#194) The parser was already fast. The conversion called PyGradient.integrate once per event. Moments now come from one cumulative piecewise-linear integral per gradient, which covers trapezoids, extended trapezoids, and arbitrary shapes. Results match the old importer. exact_trajectories=True (default): | File | Old | New | |---|---:|---:| | pp_mprage.seq | 26 s | 3.6 s | | pp_radial.seq | 0.80 s | 0.22 s | | mrseq_spiral.seq | 5.6 s | 0.43 s | | pp_tse.seq | 0.41 s | 0.10 s | | mrseq_radial_1_5.seq | 3.0 s | 0.24 s | | mrseq_spiral_1.5.seq | 3.0 s | 0.23 s | * Cast values to native float before writing mrd header (#189) * chore: update version number and changelog * feat: update pulseq-rs for more fixes and better pulseq support * feat: add FID graph creation function * chore: link pulsq-zero in docs, remove submodule * chore: add changelog to docs * chore: rename version to 1.2.0 * fix: zero size for one of the phantom axes no longer crash prepass --------- Co-authored-by: FDietz <felix.dietz@fau.de> Co-authored-by: mzaiss <mzaiss@users.noreply.github.com> Co-authored-by: David Schote <42237900+schote@users.noreply.github.com> Co-authored-by: Jonathan Endres <jonathan.endres@uk-erlangen.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.











Resolves issue #175 The parser was already fast. The conversion called PyGradient.integrate once per event. Moments now come from one cumulative piecewise-linear integral per gradient, which covers trapezoids, extended trapezoids, and arbitrary shapes. Results match the old importer.
exact_trajectories=True (default):