fse_sim#

torchsim.fse_sim(flip, ESP, T1, T2, phases=0.0, TR=1000000.0, exc_flip=90.0, exc_phase=90.0, diff=None, slice_prof=1.0, B1=1.0, M0=1.0, nstates=10, chunk_size=None, device=None)[source]#

Fast Spin Echo simulator wrapper.

Parameters:
  • flip (float | npt.ArrayLike) – Refocusing flip angle train in degrees.

  • ESP (float) – Echo spacing in milliseconds.

  • phases (float | npt.ArrayLike, optional) – Refocusing flip angle phases in degrees. The default is 90.0.

  • TR (float | npt.ArrayLike, optional) – Repetition time in milliseconds. The default is 1e6.

  • exc_flip (float, optional) – Excitation flip angle train in degrees. The default is 90.0.

  • exc_phase (float, optional) – Excitation flip angle phase in degrees. The default is 0.0.

  • T1 (float | npt.ArrayLike) – Longitudinal relaxation time in milliseconds.

  • T2 (float | npt.ArrayLike) – Transverse relaxation time in milliseconds.

  • diff (str | tuple[str], optional) – Arguments to get the signal derivative with respect to. The default is None (no differentation).

  • slice_prof (float | npt.ArrayLike, optional) – Flip angle scaling along slice profile. The default is 1.0.

  • B1 (float | npt.ArrayLike, optional) – Flip angle scaling map, default is 1.0.

  • inv_efficiency (float | npt.ArrayLike, optional) – Inversion efficiency map, default is 1.0.

  • M0 (float or array-like, optional) – Proton density scaling factor, default is 1.0.

  • TI (float | npt.ArrayLike, optional) – Inversion time in milliseconds. The default is 0.0.

  • nstates (int, optional) – Number of EPG states to be retained. The default is 10.

  • chunk_size (int, optional) – Number of atoms to be simulated in parallel. The default is None.

  • device (str | torch.device, optional) – Computational device for simulation. The default is None (infer from input).

Returns:

  • sig (npt.ArrayLike) – Signal evolution of shape (..., len(flip)).

  • jac (npt.ArrayLike) – Derivatives of signal wrt diff parameters, of shape (..., len(diff), len(flip)). Not returned if diff is None.

Examples using torchsim.fse_sim#

Synthetic Data Generation

Synthetic Data Generation

Parameter Fitting

Parameter Fitting

Automatic differentiation

Automatic differentiation