Skip to content

Import seq file backend #175

Closed
Closed

Description

@SWeinmueller

There exist two backend: pulseq_rs and pydisseqt. Which should be used when? Does it make not sense to keep just one to prevent confusion?

Activity

  1. J-Endres commented on Jun 24, 2026

    @J-Endres
    Collaborator

    pulseq_rs is the new importer, compatible with 1.5 and skips the whole pydisseqt dependency.
    The old one is still there for comparison, if everything works fine we can remove it

  2. lobroc commented on Jun 25, 2026

    @lobroc
    Contributor

    It seems like there's significant performance difference between the two parsers. Is this expected?

    >>> timeit('mr0.Sequence.import_file(sequence_file, backend="pydisseqt")', setup='import MRzeroCore as mr0; from __main__ import sequence_file', number=1)
    0.29288835900024424
    >>> timeit('mr0.Sequence.import_file(sequence_file, backend="pulseq_rs")', setup='import MRzeroCore as mr0; from __main__ import sequence_file', number=1)
    197.88033664000068
  3. J-Endres commented on Jul 7, 2026

    @J-Endres
    Collaborator

    No and I never experienced such a difference. Can you share the .seq file that produced those timings?

  4. lobroc commented on Jul 10, 2026

    @lobroc
    Contributor

    While I cannot provide the exact sequence which I used above to get those timings, I can provide a generic sequence which gives similar-enough differences: 0.244 with pydisseqt versus 27.60 with pulseq_rs.
    FYI, I had to rename the extension from .seq to .txt to attach it to this comment.

    bssfp_cine.txt

  5. J-Endres commented on Jul 13, 2026

    @J-Endres
    Collaborator

    The loading of the .seq file itself is fast, which hints that the problem is in the code that converts the data into the internal format for MR-zero.
    Thank you for reporting this, I will revise that code as soon as possible.

  6. J-Endres commented on Jul 20, 2026

    @J-Endres
    Collaborator

    Should be fixed in 4484fae / mrzerocore 1.0.5:

    Sped up import by x20. Old code used linear search per repetition to find the correct pulseq plot, leading to quadratic computational cost. Now we use binary search.

    This makes the new importer still x5 slower than the old one on the sequence you provided. The difference should no longer be prohibitive or explode with long sequences. Please re-open if its really bad for some sequences. (More than a couple of seconds). Will improve further in the future.

  7. mzaiss commented on Sep 20, 2026

    @mzaiss
    Collaborator

    I also see quite some prolongation in import time: (mr0 1.07)

    same script using 1.5 and 1.4 writing functions of pypulseq 1.5

    1.4.1 - pulseq_rs : 4.84s
    1.4.1 - pydisseqt : 0.27s
    1.5.0 - pulseq_rs | 4.76s
    1.5.0 - pydisseqt | fail (1.5 unsupported)

    file is a pypulseq example mprage 2D, attached

    mprage_pp.seq.txt

    That's 17 times slower still..

  8. reopened this on Sep 20, 2026
  9. mzaiss commented on Sep 26, 2026

    @mzaiss
    Collaborator

    fixed in #194 , please check and merge if ok.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions