imr-framework / pypulseq

Pulseq in Python
https://pypulseq.readthedocs.io
GNU Affero General Public License v3.0
111 stars 58 forks source link

Feature: `evaluate_labels` function in `Sequence` #164

Closed FrankZijlstra closed 5 months ago

FrankZijlstra commented 5 months ago

This implements the evalLabels function from upstream pulseq: https://github.com/pulseq/pulseq/blob/125c772180f324967091dc28a0e5a6b20b96faa9/matlab/%2Bmr/%40Sequence/Sequence.m#L1056

Renamed to evaluate_labels to be consistent with the naming of other Sequence functions.

This function tracks labels (or label evolutions) through the sequence. Either returns the final values, or label evolutions (e.g. per block, per ADC, or whenever the label changes).

A small supporting change in event_lib.get_block was made to always set the label field in the returned block (None if no labels).