Protocol#

The entries of a scanner protocol, and the text blocks that carry them between the design calls and the scanner interpreter.

A protocol entry has a kind, a current value and the schema the scanner UI presents it with: a range and increment for a numeric entry, and options for a dropdown. Times are integer microseconds, the unit of the scanner’s time parameters. A preset is a negative value that the UI shows as a word and that a scanner sequence maps to a design choice, such as the shortest echo time. The grammar of the blocks is the one pulseg_protocol_parse reads on the interpreter side.

Entries#

Object

Description

Parameter

One protocol entry: kind, current value and UI schema.

Kind

Type tag of an entry on the wire.

InputMode

Presentation of an entry in the scanner UI: typed in, chosen from a dropdown, or not editable.

TEPreset

Echo-time presets.

TRPreset

Repetition-time presets.

Parameter names#

The names of the interpreter’s parameter table, grouped by the value type the table declares, and the options of its string-list parameters. A scanner sequence names its entries with them. Each name is a member of a StrEnum, so a key is a str that equals and hashes as its wire name; the keys of a protocol stay members until a wire block formats them.

Object

Description

ProtocolKey

A key of the protocol: a member of any of the key enums below.

UIParam

Collects the keys of every UI control, and returns the user-entry keys.

FloatKey

Keys declared as float.

IntKey

Keys declared as integer.

BoolKey

Keys declared as boolean.

EnumKey

Keys declared as string lists.

ConfigKey

Keys the sequence declares to the interpreter rather than shows.

UserKey

Keys of the float user entries, user0_value to user18_value.

UserNameKey

Keys of the descriptions naming the user entries, user0_name to user18_name.

SequenceType

Options of sequence_type.

ImagingMode

Options of imaging_mode.

PreparationType

Options of preparation_type.

TriggerType

Options of trigger_type: Pulseq trigger channel names.

Prescription#

The field-of-view offset and orientation the interpreter fills from the scanner’s prescription. The entries close every listing and are not bound to a design argument; the host applies the offset when it builds the IR, and checks the design in the physical frame the orientation gives.

Object

Description

PRESCRIPTION

Keys of every prescription entry: the offset’s, then the rotation’s.

FOV_OFFSET

Keys of the field-of-view offset entries, in mm along the logical readout, phase and slice axes.

FOV_ROTATION

Keys of the rotation entries, row-major: element (i, j) of R in physical = R logical.

prescribed_offset

Field-of-view offset that protocol values carry, in metres.

prescribed_rotation

Rotation from logical to physical axes that protocol values carry, made orthonormal.

Wire blocks#

A listing carries every entry with its schema, as the list design call replies it; a value block carries values only, as the validate and generate calls read and reply them. These functions are the only place where keys and values become text and text becomes them. The parsers return the key members for the names they read, and a value block parsed against a listing returns each string list as one of the listing’s options.

The RF blocks follow a reply when the call asks for them: [RfDefinitions] after the listing and [RfLayout] after the value block of a valid validation. Their readers ignore every other block, and the readers of the listing and the value block ignore these.

Object

Description

PROTOCOL_BEGIN

First line of every protocol block.

PROTOCOL_END

Last line of every protocol block.

format_listing

Format a protocol with its schema.

parse_listing

Read a protocol with its schema from a listing block.

format_values

Format a value block.

parse_values

Read a value block against the listing it was edited from.

format_prescription

Format prescription entries as the name: value lines of a block.

parse_prescription

Read the prescription entries out of the name: value lines of a block.

Validation

Reply to VALIDATE: validity, scan time, information line, values and the RF layout of a valid evaluation.

format_validation

Format a VALIDATE reply.

parse_validation

Read a VALIDATE reply.

RfDefinitionRecord

One RF definition of an [RfDefinitions] block.

format_rf_definitions

Format the RF definitions of an evaluation, as the list design call replies them.

parse_rf_definitions

Read the [RfDefinitions] block of a list reply.

RfLayoutRecord

The contents of an [RfLayout] block, one entry per instance of one TR in play order.

format_rf_layout

Format the RF layout of a validation, as the validate design call replies it.

parse_rf_layout

Read the [RfLayout] block of a validate reply.