Skip to content

Commit 6537749

Browse files
committed
fix: wrong rebase
1 parent 2d3942d commit 6537749

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/mrinufft/io/nsp.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,12 +312,15 @@ def write_trajectory(
312312
if postgrad == "slowdown_to_edge":
313313
# Always end at KMax, the spoilers can be handeled by the sequence.
314314
edge_locations[..., 0] = img_size[0] / FOV[0] / 2
315-
end_gradients = get_gradient_amplitudes_to_travel_for_set_time(
316-
kspace_end_loc=edge_locations,
317-
start_gradients=gradients[:, -1],
318-
kspace_start_loc=final_positions,
319-
acq=acq,
320-
)
315+
end_gradients = get_gradient_amplitudes_to_travel_for_set_time(
316+
kspace_end_loc=edge_locations,
317+
start_gradients=gradients[:, -1],
318+
kspace_start_loc=final_positions,
319+
acq=acq,
320+
)
321+
322+
gradients = np.hstack([gradients, end_gradients])
323+
Ns_to_skip_at_end = end_gradients.shape[1]
321324
# Check constraints if requested
322325
if check_constraints:
323326
slewrates, _ = convert_gradients_to_slew_rates(gradients, acq)

src/mrinufft/io/pulseq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def pulseq_gre(
109109
rf_pulse: SimpleNamespace | None = None,
110110
rf_spoiling_inc: float = 0.0,
111111
grad_spoil_factor: float = 2.0,
112-
system = None,
112+
system=None,
113113
osf: int = 1,
114114
):
115115
"""Create a Pulseq 3D-GRE sequence for arbitrary trajectories.

src/mrinufft/trajectories/tools.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,13 @@ def _residual(gi):
644644
nb_shots, nb_dimension = kspace_end_loc.shape
645645
G = np.zeros((nb_shots, nb_raster_points, nb_dimension), dtype=np.float32)
646646
for i in range(nb_shots):
647-
start = n_ramp_down[i,0]
648-
G[i, : start] = np.linspace(
647+
start = n_ramp_down[i, 0]
648+
G[i, :start] = np.linspace(
649649
start_gradients[i], gi[i], n_ramp_down[i], endpoint=False, axis=-1
650650
)
651-
if n_plateau[i, d] > 0:
651+
if n_plateau[i] > 0:
652652
G[i, start : start + n_plateau[i, 0]] = gi[i]
653-
start += n_plateau[i, 0]
653+
start += n_plateau[i]
654654
G[i, start : start + n_ramp_up[i, 0]] = np.linspace(
655655
gi[i], end_gradients[i], n_ramp_up[i, 0], axis=-1, endpoint=False
656656
)

0 commit comments

Comments
 (0)