Skip to content

Scanner 11 Nov: hot-fixes from the 7 T session - #232

Merged
mcencini merged 16 commits into
mainfrom
claude/project-thread-tbach0
Nov 12, 2026
Merged

mcencini merged 16 commits into
mainfrom
claude/project-thread-tbach0

Conversation

@mcencini

Copy link
Copy Markdown
Contributor

Requested by Matteo · project thread

Carries the 15 commits of #230 (the 7 T session's hot-fixes: bSSFP 2D bridged and gated trains with a flip-angle ramp catalyst, EPI FLEET calibration and ADC dwell, 2D fat saturation and saturation bands under a 40 T/m/s slew ceiling) plus one commit that makes its test suite pass:

  • bssfp2D_sequence returns one sequence, or a chain of dummies and frame files for a free-running slice with dummies. Its return annotation is now pp.Sequence | list[pp.Sequence], and tests/test_sequence_docstrings.py admits that third return kind (pypulseqpp.Sequence or list of pypulseqpp.Sequence, with an indented description) alongside a single sequence and a chain.

pulserver #379 needs this on PyPI; it goes out as 0.0.64.


Generated by Claude Code

mcencini and others added 16 commits November 11, 2026 11:41
The z lobes of BssfpReadout2D/3D were all built on the full-scale ramp
max_grad / max_slew, so that a slice rephaser and a partition encode
sum to one trapezoid. At 80 mT/m and 132.6 T/m/s that ramp is 604 us,
and a small 2D slice rephaser became a 1.208 ms triangle at 19 T/m/s
that set both windows of the repetition (TR 5.016 ms at 7 T for
192x192, 300 mm, 8 mm, 125 kHz). The shared ramp is now the one on
which the largest summed lobe is fastest at the slew rate, the
half-flip lobe has its own, and each window takes only its own floors.
Same protocol: 3.736 ms at 132.6 T/m/s; 3.912 ms at the 105 T/m/s the
design server lowers it to for PNS. Balance is exact (moments below
5e-14 of a k-space step on every axis).

An ungated bssfp2D_sequence now plays each slice's lines n_phases times
back to back, a free-running series labelled PHS, without dummies
between frames; it used to ignore n_phases and play one frame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… flip

The gradient-echo calibration that epi2d plays when undersampled or
multiband, and epi3d when undersampled, excited every line with the
imaging pulse at the imaging flip. Its lines follow one another at its
shortest TR, so at 7 T a 70 degree scan (exam 28827: 2 slices, R 3,
calibration TR 6.4 ms) was refused at predownload: "SAR at 117% of its
10 s limit: 6.4 ms of scan need 7.5 ms". At that flip the calibration also
read its k-space centre at about a hundredth of the first line's signal.

The calibration now plays CALIBRATION_FLIP_DEG, 10 degrees, near the
Ernst angle of its TR: (10/70)^2 of the RF power, about 2 % of the limit
in that scan, and its signal held across the calibration region. The
calibration only measures coil sensitivities. epi2d scales the
single-band pulse's samples (a small-tip SLR pulse, no second design or
bandwidth measurement); epi3d designs its excitation at the imaging
pulse's duration. Either way the calibration plays the imaging
waveform, so the RF definition and the segmentation are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…led read axis

On the 7 T (11 Nov, series 15-17) the two forward lines of the three-line
navigator differed by a linear phase of 2.0-2.35 rad, an echo shift of
0.64 samples: the first lobe after the prewinder echoes away from where the
steady train does. The odd-even phase fitted to the navigator was then off by
about 0.5 rad and 0.8-1.4 rad/half-FOV, leaving an N/2 ghost of 15 % in a
single-shot EPI where the best linear correction leaves 6 %.

The train now plays one negative lobe, without ADC, between the read
prewinder (which opposes it) and the navigator; the navigator keeps its
+ - + polarity and its labels, and the train its alternation. The echo time
of the centre line grows by one echo spacing at the shortest TE; the spacing,
the shapes and the ADC are unchanged (one more block per shot, a scaled copy
of the read lobe).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A scanner that prepares a segment between blocks at rest cut a slice of the
balanced SSFP into one segment a repetition, and took its segment time after
each: the played repetition was longer than the designed one and the echo sat
ahead of its middle.

BssfpReadout2D(bridge=True) runs the ramps of the selection plateau through
zero to a fraction of its amplitude where the excitation block meets the
rewind before it and the acquisition after it, and the rephasers end and
start there. No join between two repetitions of a slice then has every
gradient at rest, the areas either side of the pulse centre are unwound
exactly, and the block durations are those of a slice axis that rests; where
they could not be, the slice is left unbridged (bridged is False). gz_open
opens a slice from rest and gz_close closes its last rewind to rest.

bssfp2d bridges the slices of a free-running scan of several slices. A gated
train rests where it waits for the heartbeat. A single slice is no repetition
of the scan, and a receive calibration then plays one repetition alone, from
rest to rest, which a bridged repetition is not. The 3D readout is unchanged.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
One slice is the several-slice scan with one slice: it opens and closes at
rest and is played as one segment. The receive calibration of a single
bridged slice is the scan's own start (pulserver).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A gated slice rested and waited for a trigger at every heartbeat, so its
repetitions could not be joined and a scanner played them a segment each.

