get_tr_waveformsfailed on multi-block repeated segments (e.g., mprage) because segment lookup usedfind_segment_for_block_pos(n)againstsegment.start_block(first-occurrence only), causing missing anchors on later occurrences.- Correct fix in
pulseqlib_waveforms.c: usescan_table_seg_id[block_idx]only whenblock_order == NULL(degenerate/single-pass path where block_idx maps to scan-table position). - For ADC anchor
blk_in_seg, use precomputed occurrence offsets (scan_blk_in_occ) only whenblock_order == NULL; keep fallbackn - seg->start_blockfor non-degenerate average-expanded passes. - Gotcha: in non-degenerate average-expanded passes,
block_order[n]is a block-table index, not a scan-table position; indexingscan_table_seg_idwith it breaks anchor lookup (seen in bssfp navg=3). _get_sequence_descriptionnow emitsrf_shape_tuplesby scanning segment blocks per unique RF, retrieving stats viapulseqlib_get_rf_stats, and waveform arrays viapulseqlib_get_rf_magnitude/phase/time_us.- Wrapper implementation uses
pulseqlib_internal.hfor read-only descriptor access (rf_definitions,segment_definitions) and frees all C-allocated RF arrays withPULSEQLIB_FREE.