Reading and writing files#
Reading a .seq file into a sequence whose system is built from the file,
writing a sequence in the text or the binary form, and the tables a file of a
sequence holds, as arrays.
Pulseq file format describes what a file
records, including which system limits, and the two forms.
File input and output#
Object |
Input |
Returns |
Purpose |
|---|---|---|---|
File path; optional gradient and slew limits |
|
Read with file-derived rasters and limits. |
|
First file path; |
|
Read a file and the |
|
|
Text signature, or |
Write Pulseq text or binary. |
Library export#
libraries() returns the block table and every
library of a sequence as the tables a text file of it holds: the rows
write() writes with remove_duplicates=False,
under the same ids, in read-only arrays. Times are in seconds and the other
columns are in the file’s units.
Object |
Input |
Returns |
Purpose |
|---|---|---|---|
— |
Block table; RF, gradient, ADC, shape and extension tables; |
A sequence’s libraries without decoding its blocks. |
|
Sample count, stored values |
|
One row of the shape library. |
Diffusion tables#
A diffusion table gives one b-value and one direction per volume. A sequence reads the table from its file and records where the file is, not the table, so that a reader of the sequence, such as a reconstruction proxy, reads the same table from the same file. Directions are along the sequence’s gradient channels, which turn with the prescription.
Object |
Input |
Returns |
Purpose |
|---|---|---|---|
Path; |
b-values (s/mm²) and unit directions, one per volume |
Read an |
|
|
The table |
Read a table and record its path and arguments in |
|
|
The table, or |
Read the table a sequence’s definitions name. |