write_gradients#
- mrinufft.io.nsp.write_gradients(gradients, initial_positions, grad_filename, img_size, FOV, in_out=True, min_osf=5, gamma=Gammas.HYDROGEN, version=4.2, recon_tag=1.1, timestamp=None, keep_txt_file=False, final_positions=None)[source]#
Create gradient file from gradients and initial positions.
- Parameters:
gradients (np.ndarray) – Gradients. Shape (num_shots, num_samples_per_shot, dimension).
initial_positions (np.ndarray) – Initial positions. Shape (num_shots, dimension).
grad_filename (str) – Gradient filename.
in_out (bool, optional) – Whether it is In-Out trajectory?, by default True
min_osf (int, optional) – Minimum oversampling factor needed at ADC, by default 5
gamma (float, optional) – Gyromagnetic ratio in kHz/T, by default 42.576e3
version (float, optional) – Trajectory versioning, by default 4.2
recon_tag (float, optional) – Reconstruction tag for online recon, by default 1.1
timestamp (float, optional) – Timestamp of trajectory, by default None
keep_txt_file (bool, optional) – Whether to keep the text file used temporarily which holds data pushed to binary file, by default False
final_positions (np.ndarray, optional) – Final positions. Shape (num_shots, dimension), by default None