project_trajectory#

mrinufft.trajectories.projection.project_trajectory(trajectory: ndarray[tuple[int, ...], dtype[_ScalarType_co]], acq: Acquisition | None = None, safety_factor: float = 0.99, max_iter: int = 1000, TE_pos: float | None = -1, linear_projector: Callable | None = None, verbose: int = 1) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]#

Projects the trajectory onto hardware constraint set.

This function implements ALgorithm 1 in _[Proj].

Parameters:
  • trajectory (NDArray) – The input trajectory to be projected, of shape (Nc, Ns, Nd).

  • acq (Acquisition, optional) – An instance of the Acquisition class containing the gradient constraints. If not provided, the projection will be performed without any constraints.

  • safety_factor (float) – An extra safety factor to ensure the projected trajectory is within hardware limits. Defaults to 0.99 (i.e., 1% margin).

  • max_iter (int) – The maximum number of iterations for the projection algorithm. Defaults to 1000.

  • TE_pos (float | None | -1) – Specifies the constrained position of the k-space center in the trajectory. If a float is provided, it should be in the range [0, 1] and indicates the relative position of the k-space center along the trajectory (e.g., 0.5 for the middle). If None, no such constraint is applied. Defaults to -1, which detect the position of the original k-space center and set the constraint accordingly.

  • linear_projector (LinearProjection, optional) – An instance of the LinearProjection class to perform the projection onto the constraint set. This is available for advanced users who want to specify custom linear constraints. If not provided, the projection is performed according to in_out

  • verbose (int, optional) – The verbosity level. If 0, no progress bar is shown. If 1, a progress bar is displayed. If 2 we show the iteration level cost function.

Returns:

NDArray

Return type:

The projected trajectory, of the same shape as the input.

References

[Proj]

N. Chauffert, P. Weiss, J. Kahn and P. Ciuciu, “A Projection Algorithm for Gradient Waveforms Design in Magnetic Resonance Imaging,” in IEEE Transactions on Medical Imaging, vol. 35, no. 9, pp. 2026-2039, Sept. 2016, doi: 10.1109/TMI.2016.2544251.

Note

This function uses numpy for all CPU arrays, and cupy for all on-gpu array. It will convert all its array argument to the respective array library. The outputs will be converted back to the original array module and device.

Example using project_trajectory:#

Learn Sampling pattern

Learn Sampling pattern

Sampling densities

Sampling densities

Trajectory constraints

Trajectory constraints