Skip to content

Commit 1d0886e

Browse files
committed
Updated according to comments
2 parents 2293e0c + c2e0cb0 commit 1d0886e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/mrinufft/io/nsp.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def write_trajectory(
253253
Maximum slew rate in T/m/ms, by default 0.1
254254
pregrad : str, optional
255255
Pregrad method, by default `prephase`
256-
`prephase` will add a prephase gradient to the start of the trajectory.
256+
`prephase` will add a prephasing gradient to the start of the trajectory.
257257
postgrad : str, optional
258258
Postgrad method, by default 'slowdown_to_edge'
259259
`slowdown_to_edge` will add a gradient to slow down to the edge of the k-space
@@ -300,7 +300,7 @@ def write_trajectory(
300300
initial_positions = np.zeros_like(initial_positions)
301301
gradients = np.hstack([start_gradients, gradients])
302302
Ns_to_skip_at_start = start_gradients.shape[1]
303-
if postgrad is not None:
303+
if postgrad:
304304
if version < 5.1:
305305
raise ValueError(
306306
"postgrad is only supported for version >= 5.1, "
@@ -339,7 +339,7 @@ def write_trajectory(
339339
warnings.warn(
340340
"Slew rate at start of trajectory exceeds maximum slew rate!"
341341
f"Maximum slew rate: {np.max(np.abs(border_slew_rate)):.3f}"
342-
" > {smax:.3f}. Please use prephase gradient to avoid this "
342+
f" > {smax:.3f}. Please use prephase gradient to avoid this "
343343
" issue."
344344
)
345345

@@ -449,15 +449,15 @@ def read_trajectory(
449449
gradients = np.reshape(
450450
grad_max * gradients * 1e-3, (num_shots, num_samples_per_shot, dimension)
451451
)
452+
# Handle skipped samples
452453
if start_skip_samples > 0:
453454
start_location_updates = (
454455
np.sum(gradients[:, :start_skip_samples], axis=1) * raster_time * gamma
455456
)
456457
initial_positions += start_location_updates
457-
gradients = gradients[:, start_skip_samples:, :]
458-
if end_skip_samples > 0:
459-
gradients = gradients[:, :-end_skip_samples, :]
458+
gradients = gradients[:, start_skip_samples:-end_skip_samples, :]
460459
num_samples_per_shot -= start_skip_samples + end_skip_samples
460+
461461
if num_adc_samples is None:
462462
if read_shots:
463463
num_adc_samples = num_samples_per_shot + 1

src/mrinufft/trajectories/tools.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ def get_gradient_amplitudes_to_travel_for_set_time(
485485
) -> NDArray:
486486
"""Calculate timings for trapezoidal or triangular gradient waveforms.
487487
488-
Computes the gradient waveforms required to traverse from a starting k-space
488+
Compute the gradient waveforms required to traverse from a starting k-space
489489
position ``ks`` to an ending k-space position ``ke`` in a fixed number of time
490490
steps ``N``, subject to hardware constraints on maximum gradient amplitude
491491
``gmax`` and slew rate ``smax``. The function supports both trapezoidal

0 commit comments

Comments
 (0)