Skip to content

Soft delays #185

Closed
Closed

Description

@ckolbPTB

When reading in a seq file using Sequence.import_file an optional parameter soft_delays: Optional[dict[str, float]] = None can be provided.

I could not find any documentation what soft_delays should look like. I would also suggest that if set to None, it should simply default to 0 for all soft_delays. This would be consistent with the behaviour of previous versions. Currently soft_delays = None leads to the following error for sequences containing soft delays:

ValueError: pulseq-rs parse error: Failed to convert parsed file into sequence: Referenced extension with id 6 does not exist

Activity

  1. J-Endres commented on Jul 28, 2026

    @J-Endres
    Collaborator

    Thank you for the feedback. Does that mean that loading sequences with soft delays works as expected when specifying all of them? So it's only a matter of defaults + documentation? Will fix these two soon

  2. self-assigned this
    on Jul 28, 2026
  3. J-Endres commented on Jul 28, 2026

    @J-Endres
    Collaborator

    I released version 1.0.5, which adds documentation and defaults soft delays to 0.
    Please let me know if this fixed your issues.

  4. ckolbPTB commented on Aug 10, 2026

    @ckolbPTB
    ContributorAuthor

    Thank you for looking into this. I am struggling to get the correct pulseq-rs version installed with mrzerocore.

    Even when I install mrzerocore==1.0.5 in a clean environment, I still seem to get the old pulseq-rs version because I get the same error message as above but in pulseq-rs==0.2.2 this error message was removed.

    I have never jused Cargo.toml. Is there a way of verifying the pulseq-rs version?

  5. J-Endres commented on Aug 24, 2026

    @J-Endres
    Collaborator

    The exact commit of pulseq-rs used in the build of MR-zero core is noted here (it is the latest commit):

    MRzero-Core/Cargo.lock

    Lines 137 to 140 in 639dced

    [[package]]
    name = "pulseq-rs"
    version = "0.2.2"
    source = "git+https://github.com/pulseq-frame/pulseq-rs.git#5e81c1ba3f7a099d4aa26a80f903d07435d75fa7"

    However, the error you originally reported points to something else: Some block references an extension that was not found in the list of extensions, raised here in the code:
    https://github.com/pulseq-frame/pulseq-rs/blob/5e81c1ba3f7a099d4aa26a80f903d07435d75fa7/src/seq/convert/mod.rs#L367-L370

    It is absolutely possible that there is an error in how extensions are parsed; I assume that your file is written with (py-)pulseq and writes blocks and extensions correctly.

    • Can you share a minimal example that fails?
    • The import error should always occur, even if you specify all soft delays, is that correct?
  6. ckolbPTB commented on Aug 26, 2026

    @ckolbPTB
    ContributorAuthor

    Yes, you were right - sorry for the confusion. It seems that the error occurs depending on the pulseq version.

    I am using pypulseq and when I save the seq file in v1.4.1 compatibility modus (https://github.com/pulseq/pypulseq/blob/805c76f9427d536a63bb0a7aa405fa9403e4d08a/src/pypulseq/Sequence/write_seq.py#L282) then I get the above error. If I save it in the latest v1.5 format, then it works. Officially soft delays are only supported from v1.5.0 onwards so I guess this issue can be closed.

    One suggestion for improvement: Currently trig_delay defaults to 0 in MRZero if nothing else is defined. Maybe it would be better to default to the default_duration specified for the soft delay object (https://github.com/pulseq/pypulseq/blob/805c76f9427d536a63bb0a7aa405fa9403e4d08a/src/pypulseq/make_soft_delay.py#L41)

  7. J-Endres commented on Aug 26, 2026

    @J-Endres
    Collaborator

    Thank you for the investigation. In this case we could make the error message more clear and tell the user that the extension is not supported in the pulseq version of the file. Alternatively the soft_delay (and other) extensions could be backported to be supported with earlier pulseq versions (But that violates the specification; would have to look into how much effort that is).

    About trig_delay: This can be considered a bug and should definitely be fixed.

  8. J-Endres commented on Oct 19, 2026

    @J-Endres
    Collaborator

    I finally got around to fix this: in the new version 1.1.3, the soft delay default value will be taken from the block duration (if no value was set). This should fix the issue - if it doesn't please reopen.

    See #199

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

Metadata

Metadata

Assignees

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