@@ -378,7 +378,7 @@ def unepify(trajectory: NDArray, Ns_readouts: int, Ns_transitions: int) -> NDArr
378378 return trajectory
379379
380380
381- def get_gradient_timing_values (
381+ def get_gradient_times_to_travel (
382382 ks : NDArray | None = None ,
383383 ke : NDArray | None = None ,
384384 gs : NDArray | None = None ,
@@ -400,13 +400,13 @@ def get_gradient_timing_values(
400400 Parameters
401401 ----------
402402 ks : NDArray
403- Starting k-space positions, shape (num_shots, dimension ).
403+ Starting k-space positions, shape (nb_shots, nb_dimension ).
404404 ke : NDArray, default None when it is 0
405- Ending k-space positions, shape (num_shots, dimension ).
405+ Ending k-space positions, shape (nb_shots, nb_dimension ).
406406 gs : NDArray, default None when it is 0
407- Starting gradient values, shape (num_shots, dimension ).
407+ Starting gradient values, shape (nb_shots, nb_dimension ).
408408 ge : NDArray, default None when it is 0
409- Ending gradient values, shape (num_shots, dimension ).
409+ Ending gradient values, shape (nb_shots, nb_dimension ).
410410 gamma : float, optional
411411 Gyromagnetic ratio in Hz/T. Default is Gammas.Hydrogen.
412412 raster_time : float, optional
@@ -471,7 +471,7 @@ def get_gradient_timing_values(
471471 return n_ramp_down , n_ramp_up , n_plateau , gi
472472
473473
474- def get_gradients_for_set_time (
474+ def get_gradient_amplitudes_to_travel_for_set_time (
475475 ke : NDArray ,
476476 ks : NDArray | None = None ,
477477 gs : NDArray | None = None ,
@@ -495,13 +495,13 @@ def get_gradients_for_set_time(
495495 Parameters
496496 ----------
497497 ke : NDArray
498- Ending k-space positions, shape (num_shots, dimension ).
498+ Ending k-space positions, shape (nb_shots, nb_dimension ).
499499 ks : NDArray, default None when it is 0
500- Starting k-space positions, shape (num_shots, dimension ).
500+ Starting k-space positions, shape (nb_shots, nb_dimension ).
501501 gs : NDArray, default None when it is 0
502- Starting gradient values, shape (num_shots, dimension ).
502+ Starting gradient values, shape (nb_shots, nb_dimension ).
503503 ge : NDArray, default None when it is 0
504- Ending gradient values, shape (num_shots, dimension ).
504+ Ending gradient values, shape (nb_shots, nb_dimension ).
505505 N : int, default None
506506 Number of time steps (samples) for the gradient waveform.
507507 If None, timing is calculated based on the area needed and hardware limits.
@@ -517,8 +517,9 @@ def get_gradients_for_set_time(
517517 Returns
518518 -------
519519 G : NDArray
520- Gradient waveforms, shape (num_shots, N, dimension), where each entry contains
521- the gradient value at each time step for each shot and dimension.
520+ Gradient waveforms, shape (nb_shots, nb_samples_per_shot, nb_dimension)
521+ , where each entry contains the gradient value at each time step
522+ for each shot and dimension.
522523
523524 Notes
524525 -----
@@ -540,10 +541,10 @@ def get_gradients_for_set_time(
540541
541542 assert (
542543 ks .shape == ke .shape == gs .shape == ge .shape
543- ), "All input arrays must have shape (num_shots, dimension )"
544+ ), "All input arrays must have shape (nb_shots, nb_dimension )"
544545 if N is None :
545546 # Calculate the number of time steps based on the area needed
546- n_ramp_down , n_ramp_up , n_plateau , gi = get_gradient_timing_values (
547+ n_ramp_down , n_ramp_up , n_plateau , gi = get_gradient_times_to_travel (
547548 ks = ks ,
548549 ke = ke ,
549550 ge = ge ,
@@ -591,10 +592,10 @@ def get_gradients_for_set_time(
591592 gi = (2 * area_needed - (n_ramp_down + 1 ) * gs - (n_ramp_up - 1 ) * ge ) / (
592593 n_ramp_down + n_ramp_up + 2 * n_plateau
593594 )
594- num_shots , dimension = ke .shape
595- G = np .zeros ((num_shots , N , dimension ), dtype = np .float32 )
596- for i in range (num_shots ):
597- for d in range (dimension ):
595+ nb_shots , nb_dimension = ke .shape
596+ G = np .zeros ((nb_shots , N , nb_dimension ), dtype = np .float32 )
597+ for i in range (nb_shots ):
598+ for d in range (nb_dimension ):
598599 start = 0
599600 G [i , : n_ramp_down [i , d ], d ] = np .linspace (
600601 gs [i , d ], gi [i , d ], n_ramp_down [i , d ], endpoint = False
0 commit comments