write_gradients#
- mrinufft.io.nsp.write_gradients(gradients, initial_positions, grad_filename, img_size, FOV, TE_pos=0.5, min_osf=5, gamma=Gammas.HYDROGEN, version=4.2, recon_tag=1.1, timestamp=None, keep_txt_file=False, final_positions=None, start_skip_samples=0, end_skip_samples=0)[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.
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).
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
start_skip_samples (int, optional) – Number of samples to skip in ADC at start of each shot, by default 0 This works only for version >= 5.1.
end_skip_samples (int, optional) – Number of samples to skip in ADC at end of each shot, by default 0 This works only for version >= 5.1.