get_gradient_times_to_travel#
- mrinufft.trajectories.tools.get_gradient_times_to_travel(kspace_end_loc=None, kspace_start_loc=None, end_gradients=None, start_gradients=None, gamma=Gammas.HYDROGEN, raster_time=0.01, gmax=0.04, smax=0.1, n_jobs=1)[source]#
Get gradient timing values for trapezoidal or triangular waveforms.
Compute gradient timing values to take k-space trajectories from position
ks
with gradientgs
to positionke
with gradientge
, while being hardware compliant. This function calculates the minimal number of time steps required for the ramp down, ramp up, and plateau phases of the gradient waveform, ensuring that the area traversed in k-space matches the desired trajectory while adhering to the maximum gradient amplitude and slew rate constraints.- 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).
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:
n_ramp_down (The timing values for the ramp down phase.)
n_ramp_up (The timing values for the ramp up phase.)
n_plateau (The timing values for the plateau phase.)
gi (The intermediate gradient values for trapezoidal or triangular waveforms.)
- Return type:
tuple[ndarray[tuple[int, …], dtype[_ScalarType_co]], ndarray[tuple[int, …], dtype[_ScalarType_co]], ndarray[tuple[int, …], dtype[_ScalarType_co]], ndarray[tuple[int, …], dtype[_ScalarType_co]]]
See also
get_gradient_amplitudes_to_travel_for_set_time
To directly get the waveforms required. This is most-likely what you want to use.