Sequence.libraries

Sequence.libraries#

Sequence.libraries()[source]#

Return the block table and every library, as a Pulseq file of the sequence holds them.

The ids are this sequence’s own. write() with remove_duplicates=False writes these rows under these ids; by default it writes a collapsed copy, whose ids differ wherever two rows were equal. Taking the tables changes nothing, so a shape registered and not yet encoded, which the writer encodes on the way out, comes back as its samples.

Returns:

A snapshot, in read-only arrays that no later edit reaches.

Return type:

pypulseqpp.io.SequenceLibraries

Examples

>>> import pypulseqpp as pp
>>> seq = pp.Sequence(pp.Opts())
>>> seq.add_block(pp.make_trapezoid("x", area=1000, duration=2e-3))
1
>>> tables = seq.libraries()
>>> tables.blocks.tolist(), tables.trapezoid_ids.tolist()
([[0, 1, 0, 0, 0, 0]], [1])