get_gradient_amplitudes_to_travel_for_set_time#
- mrinufft.trajectories.tools.get_gradient_amplitudes_to_travel_for_set_time(kspace_end_loc, kspace_start_loc=None, end_gradients=None, start_gradients=None, nb_raster_points=None, gamma=Gammas.HYDROGEN, raster_time=0.01, gmax=0.04, smax=0.1, n_jobs=1)[source]#
Calculate timings for trapezoidal or triangular gradient waveforms.
Compute the gradient waveforms required to traverse from a starting k-space position
ks
to an ending k-space positionke
in a fixed number of time stepsN
, subject to hardware constraints on maximum gradient amplitudegmax
and slew ratesmax
. The function supports both trapezoidal and triangular gradient shapes, automatically adjusting the waveform to meet the area constraint imposed by the desired k-space traversal and the specified timing and hardware limits.- Parameters:
kspace_end_loc (NDArray) – Ending k-space positions, shape (nb_shots, nb_dimension).
kspace_start_loc (NDArray, default None when it is 0) – Starting k-space positions, shape (nb_shots, nb_dimension).
end_gradients (NDArray, default None when it is 0) – Ending gradient values, shape (nb_shots, nb_dimension).
start_gradients (NDArray, default None when it is 0) – Starting gradient values, shape (nb_shots, nb_dimension).
nb_raster_points (int, default None) – Number of time steps (samples) for the gradient waveform. If None, timing is calculated based on the area needed and hardware limits.
gamma (float, optional) – Gyromagnetic ratio in Hz/T. Default is Gammas.Hydrogen.
raster_time (float, optional) – Time interval between gradient samples (s). Default is DEFAULT_RASTER_TIME.
gmax (float, optional) – Maximum gradient amplitude (T/m). Default is DEFAULT_GMAX.
smax (float, optional) – Maximum slew rate (T/m/s). Default is DEFAULT_SMAX.
n_jobs (int, optional) – Number of parallel jobs to run for optimization, by default 1.
- Returns:
Gradient waveforms, shape (nb_shots, nb_samples_per_shot, nb_dimension), where each entry contains the gradient value at each time step for each shot and dimension.
- Return type:
NDArray
Notes
The function automatically determines whether a trapezoidal or triangular waveform is needed based on the area constraint and hardware limits.
The returned gradients are suitable for use in MRI pulse sequence design, ensuring compliance with specified hardware constraints.