Every 2D slice is now bridged. Under prospective gating a slice waits for one
trigger, ahead of its half flip, and then runs free at the nominal heart rate:
each heartbeat plays its segment once per cardiac phase and repetitions that
do not acquire fill the rest of it (prospective_starts), so the steady state
is kept across heartbeats. A heart rate away from the nominal one drifts
against the cardiac phases, which a trigger per heartbeat corrected.
Retrospective gating plays as before, with no trigger, and is bridged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d raster

The bridged readout fell back to a slice axis that rests wherever a bridged
rephaser was longer than the window a resting one needs. On a 4 us gradient
raster that is every prescription, by a raster step, so a scanner played an
unbridged slice at any repetition time, the minimum and a longer one alike.

bridge=True now always bridges. The windows either side of the excitation
hold the bridged rephasers; the shortest repetition is then within a few
rasters of that of a resting slice axis (the same at 105 T/m/s and above on
both rasters, up to 0.24 ms longer at 30 T/m/s). A longer repetition time
lengthens the acquisition and rewind blocks, which carry the read and phase
lobes from one end to the other, so no block and no join rests. The half-flip
gap holds its two rephasers apart where it has the room, and one lobe held at
the bridge level where it does not. gz_close is None where the closing lobe
does not fit the last rewind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eiling

The spoilers of a fat saturation or a saturation band play on three axes
at once. Designed at the sequence's slew they set its nerve stimulation,
and the design server's slew search then slows every gradient of the
sequence for them: a 2D EPI with fat saturation was designed at 49.9 T/m/s
instead of 88, the spoiler alone at 0.95 of the stimulation limit and the
train at 0.60. epi2D, gre2D and se2D now build these modules under
pp.cap_system(system, max_slew=PREPARATION_MAX_SLEW), 40 T/m/s; the
spoiler of the fat saturation grows from 2.76 to 2.88 ms and the train
keeps the sequence's slew. The safety search still checks the whole
sequence.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ities

The calibration of an undersampled 2D or 3D EPI reads its central lines in
n_shots * ry interleaved EPI shots with the imaging train's read lobe,
navigator, blip window, echo spacing and echo time (Polimeni et al., MRM
2016), a slice's or partition's shots in rapid succession at 10 degrees,
forward (SET 0) and reversed (SET 1). It is the default; calibration='gre'
keeps the gradient echo per line. EpiReadout2D/3D take blip_span, so the
calibration matches a multiband train's echo spacing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The trigger had a block of its own ahead of the half flip, a segment the
scanner played for microseconds, and the slice's train after it had to be
set up in that time: a slice-long train cannot be, and the interpreter
refuses it. The trigger now sits on the half-flip block, so the train
itself waits for it and is set up before the trigger, or while the slice
before it plays. The trigger delay is played as repetitions that do not
acquire (prospective_starts), keeping the steady state through it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The reference (reversed phase encode) and the gradient-echo calibration stated
no kSpaceCenterLine (3D: kSpaceCenterPartition), so pulserver's enrichment
centred them on the lines they read. Under partial Fourier the reference's
lines 2..144 of 192 were placed 23 rows off (exam 5190 series 32), which
misplaces its echo for the homodyne completion and for any joint
reconstruction with the forward shots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… frames

Matteo, 12 Nov: the frames of a 2D cine must not be one segment. An ungated
slice with dummies is now two files of the chain: the half flip and dummies,
closed to rest, then the frames, each opened from rest (gz_open) and closed
to it (gz_close) at the bridged repetition time, the file's TRSize one frame.
A scanner that segments a repetition then prepares one segment for the
dummies and one for a frame, played once per frame, and dedups both across
slices. Gated slices are one train as before.

BssfpReadout2D(bridge=True): gz_close is the rest-to-rest lobe that rephases
gz_open, always present, and the rewind window holds it (the repetition time
at 7 T limits is unchanged at 192 and 256).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st, a FIESTA-like pulse

A free-running slice is no longer bridged: every repetition opens from rest
and closes to it, and its files declare no TRSize, so a scanner that segments
a repetition plays each repetition as the same segment and adds its segment
start time to every repetition time alike. A frame-long segment lengthened
only the repetition at each frame boundary and set off a transient in the
steady state there. Gated slices stay bridged, one train with the designed
timing against the heartbeat.

The half flip is replaced by a linear ramp of the flip angle over the first
CATALYST_RAMP (20) dummies. It damps the oscillating transient better off
resonance (worst over +-0.45/TR at TR 1: 9 % against 46 %) and frees the
repetition from the half-flip timing, which refused 166-250 kHz at 192^2.
Repetitions are counted from the slice's first excitation, the trigger's
under prospective gating, with no half-repetition offset.

Default dummies bring the steady state within STEADY_STATE_TOLERANCE (5 %),
and the selective pulse defaults to 0.48 ms at a time-bandwidth product of 2,
as product balanced SSFP excites (about half the RF energy of 0.6 ms at 4),
both pulse settings now arguments; the default bandwidth is 250 kHz.

The paper-plot and expand-repeats tests, which the chain commit had broken
(a chain given to the plot; a frames file without ONCE), now use the
single-file prescription without dummies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mcencini
mcencini merged commit 8befa52 into main Nov 12, 2026
4 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants