write_trajectory#
- mrinufft.io.nsp.write_trajectory(trajectory, FOV, img_size, grad_filename, norm_factor=0.5, gamma=Gammas.HYDROGEN, raster_time=0.01, check_constraints=True, TE_pos=0.5, gmax=0.04, smax=0.1, pregrad=None, postgrad=None, version=5, **kwargs)[source]#
Calculate gradients from k-space points and write to file.
- Parameters:
trajectory (np.ndarray) – Trajectory in k-space points. Shape (num_shots, num_samples_per_shot, dimension).
FOV (tuple) – Field of view
img_size (tuple) – Image size
grad_filename (str) – Gradient filename
norm_factor (float, optional) – Trajectory normalization factor, by default 0.5
gamma (float, optional) – Gyromagnetic ratio in kHz/T, by default 42.576e3
raster_time (float, optional) – Gradient raster time in ms, by default 0.01
check_constraints (bool, optional) – Check scanner constraints, by default True
TE_pos (float, optional) – The ratio of trajectory when TE occurs, with 0 as start of trajectory and 1 as end. By default 0.5, which is the center of the trajectory (in-out trajectory).
gmax (float, optional) – Maximum gradient magnitude in T/m, by default 0.04
smax (float, optional) – Maximum slew rate in T/m/ms, by default 0.1
pregrad (str, optional) – Pregrad method, by default prephase prephase will add a prephasing gradient to the start of the trajectory.
postgrad (str, optional) – Postgrad method, by default ‘slowdown_to_edge’ slowdown_to_edge will add a gradient to slow down to the edge of the k-space along x-axis for all the shots i.e. go to (Kmax, 0, 0). This is useful for sequences needing a spoiler at the end of the trajectory. However, spoiler is still not added, it is expected that the sequence handles the spoilers, which can be variable. slowdown_to_center will add a gradient to slow down to the center of the k-space.
version (float, optional) – Trajectory versioning, by default 5
kwargs (dict, optional) – Additional arguments for writing the gradient file. These are arguments passed to write_gradients function above.